Skip to content

Commit

Permalink
drop database snippet change to prevent command failure (#317)
Browse files Browse the repository at this point in the history
* drop database change to prevent comman failure

* fixed insert snippet missing comma

* simplified create table snippet

* reverted Identity column definition and fixed insert snippet
  • Loading branch information
erickangMSFT authored Nov 11, 2016
1 parent b360574 commit 002fd39
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions snippets/mssql.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"-- Connect to the 'master' database to run this snippet",
"USE master",
"GO",
"-- Uncomment the ALTER DATABASE statement below to set the database to SINGLE_USER mode if the drop database command fails because the database is in use.",
"-- ALTER DATABASE ${DatabaseName} SET SINGLE_USER WITH ROLLBACK IMMEDIATE;",
"-- Drop the database if it exists",
"IF EXISTS (",
" SELECT name",
Expand All @@ -66,11 +68,10 @@
"-- Create the table in the specified schema",
"CREATE TABLE ${SchemaName}.${TableName}",
"(",
" ${TableName}Id INT NOT NULL, -- primary key column",
" ${TableName}Id INT NOT NULL PRIMARY KEY, -- primary key column",
" Column1 [NVARCHAR](50) NOT NULL,",
" Column2 [NVARCHAR](50) NOT NULL",
" -- specify more columns here",
" CONSTRAINT PK_${TableName} PRIMARY KEY (${TableName}Id)",
");",
"GO"
],
Expand Down Expand Up @@ -138,10 +139,10 @@
")",
"VALUES",
"( -- first row: values for the columns in the list above",
" Column1_Value, Column2_Value, Column2_Value",
")",
" Column1_Value, Column2_Value, Column3_Value",
"),",
"( -- second row: values for the columns in the list above",
" Column1_Value, Column2_Value, Column2_Value",
" Column1_Value, Column2_Value, Column3_Value",
")",
"-- add more rows here",
"GO"
Expand Down

0 comments on commit 002fd39

Please sign in to comment.