Off hand I don't know of any tools that do this. I wrote my own once but it was not extensive enough to encompas everything. But I did not retain the code for it, it wasn't complete anyway.
The first step in my stored procedure scripted all the table create scripts into a text file (without primary key or identities).
The next step created insert statements from the data into another file.
Then the indexes and foreign keys were created into a seperate file but you could put it all in one with go statments between.
Then another step created all the stored procedures from a given database.
The procedure could be run for multiple databases to get the rest of the info.
It was a bit incomplete and bug prone and needed tweeks to make it work. It would take a lot of work to cover all possible permutations I just went far enough to cover my needs.
To do this process you have to read the info from the system tables.
It requires reasonably advanced knowledge of MSSQL to do.
|