SQL Tips by Namwar Rizvi

May 8, 2007

Retrieving DDL of SQL Server objects

Filed under: Object Search,Query,TSQL — namwar @ 10:18 PM

Following is just a quickest and simplest way to retrieve DDL or the SQL required to create a database object:


Just replace “dbo.uspGetBillOfMaterials” with your required object name like table, stored procedure etc.



  1. Doesn’t work on SQL Server 7 or 2000 though …

    Comment by Anonymous — May 9, 2007 @ 1:59 PM | Reply

  2. Yes, you are right. It does not work on SQL Server 7 or 2000. For SQL Server 2000 and 2005 both, you can use

    Following is the link from msdn:


    Comment by Namwar — May 9, 2007 @ 4:02 PM | Reply

RSS feed for comments on this post. TrackBack URI

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

Blog at WordPress.com.

%d bloggers like this: