My Work
My Blogs
Hotlinks
Tag Archives: tsql
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
Today I took 30 minutes to save hours
UPDATE – 1/6/2011 : Since writing this post I have bundled this entire reset process into a single windows batch file. In addition to restoring my database, I also have to remove temp files from my server, so it was … Continue reading
Posted in database, development, SQL, tips and tricks
Tagged automation, backup, bat, batch, batch file, cli, cmd, command line, cursor, DECLARE, del, exec, fetch, fetch_status, information_schema, kill, restore, sproc, SQL, sqlcmd, sys, tsql, workflow
Leave a 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
