Appearance
Idea 代码段
1. SQL
1.1. cvtdt108
Abbreviation:
cvtdt108Description:
convert datetime to "HH:mm:ss" formatTemplate text:
SQLCONVERT(VARCHAR(8), $dt$, 108)Variables:
Name Expression Default Value Skip if defined dt"GETDATE()"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.2. cvtdt108s
Abbreviation:
cvtdt108sDescription:
convert datetime to "HHmmss" formatTemplate text:
SQLREPLACE(CONVERT(VARCHAR(8), $dt$, 108), ':', '')Variables:
Name Expression Default Value Skip if defined dt"GETDATE()"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.3. cvtdt112
Abbreviation:
cvtdt112Description:
convert datetime to "yyyyMMdd" formatTemplate text:
SQLCONVERT(VARCHAR(8), $dt$, 112)Variables:
Name Expression Default Value Skip if defined dt"GETDATE()"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.4. cvtdt120
Abbreviation:
cvtdt120Description:
convert datetime to "yyyy-MM-dd HH:mm:ss" formatTemplate text:
SQLCONVERT(VARCHAR(19), $dt$, 120)Variables:
Name Expression Default Value Skip if defined dt"GETDATE()"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.5. cvtdt121
Abbreviation:
cvtdt121Description:
convert datetime to "yyyy-MM-dd HH:mm:ss.fff" formatTemplate text:
SQLCONVERT(VARCHAR(23), $dt$, 121)Variables:
Name Expression Default Value Skip if defined dt"GETDATE()"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.6. cvtdt23
Abbreviation:
cvtdt23Description:
convert datetime to "yyyy-MM-dd" formatTemplate text:
SQLCONVERT(VARCHAR(10), $dt$, 23)Variables:
Name Expression Default Value Skip if defined dt"GETDATE()"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.7. droptmptbl
Abbreviation:
droptmptblDescription:
drop temporary tableTemplate text:
SQLIF OBJECT_ID('tempdb.dbo.$tmp$') IS NOT NULL DROP TABLE $tmp$Variables:
Name Expression Default Value Skip if defined tmp"#temp"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.8. errinfo
Abbreviation:
errinfoDescription:
error infoTemplate text:
SQLERROR_MESSAGE() + N' (' + CAST(ERROR_LINE() AS NVARCHAR(20)) + N')'Variables:
noneOptions:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.9. eve
Abbreviation:
eveDescription:
search everywhereTemplate text:
SQLEXEC master.dbo.EverythingProc @srh = N'$DEFAULT_CONDITIONS$', @dbs = N'$dbs$', @orders = N'$orders$', @options = $options$Variables:
Name Expression Default Value Skip if defined DEFAULT_CONDITIONS"!ww:Discarded t:P,FN,IF,TF,V"× dbs"*"× orders"db, sch, obj"× options"0x01"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.10. fmtnum
Abbreviation:
fmtnumDescription:
format numberTemplate text:
SQLFORMAT($num$, '$fmt$')Variables:
Name Expression Default Value Skip if defined num× fmt"#,0.##"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.11. printlongmsg
Abbreviation:
printlongmsgDescription:
EXEC master.dbo.PrintLongMsgProcTemplate text:
SQLEXEC master.dbo.PrintLongMsgProc @msg = $msg$Variables:
noneOptions:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.12. printscript
Abbreviation:
printscriptDescription:
EXEC master.dbo.PrintObjectScriptProcTemplate text:
SQLEXEC master.dbo.PrintObjectScriptProc @dbname = N'$db$', @name = N'$obj$', @isAllowTR = $tr$Variables:
Name Expression Default Value Skip if defined db× obj× tr"0"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.13. printscripts
Abbreviation:
printscriptsDescription:
EXEC master.dbo.PrintMultiObjectScriptProcTemplate text:
SQLDECLARE $targets$ NVARCHAR(MAX) SET $targets$ = N' $cursor$' SET $targets$ = REPLACE(REPLACE($targets$, N' ', N'..'), N' ', N',') EXEC master.dbo.PrintMultiObjectScriptProc @targets = $targets$, @isAllowTR = $tr$Variables:
Name Expression Default Value Skip if defined targets"@targets"× cursor× tr"0"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.14. rounddt
Abbreviation:
rounddtDescription:
round datetimeTemplate text:
SQLDATEADD($round$, DATEDIFF($round$, 0, $dt$)$END$, 0)Variables:
Name Expression Default Value Skip if defined round"MONTH"× dt"GETDATE()"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.15. varmonthfir
Abbreviation:
varmonthfirDescription:
declare this month first day variableTemplate text:
SQLDECLARE $monthFir$ DATE = DATEADD(MONTH, DATEDIFF(MONTH, 0, $now$), 0)Variables:
Name Expression Default Value Skip if defined monthFir"@monthFir"× now"GETDATE()"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.16. varnow
Abbreviation:
varnowDescription:
declare now variableTemplate text:
SQLDECLARE $now$ DATETIME = GETDATE()Variables:
Name Expression Default Value Skip if defined now"@now"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.17. varsysmgr
Abbreviation:
varsysmgrDescription:
declare system manager variablesTemplate text:
SQLDECLARE $id$ INT = 26467, $name$ NVARCHAR(100) = N'管理员'Variables:
Name Expression Default Value Skip if defined id"@id"× name"@name"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with:
1.18. vartoday
Abbreviation:
vartodayDescription:
declare today variableTemplate text:
SQLDECLARE $today$ DATETIME = DATEADD(DAY, DATEDIFF(DAY, 0, $now$), 0)Variables:
Name Expression Default Value Skip if defined today"@today"× now"GETDATE()"× Options:
- Expand with:
Default - √ Reformat according to style
- × Shorten FQ names
- Expand with: