QueryTo Get All Scripts

  • hi

    All,

    Is there any QueryTo Get All Scripts in A DataBase

  • You can generate the script of the whole database including the objects using "Generate SQl Script Wizard".

    Tanx 😀

  • hi

    Thanx for your reply i know that is there any other way to Genereate the Script to Get All Database scripts using Query

  • Syscomments table's text column contains the script of sps,triggers and functions..

    That may be partially smthng that u r looking for..

  • Here's a good starting point for you

    select p.name,c.text from sys.syscomments c

    inner join sys.procedures p

    on p.object_id = c.id

  • hi

    Thanx for u r Reply

    Yes we can get the Sp's function in this Quesry

    select p.object_id, p.name,c.text from sys.syscomments c

    inner join sys.procedures p

    on p.object_id = c.id

    and as well this

    select p.name,c.definition from sys.sql_modules c

    inner join sys.objects p

    on p.object_id = c.Object_Id

    but my Question is How can we get Tables scripts and what ever we get the resultset from the the above mentioned Query i need take that in new Query window with same indentation is it possibe if so how

    Thanks

    Deepak.a

  • Do a search for the old ScptXfr.exe code that used to come with SQL Server 2000. Rumor has it that it works well with SQL Server 2005 but I've not tested it because I no longer have it.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply