Home
Blog
Downloads
References
Microsoft SQL Server snippets
These are some basic operations in Microsoft SQL Server
@@@@rowcount
@dqxtype@dq object types
Add a new colomn to a table
Add a new row in a table
Add a new trigger to a table
Add an user defined message and use it in RAISERROR
Backup a database
bcp example
Call a function with a local variable as the argument
Call a function
Call a procedure with an argument explicitly specified
Collapse a group of records (using GROUP BY clause)
Collapse a group of records and apply a filter (using HAVING clause)
Combine the results of two queries
Create a backup device
Create a function with an argument
Create a function
Create a local variable in a function
Create a new database
Create a new table in a database
Create a procedure
Create a temporary row using SELECT
Create column (field) alias
Create table alias
Cursor example
Data Types
DB_ID ( )
Declare and then initialize a variable
delete an entire database after checking if a specific database exists
Execute a procedure that takes one argument
Find the difference between two tables (application of JOIN)
GETDATE()
How to generate XSD from a SQL Table
Initialize DateTime variable
ISNULL
Logic - DIFFERENCE
Logic - INTERSECTION
Logic - UNION
Manipulate returned data in SELECT expression
Precision and scale
Primary Key table and Foreign Key table
See a list of all rows from a table
sp_databases
sp_help
SQL Equivalents@co strlen and sizeof
Use alias for a table
Use CROSS JOIN to view data from two related tables
Use FULL JOIN to view data from two related tables
Use JOIN to view data from two related tables
Use loop constract
Use sub-query (using IN function)
User LEFT and RIGHT JOIN to view data from two related tables
View all rows ordered by a specific column
View all rows where a specified column is NULL
View all rows with a column matching to one of the items in a list (IN trick)
View all rows with a specific criteria ordered by a specific column
View all rows with a specific criteria
View all rows with specific columns
View sprocs that depend on a given table
View tables that a given table depends on
View tables that depend on a given table
View tables that do not start with character A or B or C
View tables that starts with a character A
View tables that starts with character A or B or C
Copyright © 2008 SpiralSpace All rights reserved.