SQL Server 2012

2019-02-22 09:26发布

问题:

Is there a way to export DDL for SQL Server 2012?

A previous question of this nature was answered in Dec 2009, but it does not seem to apply, Previous answer: For SQL Server:

In SQL Server Management Studio, right click on your database and choose 'Tasks' -> 'Generate Scripts'.

You will be asked to choose which DDL objects to include in your script. link edited Dec 19 '09 at 8:58

answered Dec 18 '09 at 18:53 Daniel Vassallo 78.6k11129180

I've tried the suggestion, but after right-clicking on my database, these is no such "Tasks" option.

Any ideas?

2012 Analysis Services just has a deployment wizard. I'm not deploying, just trying to document. I've checked Data Quality Services, Integration Services, Performance Tools, but do not see anything that I recognize.

I've been working with SQL Devloper for Oracel for the past few years, but I seem to remember ACCESS and SQL Serever management had a Data Export on the Tools menu. It allowed you to pick and choose what to export, including DDl, with or without data.

I'd like to do something like that - include all my tables, but no data.

Any ideas?

Thanks.

回答1:

I assume you want to script the DDL from a particular database on your SQL Server 2012 instance. To do so you click on the database of interest in SSMS, then right click and then hover over 'Tasks >', and then across and down to click on 'Generate Scripts'. This will open the wizard as shown in the three screen shots below. Tip: Be sure to check out the scripting options on the 'Advanced' tab.



标签: ddl