"prefix": "sqlSelectTop5",
"body": "SELECT TOP 5 * FROM $ {1: TableName}",
"description": "User-defined snippet example 1"
},
"Create Table snippet": {
"prefix": "sqlCreateTable2",
"body": [
"- Create a new table called '$ {1: TableName}' in schema '$ {2: SchemaName}'",
"- Drop the table if nó đã có",
"IF OBJECT_ID ('$ 2. $ 1', 'U') IS NOT NULL",
"DROP TABLE $ 2. $ 1",
"GO",
"- Create the table in the specified schema",
"CREATE TABLE $ 2. $ 1",
"(",
"$ 1Id INT NOT NULL PRIMARY KEY, - the primary key column",
"Column1 [NVARCHAR] (50) NOT NULL,",
"Column2 [NVARCHAR] (50) NOT NULL",
"- specify more columns here",
");",
"GO"
],
"description": "User-defined snippet example 2"
}
4. Save the sql.json file .
5. Open the new query editor window by clicking Ctrl + N.
6. Enter sql and you will see two user code sections that you just added: sqlCreateTable2 and sqlSelectTop5.
Choose one of the new code and run the test!
See more: