May 2011 Entries

How Do I Change a Database Instance Name in SQL Server?
Ten minutes ago I created a scratch db instance with a name I mistyped. Not good! Fortunately, I have admin privileges so I can change it in my lab environment. If you're an admin AND no other users are accessing the DB instance, here's what you can do: USE master go EXEC sp_renamedb 'MetroWrongName', 'MetroRightName' GO If someone is using the instance, there is a workaround. Do this: USE master go -- flag the instance for single user only EXEC sp_dboption 'MetroWrongName','Single User', True GO ......

Posted On Friday, May 27, 2011 4:38 PM | Comments (1)

How do I Disable FireFox's Browser Cache COMPLETELY?
The worst part about web application development is the phase in the unit testing where we developers swear we've fixed something, but still when we test the change, the fix isn't there. After awhile, we remember to clear the browser cache and we discover the fix worked! In some cases, we really haven't fixed what we thought we fixed--and in other cases, we haven't really cleared the cache. I was working in FireFox recently and realized I hadn't really cleared the cache when I added a new button ......

Posted On Thursday, May 19, 2011 1:43 PM | Comments (3)

How do I read the SQL for a View in T-SQL?
The easiest way in MS SQL 2005 and up is to use the SQL Management Studio, go to Views, highlight the name of the view you are interested in, right click, select Script View as/Create to/Clipboard. open up notepad or your prefered editor and paste the contents of your clipboard. The SQL used to create the view should show up in your editor. If this doesn't work, or if you are working with older versions of SQL Server, look at the system objects as follows: use [YouDatabseInstanceName] go select * ......

Posted On Wednesday, May 4, 2011 12:41 PM | Comments (1)