├── Azure Data Studio ├── README.md └── RedgateSnippetsToJsonAzureDataStudio.ps1 ├── README.md ├── Snippets ├── .DS_Store ├── ac.sqlpromptsnippet ├── af.sqlpromptsnippet ├── ap.sqlpromptsnippet ├── at.sqlpromptsnippet ├── ata.sqlpromptsnippet ├── atac.sqlpromptsnippet ├── atd.sqlpromptsnippet ├── atdc.sqlpromptsnippet ├── atdt.sqlpromptsnippet ├── atdta.sqlpromptsnippet ├── atet.sqlpromptsnippet ├── ateta.sqlpromptsnippet ├── be.sqlpromptsnippet ├── bt.sqlpromptsnippet ├── ccc.sqlpromptsnippet ├── cci.sqlpromptsnippet ├── cdb.sqlpromptsnippet ├── cdbsnap.sqlpromptsnippet ├── citf.sqlpromptsnippet ├── cj.sqlpromptsnippet ├── cl.sqlpromptsnippet ├── clrp.sqlpromptsnippet ├── cni.sqlpromptsnippet ├── cp.sqlpromptsnippet ├── cseq.sqlpromptsnippet ├── csf.sqlpromptsnippet ├── ct.sqlpromptsnippet ├── cte.sqlpromptsnippet ├── ctf.sqlpromptsnippet ├── ctr.sqlpromptsnippet ├── ctt.sqlpromptsnippet ├── cu.sqlpromptsnippet ├── cuci.sqlpromptsnippet ├── cuni.sqlpromptsnippet ├── curff.sqlpromptsnippet ├── cv.sqlpromptsnippet ├── cw.sqlpromptsnippet ├── dd.sqlpromptsnippet ├── df.sqlpromptsnippet ├── dfn.sqlpromptsnippet ├── di.sqlpromptsnippet ├── dl.sqlpromptsnippet ├── dp.sqlpromptsnippet ├── dseq.sqlpromptsnippet ├── dt.sqlpromptsnippet ├── du.sqlpromptsnippet ├── dupk.sqlpromptsnippet ├── dv.sqlpromptsnippet ├── err.sqlpromptsnippet ├── fj.sqlpromptsnippet ├── foj.sqlpromptsnippet ├── gb.sqlpromptsnippet ├── gep.sqlpromptsnippet ├── git.sqlpromptsnippet ├── giust.sqlpromptsnippet ├── gst.sqlpromptsnippet ├── gut.sqlpromptsnippet ├── header.sqlpromptsnippet ├── hhmm.sqlpromptsnippet ├── ifs.sqlpromptsnippet ├── ii.sqlpromptsnippet ├── ij.sqlpromptsnippet ├── inn.sqlpromptsnippet ├── is.sqlpromptsnippet ├── isc.sqlpromptsnippet ├── isnn.sqlpromptsnippet.xml ├── isns.sqlpromptsnippet ├── j.sqlpromptsnippet ├── lin.sqlpromptsnippet ├── linn.sqlpromptsnippet ├── lj.sqlpromptsnippet ├── lk.sqlpromptsnippet ├── loj.sqlpromptsnippet ├── mmddyyyy.sqlpromptsnippet ├── mmddyyyyhhmm.sqlpromptsnippet ├── mro.sqlpromptsnippet ├── neo.sqlpromptsnippet ├── num.sqlpromptsnippet ├── numc.sqlpromptsnippet ├── nvseq.sqlpromptsnippet ├── ob.sqlpromptsnippet ├── rj.sqlpromptsnippet ├── rnum.sqlpromptsnippet ├── roj.sqlpromptsnippet ├── rt.sqlpromptsnippet ├── san.sqlpromptsnippet ├── scf.sqlpromptsnippet ├── sd.sqlpromptsnippet ├── setvar.sqlpromptsnippet ├── smf.sqlpromptsnippet ├── sph.sqlpromptsnippet ├── spt.sqlpromptsnippet ├── sqi.sqlpromptsnippet ├── ss0.sqlpromptsnippet ├── ssf.sqlpromptsnippet ├── ssf2.sqlpromptsnippet ├── sst.sqlpromptsnippet ├── st100.sqlpromptsnippet ├── sxa.sqlpromptsnippet ├── tc.sqlpromptsnippet ├── today.sqlpromptsnippet ├── trim.sqlpromptsnippet ├── trims.sqlpromptsnippet ├── uci.sqlpromptsnippet ├── w2.sqlpromptsnippet ├── wdc.sqlpromptsnippet ├── wn.sqlpromptsnippet ├── wt.sqlpromptsnippet ├── xpfd.sqlpromptsnippet └── yell.sqlpromptsnippet └── snippet-list.txt /Azure Data Studio/README.md: -------------------------------------------------------------------------------- 1 | # Convert Redgate xml snippets to Azure Data Studio json snippet 2 | 3 | Script that takes all the xml snippets, extracts the most important information (shortcut, description and code) and creates a single json file containing all the snippets. 4 | 5 | Basic Usage: 6 | 7 | C:\your\folder> RedgateSnippetsToJsonAzureDataStudio.ps1 8 | 9 | Additional parameters: 10 | 11 | * -username: optional, allows to specify a different username; default: current user 12 | * -snippetsfolder: optional, allows to specify the folder that contains the snippets; default: "C:\Users\\$username\AppData\Local\Red Gate\SQL Prompt 9\Snippets" 13 | * -outputfolder: optional, allows to specify the folder in which the .code-snippets will be placed; default: "C:\Users\\$username\AppData\Roaming\azuredatastudio\User\snippets" 14 | 15 | Given a username _Developer_, the scripts will search inside the directory 16 | 17 | C:\Users\Developer\AppData\Local\Red Gate\SQL Prompt 9\Snippets 18 | 19 | The output will be a file named **redgate.code-snippets**, placed by default in 20 | 21 | C:\Users\Developer\AppData\Roaming\azuredatastudio\User\snippets 22 | 23 | If the output folder doesn't exists, it will be used c:\temp\ 24 | **The script will override any previously created file with the same name and extension inside the destination folder** -------------------------------------------------------------------------------- /Azure Data Studio/RedgateSnippetsToJsonAzureDataStudio.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [string]$username = "$env:UserName", 3 | [string]$snippetsfolder = "C:\Users\$username\AppData\Local\Red Gate\SQL Prompt 9\Snippets", 4 | [string]$outputfolder = "C:\Users\$username\AppData\Roaming\azuredatastudio\User\snippets" 5 | ) 6 | 7 | if ($username -eq "") { 8 | Write-Error "-username cannot be empty"; 9 | return; 10 | } 11 | 12 | if ($snippetsfolder -eq "") { 13 | Write-Error "-snippetsfolder cannot be empty"; 14 | return; 15 | } 16 | 17 | if ($snippetsfolder -eq "") { 18 | Write-Error "-outputfolder cannot be empty"; 19 | return; 20 | } 21 | 22 | if (-Not (Test-Path -Path $snippetsfolder)) { 23 | Write-Error "'$snippetsfolder' does not exists"; 24 | return; 25 | } 26 | 27 | if (-Not (Test-Path -Path $outputfolder)) { 28 | 29 | Write-Host "'$outputfolder' does not exists, 'C:\temp' will be used instead" -ForegroundColor Yellow 30 | 31 | $outputfolder = "C:\Temp" 32 | 33 | if (-Not (Test-Path -Path $outputfolder)) { 34 | New-Item -ItemType Directory -Force -Path $outputfolder 35 | } 36 | } 37 | else { 38 | if (-Not (Test-Path -Path $outputfolder -PathType Container)) { 39 | Write-Error "-outputfolder must be a directory"; 40 | return; 41 | } 42 | } 43 | 44 | $outFile = Join-Path $outputfolder "redgate.code-snippets" 45 | $dict = @{} 46 | 47 | Get-ChildItem $snippetsfolder -Filter *.sqlpromptsnippet | 48 | Foreach-Object { 49 | 50 | $content = [XML](Get-Content $_.FullName ) 51 | 52 | $body = [System.Collections.ArrayList]@() 53 | $null = $body.Add($content.SelectSingleNode("//Snippet/Code").InnerText) 54 | 55 | $definition = [ordered]@{ 56 | 'prefix' = $content.SelectSingleNode("//Header/Shortcut").InnerText 57 | 'body' = $body 58 | 'description' = '' 59 | } 60 | $dict[$content.SelectSingleNode("//Header/Title").InnerText] = $definition 61 | } 62 | If (Test-Path $outFile) { 63 | Remove-Item $outFile 64 | } 65 | $dict | ConvertTo-Json | Out-File -filepath $outFile -Encoding "UTF8" 66 | 67 | Write-Host "'$outFile' created" -ForegroundColor Green -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Read Me ### 2 | 3 | * This repository is for sharing the best Red Gate SQL Prompt snippets 4 | * Red Gate SQL Prompt is the industry standard for providing in-IDE code snippets, to speed you up when programming T-SQL 5 | * See http://www.red-gate.com/products/sql-development/sql-prompt/ for more information 6 | 7 | ### Why? ### 8 | 9 | * SQL Prompt's default snippets are great, but not at all collaborative 10 | * This repository aims to make the process of templating SQL code more collaborative 11 | * See: http://www.sqlservercentral.com/articles/SQL+PROMPT/127715/ 12 | 13 | ### How do I get set up? ### 14 | 15 | * Install Red Gate SQL Prompt. It works in SQL Server Management Studio (SSMS), and SQL Server Development Tools in Visual Studio (SSDT) 16 | * Clone this Repo to the following directory: "%LOCALAPPDATA%\Red Gate\SQL Prompt 6\Snippets" 17 | * Manage snippets via the SQL Prompt Snippet Manager 18 | 19 | ### Contribution guidelines ### 20 | 21 | * Fork this repo 22 | * Add / edit snippets 23 | * Keep snippet-list.txt (root directory) updated 24 | * Submit contributions as Pull Requests -------------------------------------------------------------------------------- /Snippets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gvohra/sqlpromptsnippets/4fcef44479b3eb68c8075b11f17d237bd21c1363/Snippets/.DS_Store -------------------------------------------------------------------------------- /Snippets/ac.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ac 6 | ac 7 | ALTER COLUMN 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/af.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | af 6 | af 7 | ALTER FUNCTION 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/ap.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ap 6 | ap 7 | ALTER PROCEDURE 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/at.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | at 6 | at 7 | ALTER TABLE 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/ata.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ata 6 | ata 7 | Add column 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/atac.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | atac 6 | atac 7 | Modify column 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/atd.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | atd 6 | atd 7 | Drop column 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/atdc.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | atdc 6 | atdc 7 | Drop constraint 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/atdt.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | atdt 6 | atdt 7 | Disable trigger 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/atdta.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | atdta 6 | atdta 7 | Disable all triggers on table 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 17 | 18 |
19 |
-------------------------------------------------------------------------------- /Snippets/atet.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | atet 6 | atet 7 | Enable trigger 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/ateta.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | ateta 6 | ateta 7 | Enable all triggers on table 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 17 | 18 |
19 |
-------------------------------------------------------------------------------- /Snippets/be.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | be 6 | be 7 | Inserts BEGIN..END block 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 18 | 19 |
20 |
-------------------------------------------------------------------------------- /Snippets/bt.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | bt 6 | bt 7 | Begin transaction 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/ccc.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ccc 6 | ccc 7 | CREATE CELL CALCULATION fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/cci.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cci 6 | cci 7 | Create non-unique clustered index 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 26 | 27 |
28 |
-------------------------------------------------------------------------------- /Snippets/cdb.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cdb 6 | cdb 7 | CREATE DATABASE statement 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 45 | 46 |
47 |
-------------------------------------------------------------------------------- /Snippets/cdbsnap.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cdbsnap 6 | cdbsnap 7 | Create a database snapshot 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 24 | 25 |
26 |
-------------------------------------------------------------------------------- /Snippets/citf.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | citf 6 | citf 7 | Create inline table-valued function 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 23 | 24 |
25 |
-------------------------------------------------------------------------------- /Snippets/cj.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cj 6 | cj 7 | CROSS JOIN fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/cl.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cl 6 | cl 7 | Create a new SQL Server login 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 33 | 34 |
35 |
-------------------------------------------------------------------------------- /Snippets/clrp.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | clrp 6 | clrp 7 | Create a CLR stored procedure 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 28 | 29 |
30 |
-------------------------------------------------------------------------------- /Snippets/cni.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cni 6 | cni 7 | Create non-unique nonclustered index 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 26 | 27 |
28 |
-------------------------------------------------------------------------------- /Snippets/cp.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cp 6 | cp 7 | Create a stored procedure 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 27 | 28 |
29 |
-------------------------------------------------------------------------------- /Snippets/cseq.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cseq 6 | cseq 7 | Create Sequence starts with x increment by y cache and cicle 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | SchemaName 17 | 18 | 19 | 20 | 21 | SequenceName 22 | 23 | 24 | 25 | 26 | Start 27 | 28 | 1 29 | 30 | 31 | End 32 | 33 | 2147483647 34 | 35 | 36 | Cycle 37 | 38 | CYCLE 39 | 40 | 41 | Cache 42 | 43 | CACHE 44 | 45 | 46 | 51 | 52 |
53 |
-------------------------------------------------------------------------------- /Snippets/csf.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | csf 6 | csf 7 | Create scalar function 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 26 | 27 |
28 |
-------------------------------------------------------------------------------- /Snippets/ct.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ct 6 | ct 7 | Create a table 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 19 | 20 |
21 |
-------------------------------------------------------------------------------- /Snippets/cte.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cte 6 | cte 7 | New common table expression 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 23 | 24 |
25 |
-------------------------------------------------------------------------------- /Snippets/ctf.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ctf 6 | ctf 7 | Create multi-statement table-valued function 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 26 | 27 |
28 |
-------------------------------------------------------------------------------- /Snippets/ctr.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ctr 6 | ctr 7 | Commit transaction 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/ctt.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ctt 6 | ctt 7 | Create TEMP Table 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | table_name 17 | 18 | tmpTable 19 | 20 | 21 | 23 | 24 |
25 |
-------------------------------------------------------------------------------- /Snippets/cu.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cu 6 | cu 7 | Create a database user 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 23 | 24 |
25 |
-------------------------------------------------------------------------------- /Snippets/cuci.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cuci 6 | cuci 7 | Create unique clustered index 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 26 | 27 |
28 |
-------------------------------------------------------------------------------- /Snippets/cuni.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cuni 6 | cuni 7 | Create unique nonclustered index 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 26 | 27 |
28 |
-------------------------------------------------------------------------------- /Snippets/curff.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | curff 6 | curff 7 | Boilerplate code for fast-forward read-only cursor 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 35 | 36 |
37 |
-------------------------------------------------------------------------------- /Snippets/cv.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cv 6 | cv 7 | Create a view 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 22 | 23 |
24 |
-------------------------------------------------------------------------------- /Snippets/cw.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | cw 6 | cw 7 | CASE WHEN 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/dd.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | dd 6 | dd 7 | Drop a database 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/df.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | df 6 | df 7 | DELETE FROM fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/dfn.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | dfn 6 | dfn 7 | Drop a function 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/di.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | di 6 | di 7 | Drop an index 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/dl.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | dl 6 | dl 7 | Drop a login 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/dp.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | dp 6 | dp 7 | Drop a stored procedure 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/dseq.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | dseq 6 | dseq 7 | Drop sequence 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | SchemaName 17 | 18 | 19 | 20 | 21 | SequenceName 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
-------------------------------------------------------------------------------- /Snippets/dt.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | dt 6 | dt 7 | Drop a table 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/du.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | du 6 | du 7 | Drop a user 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/dupk.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | dupk 6 | dupk 7 | Check for n-uplicate values on a column 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | Column 17 | 18 | 19 | 20 | 21 | SchemaName 22 | 23 | 24 | 25 | 26 | ObjectName 27 | 28 | 29 | 30 | 31 | Occurrences 32 | 33 | 34 | 35 | 36 | $Occurrences$;]]> 44 | 45 |
46 |
-------------------------------------------------------------------------------- /Snippets/dv.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | dv 6 | dv 7 | Drop a view 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/err.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | err 6 | err 7 | Inserts @@ERROR function call 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/fj.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | fj 6 | fj 7 | FULL JOIN fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/foj.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | foj 6 | foj 7 | FULL OUTER JOIN fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/gb.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | gb 6 | gb 7 | GROUP BY 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/gep.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | gep 6 | gep 7 | Grant Execute on Procedure 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | ProcedureName 17 | 18 | 19 | 20 | 21 | RoleOrUser 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
-------------------------------------------------------------------------------- /Snippets/git.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | git 6 | git 7 | Grant Insert on Table 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | ObjectName 17 | 18 | 19 | 20 | 21 | RoleOrUser 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
-------------------------------------------------------------------------------- /Snippets/giust.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | giust 6 | giust 7 | Grant Insert Update Select on Table 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | ObjectName 17 | 18 | 19 | 20 | 21 | RoleOrUser 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
-------------------------------------------------------------------------------- /Snippets/gst.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | gst 6 | gst 7 | Grant Select on Table 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | ObjectName 17 | 18 | 19 | 20 | 21 | RoleOrUser 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
-------------------------------------------------------------------------------- /Snippets/gut.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | gut 6 | gut 7 | Grant Update on Table 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | ObjectName 17 | 18 | 19 | 20 | 21 | RoleOrUser 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
-------------------------------------------------------------------------------- /Snippets/header.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | header 6 | header 7 | Template header for stored procedure 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 22 | -- 23 | --============================================================================================================]]> 24 | 25 |
26 |
-------------------------------------------------------------------------------- /Snippets/hhmm.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | hhmm 6 | hhmm 7 | HH:mm format 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | date_column 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 |
-------------------------------------------------------------------------------- /Snippets/ifs.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ifs 6 | ifs 7 | IF fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | condition 17 | 18 | 1 = 1 19 | 20 | 21 | 25 | 26 |
27 |
-------------------------------------------------------------------------------- /Snippets/ii.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ii 6 | ii 7 | INSERT INTO fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/ij.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ij 6 | ij 7 | INNER JOIN fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/inn.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | inn 6 | inn 7 | Is Not Null 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/is.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | is 6 | is 7 | Shortcut for INFORMATION_SCHEMA 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/isc.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | isc 6 | isc 7 | Column Information Grabber 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/isnn.sqlpromptsnippet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | isns 6 | isns 7 | ISNULL NUMBER: WRAP CURRENT SELECTION IN ISNULL OPERATOR for a number, default to zero 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/isns.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | isns 6 | isns 7 | ISNULL STRING: WRAP CURRENT SELECTION IN ISNULL OPERATOR for a string 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/j.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | j 6 | j 7 | JOIN fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/lin.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | lin 6 | lin 7 | Line 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/linn.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | linn 6 | linn 7 | Double line with space for text comment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 18 | 19 |
20 |
-------------------------------------------------------------------------------- /Snippets/lj.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | lj 6 | lj 7 | LEFT JOIN 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/lk.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | lk 6 | lk 7 | like '% %' 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/loj.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | loj 6 | loj 7 | LEFT OUTER JOIN fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/mmddyyyy.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | mmddyyyy 6 | mmddyyyy 7 | MM/DD/YYYY (101) Date Format 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | alias 17 | 18 | 19 | 20 | 21 | column_name 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
-------------------------------------------------------------------------------- /Snippets/mmddyyyyhhmm.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | mmddyyyyhhmm 6 | mmddyyyyhhmm 7 | Month - Day - Year - hour - minute 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | date_column 17 | 18 | 19 | 20 | 21 | alias 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
-------------------------------------------------------------------------------- /Snippets/mro.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | mro 6 | mro 7 | Retrieves information about 20 most recently created objects from database 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 18 | 19 |
20 |
-------------------------------------------------------------------------------- /Snippets/neo.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | neo 6 | neo 7 | A word from one of our sponsors 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/num.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | num 6 | num 7 | Format a big number into a readable format 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/numc.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | numc 6 | numc 7 | Nicely formatted COUNT(*) as numRows 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/nvseq.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | nvseq 6 | nvseq 7 | Next Value from a Sequence 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | SchemaName 17 | 18 | 19 | 20 | 21 | SequenceName 22 | 23 | 24 | 25 | 26 | Alias 27 | 28 | NextValue 29 | 30 | 31 | 32 | 33 |
34 |
-------------------------------------------------------------------------------- /Snippets/ob.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ob 6 | ob 7 | ORDER BY 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/rj.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | rj 6 | rj 7 | RIGHT JOIN fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/rnum.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | rnum 6 | rnum 7 | ROW_NUMBER() OVER () fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/roj.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | roj 6 | roj 7 | RIGHT OUTER JOIN fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/rt.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | rt 6 | rt 7 | Rollback transaction 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/san.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | san 6 | san 7 | Change the current ANSI_NULLS setting 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/scf.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | scf 6 | scf 7 | Count number of records returned by query, formatted nicely 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/sd.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | sd 6 | sd 7 | SELECT DISTINCT 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/setvar.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | setvar 6 | setvar 7 | SQL CMD setvar fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/smf.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | smf 6 | smf 7 | SELECT SUM() FROM 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/sph.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | sph 6 | sph 7 | Execute sp_help 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/spt.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | spt 6 | spt 7 | Execute sp_helptext 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/sqi.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | sqi 6 | sqi 7 | Change the current QUOTED_IDENTIFIER setting 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/ss0.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ss0 6 | ss0 7 | SELECT TOP 0 * FROM 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/ssf.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ssf 6 | ssf 7 | SELECT * FROM fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/ssf2.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | ssf2 6 | ssf2 7 | SELECT * FROM fragment. Formatted nicely with tabs and new lines. 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 17 | 18 |
19 |
-------------------------------------------------------------------------------- /Snippets/sst.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | sst 6 | sst 7 | SELECT TOP 1000 * FROM 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/st100.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | st100 6 | st100 7 | SELECT top 100 rows 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 17 | 18 |
19 |
-------------------------------------------------------------------------------- /Snippets/sxa.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | sxa 6 | sxa 7 | Change the current XACT_ABORT setting 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/tc.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | tc 6 | tc 7 | TRY ... CATCH fragment 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 21 | 22 |
23 |
-------------------------------------------------------------------------------- /Snippets/today.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | today 6 | today 7 | CAST(GETDATE() as date) 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/trim.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | trim 6 | trim 7 | 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/trims.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | trims 6 | trims 7 | Wrap selected text in LTRIM(RTRIM()) 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/uci.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | uci 6 | uci 7 | Unique Clustered Index 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/w2.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | w2 6 | w2 7 | Execute sp_who2 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/wdc.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | wdc 6 | wdc 7 | WITH (DATA_COMPRESSION = PAGE) 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/wn.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | wn 6 | wn 7 | WITH (NOLOCK) 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/wt.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | wt 6 | wt 7 | WITH (TABLOCK) 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/xpfd.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | xpfd 6 | xpfd 7 | Retrieve free space on all fixed drives 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
-------------------------------------------------------------------------------- /Snippets/yell.sqlpromptsnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | yell 6 | yell 7 | Vent your frustration 8 | 9 | 10 | Expansion 11 | 12 |
13 | 14 | 15 | 25 | 26 |
27 |
-------------------------------------------------------------------------------- /snippet-list.txt: -------------------------------------------------------------------------------- 1 | GitHub /sqlpromptsnippets File Index 2 | 3 | File Description 4 | ------- ------------------------------------------------------------------------------- 5 | ac ALTER COLUMN 6 | af ALTER FUNCTION 7 | ap ALTER PROCEDURE 8 | at ALTER TABLE 9 | ata Add column 10 | atac Modify column 11 | atd Drop column 12 | atdc Drop constraint 13 | atdt Disable a trigger on table 14 | atdta Disable all triggers on table 15 | atet Enable a trigger on table 16 | ateta Enable all triggers on table 17 | be BEGIN...END 18 | bt BEGIN TRANSACTION 19 | ccc CREATE CELL CALCULATION fragment 20 | cci Create non-unique clustered index 21 | cdb CREATE DATABASE 22 | cdbsnap Create a database snapshot 23 | citf Create inline table-valued function 24 | cj CROSS JOIN fragment 25 | cl Create a new SQL Server login 26 | clrp Create a CLR stored procedure 27 | cni Create non-unique nonclustered index 28 | cp Create a stored procedure 29 | cseq Create a sequence (start, end, optional: cycle, cache) 30 | csf Create scalar function 31 | ct Create a table 32 | cte Create a new common table expression 33 | ctf Create table-valued function 34 | ctr Commit transaction 35 | ctt Create temp table (drops if exists) 36 | cu Create a database user 37 | cuci Create unique clustered index 38 | cuni Create unique nonclustered index 39 | curff Boilerplate code for fast-forward read-only cursor 40 | cv Create a view 41 | cw CASE WHEN 42 | dd Drop a database 43 | df DELETE FROM fragment 44 | dfn Drop a function 45 | di Drop an index 46 | dl Drop a login 47 | dp Drop a stored procedure 48 | dseq Drop a sequence 49 | dt Drop a table 50 | du Drop a user 51 | dupk Check for duplicated values on a column 52 | dv Drop a view 53 | err Inserts @@ERROR function call 54 | fj FULL JOIN fragment 55 | foj FULL OUTER JOIN fragment 56 | gb GROUP BY 57 | gep Grant Execute on procedures 58 | git Grant Insert on table 59 | giust Grant Insert, Select, Update on table 60 | gst Grant Select on table 61 | gut Grant Update on table 62 | header Template header for stored procedure 63 | hhmm string to HH:mm format 64 | ifs IF fragment 65 | ii INSERT INTO fragment 66 | ij INNER JOIN fragment 67 | j JOIN fragment 68 | inn IS NOT NULL fragment 69 | is Shortcut for INFORMATION_SCHEMA 70 | isc Column Information Grabber 71 | isns Wraps the currently selected column (text) in an ISNULL Function, with a default empty string (this is an inline selected text function) 72 | isnn Wraps the currently selected column (number) in an ISNULL Function, with a default to zero (this is an inline selected text function) 73 | lin Line 74 | linn Double line with space for text comment 75 | lj LEFT JOIN 76 | lk LIKE '% %' fragment 77 | loj LEFT OUTER JOIN fragment 78 | mmddyyyy String to mmddyyyy format 79 | mmddyyyyhhmm String to mmddyyyyhhmm format 80 | mro Retrieves information about 20 most recently created objects from database 81 | neo A word from one of our sponsors 82 | num Format a big number into a readable format 83 | numc Nicely formatted COUNT(*) as numRows 84 | nvseq Next value for a sequence 85 | ob ORDER BY 86 | rj RIGHT JOIN fragment 87 | rnum ROW_NUMBER() OVER () fragment 88 | roj RIGHT OUTER JOIN fragment 89 | rt Rollback transaction 90 | san Change the current ANSI_NULLS setting 91 | scf Count number of records returned by query, formatted nicely 92 | sd SELECT DISTINCT 93 | setvar SQL CMD setvar fragment 94 | smf SELECT SUM() FROM 95 | sph Execute sp_help 96 | spt Execute sp_helptext 97 | sqi Change the current QUOTED_IDENTIFIER setting 98 | ss0 SELECT TOP 0 * FROM 99 | ssf SELECT * FROM fragment 100 | ssf2 SELECT * FROM fragment, formatted nicely with tabs and newline. 101 | sst SELECT TOP 1000 * FROM 102 | st100 SELECT top 100 rows 103 | sxa Change the current XACT_ABORT setting 104 | tc TRY ... CATCH fragment 105 | today CAST(GETDATE() as date) fragment 106 | trim Trim a string: LTRIM(RTRIM($CURSOR$)) 107 | trims Wrap selected text in LTRIM(RTRIM($SELECTEDTEXT$)) 108 | uci Unique Clustered Index 109 | w2 Execute sp_who2 110 | wdc WITH (DATA_COMPRESSION = PAGE) fragment 111 | wt WITH (TABLOCK) fragment 112 | xpfd Retrieve free space on all fixed drives 113 | yell Vent your frustration 114 | --------------------------------------------------------------------------------