SQLServerWiki

“The Only Thing That Is Constant Is Change”

Scripting the database using SCRIPTDB.exe from command prompt:

Posted by database-wiki on October 15, 2012

http://scriptdb.codeplex.com/

Command:

C:\Users\balajima\Desktop\ScriptDB -2008\ScriptDB -1008\bin\Release>Scriptdb.exe -con:server=WIN-ES7EVITPPV4\PSSDIAG2K8;database=test;trusted_connection=yes -outDir:scripts -ScriptAsCreate -filename:E:\qaz2.sql

clip_image002

For SQL Login:

C:\Users\balajima\Desktop\ScriptDB -2008\ScriptDB -1008\bin\Release>Scriptdb.exe -con:server=WIN-ES7EVITPPV4\PSSDIAG2K8;database=test;user=SA;password="SA" -outDir:scripts -ScriptAsCreate -filename:E:\final.sql

Result:

clip_image004

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: