My Work
My Blogs
Hotlinks
Tag Archives: SQLSERVER
Use INFORMATION_SCHEMA to find data about your database
Have you ever been in this situation? You’re the new developer for a database powered application and you have to figure out what tables contain a specific column? Or maybe you’ve got a legacy database that needs it’s stored procedures … Continue reading
Posted in database, development, internets, SQL
Tagged automation, data discovery, db2, information_schema, mysql, oracle, rdmbs, schemata, sql server, sql-92, SQLSERVER, system tables, system views, tsql
1 Comment
Selecting random ids using TOP and a CTE
While testing visualizations in a Flex application, I needed to do some underlying data cleanup in SQL Server. One of my tasks was to manually update an entity table and set the status column to one of three possibilities. Status … Continue reading
Posted in database, SQL, tips and tricks, tsql
Tagged common table expression, cte, mssqlserver, SQL, sql server, SQLSERVER, top, tsql
Leave a comment
What if you want to PIVOT against a text column?
If you’ve ever worked with or researched SQL Server’s PIVOT function, you probably noticed most of the samples pivot against an id column. Typically an int column like EmployeeID, or StoreID. That’s fine and dandy, but what happens when you … Continue reading
Posted in database, microsoft, SQL, tips and tricks, tsql
Tagged coalesce, dynamic sql, exec, pivot, quotename, SQLSERVER, table variable, tsql
2 Comments
Incorrect syntax near the keyword ‘table’ in TSQL
Ran into something little that I know I’m going to forget if I don’t write down. It appears that when using a TABLE variable in tsql ( SQL Server 2005 ), you must DECLARE that variable on it’s own line, … Continue reading
Posted in database, microsoft, SQL, tsql
Tagged #table, DECLARE, SQLSERVER, SQLSERVER 2005, table variable, tsql
4 Comments
