more snippets
This commit is contained in:
parent
ee90854917
commit
cf0c81a25f
1 changed files with 15 additions and 1 deletions
|
|
@ -22,6 +22,16 @@ snippet dateadd
|
||||||
# DATEFROMPARTS
|
# DATEFROMPARTS
|
||||||
snippet datefromparts
|
snippet datefromparts
|
||||||
DATEFROMPARTS(${1:year}, ${2:month}, ${3:day})
|
DATEFROMPARTS(${1:year}, ${2:month}, ${3:day})
|
||||||
|
# OBJECT_DEFINITION
|
||||||
|
snippet objectdef
|
||||||
|
SELECT OBJECT_DEFINITION(OBJECT_ID('${1:sys.server_permissions /*object name*/}'))
|
||||||
|
# STUFF XML
|
||||||
|
snippet stuffxml
|
||||||
|
STUFF((SELECT ', ' + ${1:ColumnName}
|
||||||
|
FROM ${2:TableName}
|
||||||
|
WHERE ${3:WhereClause}
|
||||||
|
FOR XML PATH('')), 1, 1, '') AS ${4:Alias}
|
||||||
|
${5:/*https://msdn.microsoft.com/en-us/library/ms188043.aspx*/}
|
||||||
# Create Procedure
|
# Create Procedure
|
||||||
snippet createproc
|
snippet createproc
|
||||||
-- =============================================
|
-- =============================================
|
||||||
|
|
@ -30,12 +40,14 @@ snippet createproc
|
||||||
-- Description: ${3:Description}
|
-- Description: ${3:Description}
|
||||||
-- =============================================
|
-- =============================================
|
||||||
CREATE PROCEDURE ${4:Procedure_Name}
|
CREATE PROCEDURE ${4:Procedure_Name}
|
||||||
-- Add the parameters for the stored procedure here
|
${5:/*Add the parameters for the stored procedure here*/}
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
-- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements.
|
-- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements.
|
||||||
SET NOCOUNT ON;
|
SET NOCOUNT ON;
|
||||||
|
|
||||||
|
${6:/*Add the T-SQL statements to compute the return value here*/}
|
||||||
|
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
# Create Scalar Function
|
# Create Scalar Function
|
||||||
|
|
@ -52,5 +64,7 @@ snippet createfn
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE @Result ${5:Function_Data_Type}
|
DECLARE @Result ${5:Function_Data_Type}
|
||||||
|
|
||||||
|
${6:/*Add the T-SQL statements to compute the return value here*/}
|
||||||
|
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
Loading…
Add table
Add a link
Reference in a new issue