Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Snippets/ReadMe.txt → Snippets/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
This zip file contains a set of SQL Prompt snippets for use with Red Gate SQL Prompt.

Red Gate SQL Prompt is not part of tSQLt and not required to use tSQLt.
You can get it here:http://www.red-gate.com/products/sql-development/sql-prompt/

To install the tSQLt snippets, unzip this zip file into the SQL Prompt Snippet Directory.
This directory is usually located in "AppData\Local\Red Gate\SQL Prompt 6\Snippets"
# SQL Prompt Snippets

This zip file contains a set of SQL Prompt snippets for use with Red Gate SQL Prompt.

Red Gate SQL Prompt is not part of tSQLt and not required to use tSQLt.
You can get it here:http://www.red-gate.com/products/sql-development/sql-prompt/

To install the tSQLt snippets, unzip this zip file into the SQL Prompt Snippet Directory.
This directory is usually located in `%localappdata%\Red Gate\SQL Prompt *\Snippets`
under your local user directory.
250 changes: 0 additions & 250 deletions Snippets/Snippets.ssmssqlproj

This file was deleted.

6 changes: 6 additions & 0 deletions Snippets/ida-f345a432-8e6b-4d35-bfc5-dd037df27c15.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "f345a432-8e6b-4d35-bfc5-dd037df27c15",
"prefix": "ida",
"description": "IF EXISTS DROP: Assembly - [provided by @sqlity]",
"body": "IF ASSEMBLYPROPERTY('$CURSOR$','CLRName') IS NOT NULL DROP ASSEMBLY ;"
}
Binary file removed Snippets/ida.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/idf-0a7ab066-938a-4b14-8737-c86af501a7cc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "0a7ab066-938a-4b14-8737-c86af501a7cc",
"prefix": "idf",
"description": "IF EXISTS DROP: Function - [provided by @sqlity]",
"body": "IF OBJECT_ID('$CURSOR$') IS NOT NULL DROP FUNCTION ;\nGO\n"
}
Binary file removed Snippets/idf.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/idl-6ec31ee9-825a-41ff-8b7f-3631742e438d.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "6ec31ee9-825a-41ff-8b7f-3631742e438d",
"prefix": "idl",
"description": "IF EXISTS DROP: Login - [provided by @sqlity]",
"body": "IF SUSER_SID('$CURSOR$') IS NOT NULL DROP LOGIN ;"
}
Binary file removed Snippets/idl.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/idp-64e12dc7-3127-44aa-9c6f-b4654df45d4b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "64e12dc7-3127-44aa-9c6f-b4654df45d4b",
"prefix": "idp",
"description": "IF EXISTS DROP: Procedure - [provided by @sqlity]",
"body": "IF OBJECT_ID('$CURSOR$') IS NOT NULL DROP PROCEDURE ;\nGO\n"
}
Binary file removed Snippets/idp.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/ids-519e7ad1-caef-46bc-a16f-439adf762cad.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "519e7ad1-caef-46bc-a16f-439adf762cad",
"prefix": "ids",
"description": "IF EXISTS DROP: Synonym - [provided by @sqlity]",
"body": "IF OBJECT_ID('$CURSOR$') IS NOT NULL DROP SYNONYM ;"
}
Binary file removed Snippets/ids.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/idt-b5b03738-987b-4049-91fa-7d78c298e7e1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "b5b03738-987b-4049-91fa-7d78c298e7e1",
"prefix": "idt",
"description": "IF EXISTS DROP: Table - [provided by @sqlity]",
"body": "IF OBJECT_ID('$CURSOR$') IS NOT NULL DROP TABLE ;"
}
Binary file removed Snippets/idt.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/idtr-801c48e6-6fa3-4313-aa39-3c6f1957606a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "801c48e6-6fa3-4313-aa39-3c6f1957606a",
"prefix": "idtr",
"description": "IF EXISTS DROP: Trigger - [provided by @sqlity]",
"body": "IF OBJECT_ID('$CURSOR$') IS NOT NULL DROP TRIGGER ;\nGO\n"
}
Binary file removed Snippets/idtr.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/idu-f2efaf3b-c1ac-4b6c-b74d-afb0d5e3c20c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "f2efaf3b-c1ac-4b6c-b74d-afb0d5e3c20c",
"prefix": "idu",
"description": "IF EXISTS DROP: User - [provided by @sqlity]",
"body": "IF USER_ID('$CURSOR$') IS NOT NULL DROP USER ;"
}
Binary file removed Snippets/idu.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/idv-678ed497-bed1-4917-8ca7-381f66fb7c10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "678ed497-bed1-4917-8ca7-381f66fb7c10",
"prefix": "idv",
"description": "IF EXISTS DROP: View - [provided by @sqlity]",
"body": "IF OBJECT_ID('$CURSOR$') IS NOT NULL DROP VIEW ;\nGO\n"
}
Binary file removed Snippets/idv.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/tab-79648b3c-3560-4c13-9057-9da7cd13ce0c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "79648b3c-3560-4c13-9057-9da7cd13ce0c",
"prefix": "tab",
"description": "tSQLt: about [tSQLt - Database Unit Testing for SQL Server. Get it at http://tsqlt.org]",
"body": "/*\n -----------------\n -- About tSQLt --\n -----------------\n\ntSQLt is an open source unit testing framework for SQL Server. \ntSQLt is coauthored by:\n- Dennis Lloyd Jr. ( @dennislloydjr | http://curiouslycorrect.com/ )\n- Sebastian Meine ( @sqlity | http://sqlity.net )\n\nYou can download tSQLt at http://tSQLt.org/downloads\nA more complete set of SQL Prompt snippets is available there too.\n\ntSQLt provides an array of procedures that help you to write robust test cases\nby isolating dependencies (e.g. tSQLt.FakeTable or tSQLt.SpyProcedure) and \nasserting correct behavior (e.g. tSQLt.AssertEqualsTable or tSQLt.ExpectException).\n\nTo create a test, you first need to create a schema using the tSQLt.NewTextClass\nprocedure. Any procedure that lives in such a schema and that has a name that \nbegins with the four letters \"test\" is considdered a test case. To execute a test\njust run tSQLt.Run passing in either the schema name or the fully qualified\ntest case name. To execute all test cases in the database run tSQLt.RunAll\n\nYou can find the tSQLt manual and examples at http://tsqlt.org/user-guide/\n\nTo check the version of tSQLt that is currently installed execute this query:\nSELECT * FROM tSQLt.Info();\nThe Version and the ClrVersion should always match.\n\nFor an easier way to manage and execute your tests check out Red Gate SQL Test.\n\nBelow is a test case template that also explains the three parts that every \ntest should contain.\n*/\nGO\n-- Comments here are associated with the test.\n-- For test case examples, see: http://tsqlt.org/user-guide/tsqlt-tutorial/\nCREATE PROCEDURE [<Test_Class,sysname,>].[<Test_Name,sysname,test >]\nAS\nBEGIN\n --Assemble\n -- This section is for code that sets up the environment. It often\n -- contains calls to methods such as tSQLt.FakeTable and tSQLt.SpyProcedure\n -- along with INSERTs of relevant data.\n -- For more information, see http://tsqlt.org/user-guide/isolating-dependencies/\n \n --Act\n -- Execute the code under test like a stored procedure, function or view\n -- and capture the results in variables or tables.\n \n --Assert\n -- Compare the expected and actual values, or call tSQLt.Fail in an IF statement. \n -- Typical Asserts: tSQLt.AssertEquals, tSQLt.AssertEqualsString, tSQLt.AssertEqualsTable\n -- For a complete list, see: http://tsqlt.org/user-guide/assertions/\n EXEC tSQLt.Fail 'TODO:Implement this test.'\n \nEND;\nGO\n\n"
}
Binary file removed Snippets/tab.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/tac-747cd3ce-14d7-473e-a42b-28418b597e89.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "747cd3ce-14d7-473e-a42b-28418b597e89",
"prefix": "tac",
"description": "tSQLt.ApplyConstraint [tSQLt - Database Unit Testing for SQL Server. Get it at http://tsqlt.org]",
"body": "EXEC tSQLt.ApplyConstraint @TableName = '$CURSOR$', @ConstraintName = '';"
}
Binary file removed Snippets/tac.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/tal-3e910591-b3d5-4f2d-9153-4d20b2f65656.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "3e910591-b3d5-4f2d-9153-4d20b2f65656",
"prefix": "tal",
"description": "tSQLt.AssertLike [tSQLt - Database Unit Testing for SQL Server. Get it at http://tsqlt.org]",
"body": "EXEC tSQLt.AssertLike @ExpectedPattern = '$CURSOR$', @Actual;"
}
Binary file removed Snippets/tal.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/tat-16d83281-6d7e-4327-81fc-75fefce996a3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "16d83281-6d7e-4327-81fc-75fefce996a3",
"prefix": "tat",
"description": "tSQLt.ApplyTrigger [tSQLt - Database Unit Testing for SQL Server. Get it at http://tsqlt.org]",
"body": "EXEC tSQLt.ApplyTrigger @TableName = '$CURSOR$', @TriggerName = '';"
}
Binary file removed Snippets/tat.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/tca-518a2895-ef22-4f49-a3ab-4a9807475509.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "518a2895-ef22-4f49-a3ab-4a9807475509",
"prefix": "tca",
"description": "tSQLt: SELECT INTO #Actual; [tSQLt - Database Unit Testing for SQL Server. Get it at http://tsqlt.org]",
"body": "SELECT *\nINTO #Actual\nFROM $CURSOR$;\n"
}
Binary file removed Snippets/tca.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/tce-df75f607-20c5-474d-bb43-a7dea61b0dbb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "df75f607-20c5-474d-bb43-a7dea61b0dbb",
"prefix": "tce",
"description": "tSQLt: create #Expected from #Actual [tSQLt - Database Unit Testing for SQL Server. Get it at http://tsqlt.org]",
"body": "SELECT TOP(0) A.* INTO #Expected FROM #Actual A RIGHT JOIN #Actual X ON 1=0;\n"
}
Binary file removed Snippets/tce.sqlpromptsnippet
Binary file not shown.
6 changes: 6 additions & 0 deletions Snippets/tco-e1d61823-f962-4817-b46b-1fa45d0f155e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "e1d61823-f962-4817-b46b-1fa45d0f155e",
"prefix": "tco",
"description": "tSQLt.CaptureOutput [tSQLt - Database Unit Testing for SQL Server. Get it at http://tsqlt.org]",
"body": "EXEC tSQLt.CaptureOutput '$CURSOR$';\n\nSELECT * \n INTO #Actual\n FROM tSQLt.CaptureOutputLog;\n\n"
}
Binary file removed Snippets/tco.sqlpromptsnippet
Binary file not shown.
Loading