我公司中的部署程序需要用于创建过程和表等的SQL脚本。
在SQL Server中生成创建脚本管理Studio明显超过一个裸脚本,这是不幸的在这种情况下。例如,对于测试表,这是SSMS为我生成的:
USE [DemoDB] GO / ******对象:Table [dbo]。[example]脚本日期:08/07/2012 15:46:32 ****** / SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo]。[example]( [fake_row] [int] NULL )ON [PRIMARY] GO所以,我想知道的是:
我可以以某种方式在SSMS中的SQL Server上运行一个查询,这将给我一个脚本只是以下?
创建表示例( fake_row int )解决方案
对自我答案抱歉,标示其他好的答案+1。
事实证明,你可以使用SSMS中的实用程序。
The deployment procedures in my company require that SQL scripts for creation of procedures and tables, etc. be bare.
Generating create scripts in SQL Server Management Studio gives you significantly more than a bare script, which is unfortunate in this case. For example, for a test table this is what SSMS generated for me:
USE [DemoDB] GO /****** Object: Table [dbo].[example] Script Date: 08/07/2012 15:46:32 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[example]( [fake_row] [int] NULL ) ON [PRIMARY] GOSo, what I'd like to know is:
Can I somehow run a query on SQL Server in SSMS that would give me a script that was literally just the following?
create table example ( fake_row int )解决方案
Apologies for the self-answer, marking other good answers +1.
It turns out you can get pretty much all of the way there with utility in SSMS.
更多推荐
在SQL Server中生成** bare ** CREATE TABLE和CREATE PROC statemnts
发布评论