April 28, 2011 at 5:45 am
Hi,
How to extract all objects schema(“CREATE” statements) of a database?
Thanks
April 28, 2011 at 8:05 am
Depends. Do you want to just do it, or do you want to do it programatically? If you just need a script, right click on the database, select Tasks and Generate Scripts.... That will spit the object scripts out for whatever you want.
If you want to do it programmatically, you should look at SMO. Personally, I'd use SMO through PowerShell.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 28, 2011 at 8:07 am
Thanks but this is for SQL 7 database objects 🙁
April 28, 2011 at 8:18 am
One, you're posting in the SQL Server 2005 forum. You might want to take this question to that forum.
Two, the old SQL Server software had a mechanism for generating scripts as well. I think you could program against it using DMO, but that might not be right. I forget. SQL Server 7 is about 12 years in my past now.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply