Tuesday, May 15, 2007

How To find information in SQL Server database

1. Enumerate all columns in tables with table name like BAND

SELECT CL.* FROM INFORMATION_SCHEMA.TABLES CL WHERE TABLE_NAME LIKE '%BAND%'

2. Enumerate all columns in all tables with column name like MYCOLNAME

SELECT CL.* FROM INFORMATION_SCHEMA.COLUMNS CL WHERE column_name
LIKE '%MYCOLNAME%' ORDER BY table_name

3. Enumerate all columns in all tables with column name like MYCOLNAME, show table name as well

SELECT CL.TABLE_NAME, CL.COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS CL
INNER JOIN INFORMATION_SCHEMA.TABLES TB
ON TB.TABLE_NAME = CL.TABLE_NAME
WHERE CL.COLUMN_NAME LIKE '%MYCOLNAME%'
AND TB.TABLE_TYPE = 'BASE TABLE'
ORDER BY CL.TABLE_NAME

4. Find duplicate rows in a table in SQL Server

SELECT COL1, COL2, COUNT(*)
FROM T1
GROUP BY COL1, COL2
HAVING COUNT(*) > 1

5. Enumerate processes

USE master
SELECT * FROM sysprocesses

Video pedia

There is no video encyclopedia on Internet.

Something close to idea of video encyclopedia is How To Do sites and one of the examples of such site is http://www.5min.com/

Youtube has no relation to organized video storage. The main idea is freedom, nothing else, only ultimate freedom.

Why is more difficult to organized video than other type of information?