Wednesday, March 7, 2012

DDL Extraction

Does anyone know how to pull DDL create statements out of a SQL Server 2005 EE database for existing objects? I'm mainly concerned with indexes and constraints. If possible I can create the statements myself if I can get all of the information out of the databse.

Thanks in advance

Hi,

you can either use the SMO class libraries to use the Script() method on the objects or the GUI of SQL Server Managment Studio which does the same things behind the scenes.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de|||

Thanks I'll check it out.

I was looking for something that is not using .NET code and is just SQL.

|||You can look in the system views and get all the information you need. INFORMATION_SCHEMA prefixed views are a more denormalized version of the sys.XXX views and will contain most everything you would need to script create statements.

No comments:

Post a Comment