Posts

Inbuilt functions

 Cast ToString() GetRoot() GetDescendant() IsDescendantOf() GetLeveI() GetAncestor() GetReparentedValue() RANK() DENSE_RANK() ROUND() Rownumber CTE Temperory Table patindex() Textptr() Textvalid()

Important queries

 To check database locks To execute stored procedure  To view stored procedure  To execute insert command with ids To execute query without locking 

String Functions

 SUBSTRING() LEFT() LEN() MID() LCASE() UCASE() Ascii() Char() Charindex() Difference() Left() Len() Lower() Ltrim() Nchar() Patindex() Quotename() Replace() Replicate() Reverse() Right() Rtrim() Soundex() Space() Str() String_Split() Stuff() Substring() Unicode() Upper() Trimo ConcatWs()

Constraints

 Primary key  Foreign key Not Null Default  Check  Unique  Index

How to take scripts of Schema or Data

JOINS

 JOIN/INNER JOIN OUTER JOIN LEFT JOIN RIGHT JOIN FULL JOIN CROSS JOIN

Clauses

 SELECT WHERE GROUP BY HAVING DISTINCT GROUPING SETS ORDER BY Clause ORDER BY ASC/DESC AND OR  AS  WITH IN BETWEEN  ANY LIKE