john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

MS SQL Examples continued tab delimited

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:


  • « Vmware esxi ovf export import ovftool errors read only compressed vmdk vhd kensho
  • persistence jpa »

Published

Apr 3, 2012

Category

sql

~85 words

Tags

  • examples 4
  • ms sql 2
  • sql 18
  • tab delimited 1