String Functions Create a Stored Procedure CREATE ...
String Functions
Exact Numerics
Date Functions
Create a Stored Procedure
DATEADD (datepart, number, date)
CREATE PROCEDURE name
bit
decimal
DATEDIFF (datepart, start, end)
tinyint
money
DATENAME (datepart, date)
smallint
numeric
DATEPART (datepart, date)
bigint
@variable AS datatype = value
AS
-- Comments
SELECT * FROM table
DAY (date)
Approximate Numerics
real
float
GETDATE()
Date and Time
MONTH (date)
smalldatetime
timestamp
GO
GETUTCDATE()
Create a Trigger
YEAR (date)
datetime
CREATE TRIGGER name
Strings
ON
Dateparts
text
char
varchar
Unicode Strings
ntext
nchar
nvarchar
Binary Strings
image
binary
varbinary
Miscellaneous
table
Year
yy, yyyy
Quarter
qq, q
Month
mm, m
Day of Year
dy, y
Day
dd, d
Week
wk, ww
Hour
hh
Minute
mi, n
cursor
table
Second
ss, s
sql_variant
xml
Millisecond
ms
FOR
DELETE, INSERT, UPDATE
AS
-- Comments
SELECT * FROM table
GO
Create a View
CREATE VIEW name
AS
Type Conversion
CAST (expression AS datatype)
ABS
LOG10
CONVERT (datatype, expression)
ACOS
PI
ASIN
POWER
ATAN
RADIANS
ATN2
RAND
CEILING
ROUND
COS
SIGN
COT
SIN
DEGREES
SQUARE
Ranking Functions
RANK
NTILE
DENSE_RANK
ROW_NUMBER
Grouping (Aggregate) Functions
MAX
AVG
-- Comments
Mathematical Functions
BINARY_CHECKSUM MIN
SUM
CHECKSUM
EXP
SQRT
FLOOR
TAN
LOG
CREATE UNIQUE INDEX name
ON
table (columns)
Create a Function
CREATE FUNCTION name
(@variable datatype(length))
datatype(length)
STDEV
COUNT
STDEVP
COUNT_BIG
VAR
ASCII
REPLICATE
GROUPING
VARP
CHAR
REVERSE
CHARINDEX
RIGHT
DIFFERENCE
RTRIM
LEFT
SOUNDEX
String Functions
AS
ALTER
DROP
LEN
SPACE
CREATE
TRUNCATE
LOWER
STR
LTRIM
STUFF
NCHAR
SUBSTRING
Available free from
PATINDEX
UNICODE
REPLACE
UPPER
QUOTENAME
Create an Index
RETURNS
CHECKSUM_AVG
Table Functions
SELECT * FROM table
GO
BEGIN
DECLARE @return datatype(length)
SELECT @return = CASE @variable
WHEN 'a' THEN 'return a'
WHEN 'b' THEN 'return b'
ELSE 'return c'
RETURN @return
END
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- t sql data types
- scope easy and efficient parallel processing of
- primitive data types
- oracle to bigquery sql translation reference
- how to convert sql from the microsoft sql server database
- string functions create a stored procedure create
- data ypes t home springer
- destring — convert string variables to numeric
- fixing problems with numeric text fields using the field
Related searches
- create a string in matlab
- how to create a string in matlab
- ms access string functions vba
- c string functions examples
- string functions in access 2016
- java string functions examples
- string functions in java
- javascript string functions w3
- string functions excel
- string functions in tableau
- string functions tableau
- string functions in python