SELECT * FROM dbo.SavedQueryBase
WHERE Name like '%Quick%'
SELECT * FROM Acme_MSCRM.dbo.SavedQueryBase
WHERE Name like '%Quick%'
ORDER BY Name
ModifiedOn
NOT and wildcard
WHERE supplier_name not like 'T%';
single wild card
WHERE supplier_name like 'Sm_th';
escape character
WHERE supplier_name LIKE '!%' escape '!';
Foo is the table name you want details for. SELECT * FROM INFORMATION_SCHEMA.Columns where TABLE_NAME = 'Foo'
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.Columns
WHERE TABLE_NAME = yourtablename
SELECT count(*) FROM <table_name>
Get total rows of table:
SELECT count(*) FROM <table_name> where <field_name> is null
Get total rows having field value null: