Posts

Showing posts from April, 2016

Collection of frequently used SQL

I have gathered some SQL queries and commands frequently used by developers (like me ☺) to reduce the googling time. For quick reference query titles are enlisted below with links: Commonly Used Queries Get all columns with specific name Get all connected tables Get all foreign key reference of a specific table Get all foreign key references of a specific column of a table Search across all tables for specific value Some Useful Syntax Get data with pagination Rotate data (PIVOT and UNPIVOT) Using common table expression (CTE) Ranking Data Get values from XML column Some Useful Commands Get database server information Get all database names Commonly Used Queries Get all columns with specific name This query could be useful when we've got a column name, but don't know which table it belongs to. -- Find All Columns From All Tables With Similar Name SEL...