-
Recent Posts
Recent Comments
Bob L on Moving Databases from One Inst… Bob L on History may not repeat, b… Michael Abrams on History may not repeat, b… Mark Polczynski on Moving Databases from One Inst… emilie parker on Now at 5.11 GB/s SQL backup to… Archives
- August 2016
- June 2016
- October 2015
- September 2015
- August 2015
- July 2015
- February 2015
- December 2014
- July 2014
- May 2014
- March 2014
- February 2014
- November 2013
- September 2013
- August 2013
- July 2013
- March 2013
- October 2012
- April 2012
- March 2012
- February 2012
- October 2011
- September 2011
- November 2010
- July 2010
- June 2010
- May 2010
- November 2009
- October 2009
- August 2009
- July 2009
- June 2009
- May 2009
- January 2009
- June 2008
Categories
- 2FA
- Artificial Intelligence
- Azure
- Cloud
- data security
- Fusion-io
- Hyper-v
- Machine learning
- Mulifactor Authentication
- Problem Solving
- Security
- SQL Server
- SQL Tips and Techniques
- Stock Market
- Technical Analysis
- Uncategorized
- Virtualization
- Windows Server
- Windows Server 2008 R2
- Windows Server 2012
- Windows Server 2012 R2
Meta
Author Archives: Bob L
Using INSTEAD OF Triggers to enable updatable views
A common misconception with SQL Server views is that only indexed views can provide update capability. Actually, any view that is schema-bound can be enabled for update by simply using an “INSTEAD OF” trigger. Although an indexed view may also … Continue reading
Posted in Uncategorized
Leave a comment
Solving Sudoku with T-SQL
Note: This is an update to the earlier post to include the query to actually display the solved puzzle (for the skeptics… ) Recently I had to make a short trip and took a look at a Sudoku puzzle in … Continue reading
Creating a 3-way 10 Gbe Cluster without a switch– Part 1
After finishing the PhD, I’m back into the lab to test out some new high-speed computing experiments. Recently, I retrieved one of my servers from co-location and put it back into my home-office lab giving me 3 servers with Fusion-IO … Continue reading
Posted in Uncategorized
Leave a comment
Generating a Type-2 Dimension from Multiple Tables with Effective Dates
In slowly changing (SCD) dimensions, type-2 attributes involves ending a dimension row when the attribute value changes with the current date and creating a new row starting from the current date. While this works great to capture history once a … Continue reading
Posted in Uncategorized
Leave a comment
Dealing with a corrupt transaction log in SQL Server
I just went through the experience of a corrupted transaction log for a large SQL Server database. It was actually not as bad as I thought it would be. I ended up restoring from a backup and then putting the … Continue reading
Posted in Uncategorized
Leave a comment
Normalizing time-series data using a table function in SQL
Recently I had to normalize quarterly, monthly, and ad-hoc reported metrics into daily rows in order to do correlative analysis. Below is the function that I came up with. The idea is to generate values that are in line with … Continue reading
Converting Hyper-V machines from Windows 2008 R2 to Windows 2012 R2
I am posting this because it wasn’t obvious just from searching the knowledge base. I was recently converting some VMs running under Windows 2008 R2 to Windows 2012 R2 and dismayed to find out that I could not import the … Continue reading
Moving Databases from One Instance to Another Painlessly (Attach Statement Generator)
If you’ve ever had a bunch of databases and need to just move them to another instance without having to manually do the attach, these two scripts may be helpful. I recently was faced with this situation and have learned … Continue reading
Script to auto-add surrogate primary keys
Here’s an example of how to use information_schema tables to automatically add clustered primary surrogate keys select ‘alter table ‘ + table_name + ‘ add ‘ + table_name + ‘_Id int identity;’ from INFORMATION_SCHEMA.tables t where not exists (select 0from … Continue reading
Auto-discovery of data relationships minus referential integrity
My experience is that unfortunately far too many databases lack referential integrity in the schema. There are a few reasons for this, almost all of them bad. One of the worse is the “our application controls integrity” rationale with a … Continue reading