Is there any inbuilt store proc / any database program by which I can generate all the database object script(like stored procs, triggers, functions, tables etc.) from a particular database.
I am using SQL SERVER 2005 + 2008
Thanks in advance
Is there any inbuilt store proc / any database program by which I can generate all the database object script(like stored procs, triggers, functions, tables etc.) from a particular database.
I am using SQL SERVER 2005 + 2008
Thanks in advance
In Object Explorer in Microsoft Server Management Studio rightclick on the database and select Tasks -> Generate Script and then follow the guide...
from .net http://www.sqlteam.com/article/scripting-database-objects-using-smo-updated
from powershell http://www.mssqltips.com/tip.asp?tip=1745
sqlcmd http://www.edumax.com/microsoft-sql-server-the-sqlcmd-tool-and-sql-server-management-objects.html
SSMS itself uses SMO, namely the Scripter class. You can use SMO from any .Net application to extract scripts yourself.