views:

42

answers:

3

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

A: 

In Object Explorer in Microsoft Server Management Studio rightclick on the database and select Tasks -> Generate Script and then follow the guide...

Joakim Backman
I clearly wrote that I need to do the work using some spored procs and not by using SSMS tools
priyanka.sarkar
for not reading the question properly
adolf garlic
Sorry, I just read "any database program" not the title
Joakim Backman
it's ok.. we all make mistake (:
priyanka.sarkar
+1  A: 

SSMS itself uses SMO, namely the Scripter class. You can use SMO from any .Net application to extract scripts yourself.

Remus Rusanu