24 July 2008

Find a column in SQL Server 2005

SELECT tbl.[name]
FROM sys.columns col, sys.tables tbl
WHERE col.object_id = tbl.object_id
AND col.name = '[column name]'

03 June 2008

Removing the Date from SQL DateTime

This solution is short and efficient:

CONVERT(VARCHAR(10), GETDATE(), 101)