Date Functions Create a Stored Procedure CREATE PROCEDURE ...
[Pages:1]Data Types
Exact Numerics
bit
decimal
tinyint
money
smallint
bit
int
numeric
bigint
int
Approximate Numerics
float
real
Date and Time
smalldatetime
timestamp
datetime
Strings
char
text
varchar
Unicode Strings
nchav
ntext
nvarchar
Binary Strings
binary
image
varbinary
Miscellaneous
cursor
table
sql_variant
xml
Type Conversion
CAST (expression AS datatype) CONVERT (datatype, expression)
Ranking Functions
RANK DENSE_RANK
NTILE ROW_NUMBER
Grouping (Aggregate) Functions
AVG
MAX
BINARY_CHECKSUM MIN
CHECKSUM
SUM
CHECKSUM_AVG STDEV
COUNT
STDEVP
COUNT_BIG
VAR
GROUPING
VARP
Table Functions
ALTER CREATE
DROP TRUNCATE
Date Functions
DATEADD (datepart, number, date) DATEDIFF (datepart, start, end) DATENAME (datepart, date) DATEPART (datepart, date) DAY (date) GETDATE () GETUTCDATE () MONTH (date) YEAR (date)
Dateparts
Year Quarter Month Day of Year Day Week Hour Minute Second Millisecond
yy, yyyy qq, q mm, m dy, y dd, d wk, ww hh mi, n ss, s ms
Mathematical Functions
ABS ACOS ASIN ATAN ATN2 CEILING COS COT DEGREES EXP FLOOR LOG
LOG10 PI POWER RADIANS RAND ROUND SIGN SIN SQUARE SQRT TAN
String Functions
ASCII CHAR CHARINDEX DIFFERENCE LEFT LEN LOWER LTRIM NCHAR PATINDEX REPLACE QUOTENAME
REPLICATE REVERSE RIGHT RTRIM SOUNDEX SPACE STR STUFF SUBSTRING UNICODE UPPER
Create a Stored Procedure
CREATE PROCEDURE name @variable AS datatype = value
AS -- Comments SELECT * FROM table
GO
Create a Trigger
CREATE TRIGGER name ON
table FOR
DELETE, INSERT, UPDATE AS
-- Comments SELECT * FROM table GO
Create a View
CREATE VIEW name AS
-- Comments SELECT * FROM table GO
Create an Index
CREATE UNIQUE INDEX name ON
table (columns)
Create a Function
CREATE FUNCTION name (@variable datatype(length))
RETURNS datatype(length)
AS 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
Available free from
................
................
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
- how to calculate days between dates in power bi
- power query m function reference microsoft docs
- declare set date sql
- how to correct american dates in office365
- date functions create a stored procedure create procedure
- date in where clause in sql server
- python cheat sheet programming with mosh
- optimizingdax enterprise dna
- how to calculate days in power bi
Related searches
- functions of a crm system
- functions of a treasury department
- treasury functions in a company
- finance functions in a company
- functions of a manager pdf
- create a date in tableau
- date functions tableau
- javascript date functions examples
- dax date functions examples
- teradata date functions list
- create a link in a text file
- date functions in excel