• curious_sqldba (7/28/2016)


    I have looked online and on this forum but couldn't find exactly what i am looking for. I need a script that will dump definition of all the objects include table,sp,functions,views in a temp table. Then i will use the same script to get a dumo from other database and join them. Does anyone have such script?

    I am very well aware of Red Gate and other tools. I need this to be automated ,hence i need the scripts.

    I don't understand what you are looking for here. Are you wanting to get the ddl for every single object in the database? Do you have a specific structure for your table in mind? You mention joining this with similar data from another database. How do you plan on joining these tables? As it sits right now your question is sufficiently vague enough that it is incredibly difficult to even begin an answer. You need to provide us a LOT more information here.

    FWIW, this type of script is not going to be easy to put together. This is exactly why tools like SQL Compare exist.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/