Avatar of nbkd72e
nbkd72e
 asked on

How to reverse-engineer the DDLs of all database objects with a script?

I need a mechanism which could be executed in a script (either Windows or UNIX) to generate the DDLs of re-creating all DB objects (tables, views, stored procedures etc.) in a given SQL Server 2008 database.

Any suggestion?
Microsoft SQL Server 2008

Avatar of undefined
Last Comment
nbkd72e

8/22/2022 - Mon
SOLUTION
JestersGrind

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
nbkd72e

ASKER
As I mentioned in the question, I need a mechanism which could be executed in a script, without human intervention.
SOLUTION
Som Tripathi

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
nbkd72e

ASKER
SMO sounds like a promising solution. Yes, code would be very helpful.
Som Tripathi

I can write code for you, but it might take time. you can read the article below and help yourself -

http://philergia.wordpress.com/2011/02/28/using-powershell-and-smo-to-script-sql-server-database-objects-3/u
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
nbkd72e

ASKER
Thanks folks. Now I have enough information to start with my solutions, probably powershell + SMO. It would be even better if SMO has a Java interface.