Red Gate SQL Source Control

SQL Server, T-SQL, Tools
You just have to love Red Gate tools. They find the small area that they want to cover and then they cover it extremely well. I rave regularly about SQL Prompt and SQL Compare and SQL Search (free one, btw). I've got SQL Data Compare and SQL Data Generator open & working on my desk regularly. I'm dabbling in their other tools fairly often as well. I just like Red Gate tools. I guess my constant & consistent praise is why I'm a "Friend of Red Gate." I like to mention that before I start praising their tools some more, just so no one thinks I'm hiding it. Why would I hide it? I'm proud to say it. I am a Friend of Red Gate! ... anyway... where was I... right, new software.…
Read More

Delivering the Bad News

Misc
It's a Friday, the day governments & companies traditionally deliver bad news. I recived the bad news earlier in the week, but I'm passing it on now: The Standard is dead. Let me first say, a couple of authors are right in the middle of finishing up articles. Those will be completed and published and you'll get paid. Andy sums up some of the reasons why the Standard failed very nicely in his blog post. I agree with them, if not where the responsibility lies. Andy takes most of it on himself because, well, he's that kind of guy, may the gods bless him. But, the fact is, I took on the job and just wasn't prepared for what it would entail. The "editing" part of the job was hard.…
Read More

Small PowerShell Script

PowerShell
I'm still trying to learn PowerShell better. The opportunity to answer simple questions and problems with the tool is hard to pass up. We had a need to clean up data directories where data files were left behind or people put inappropiate files, so I wrote the following Powershell script: [sourcecode language="powershell"]param([string]$filelocation="",[string]$sqlinstance="(local)") Set-Location $filelocation foreach($file in get-childitem) {$base = $file.Name; $result = Invoke-Sqlcmd -ServerInstance $sqlinstance -Query "SELECT DB_NAME(mf.database_id) AS db FROM sys.master_files mf WHERE RIGHT(mf.physical_name,LEN('$Base')) = '$Base' UNION ALL SELECT 'NoDb' AS db WHERE NOT EXISTS (SELECT DB_NAME(mf.database_id) AS db FROM sys.master_files mf WHERE RIGHT(mf.physical_name,LEN('$Base')) = '$Base');" ; if($result.DB -eq "NoDb" -and $file.Extension -ne ".cer"){Remove-Item $base}} It's a very simple script. It takes a UNC and a server instance and then walks through the files in the UNC and validates…
Read More

One of these things is not like the other

PowerShell
I'm working with PowerShell, and digging it. I decided that I wanted to create a new script (blog post later, if I get it to work) and I wanted to try out different scripting tools to build it. I started with PrimalScript from Sapien. It's slick. It's powerful. It has very nice code completion, a great GUI, integration with source control out of the box. I started scripting and everything was fine. Then, I needed to run invoke-Sqlcmd so I decided to change the profile on the shell so it would load the SQL Server cmdlets automagically. I started getting the error: Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps' because it does not exist Hmmm... weird. I'm pretty sure I used the same command on my workstation as on my laptop.…
Read More

Powershell Fundamentals

PowerShell
I've had the opportunity this week to take class with Don Jones (blog | twitter), PowerShell guru and author of PowerShell 2.0 TFM (makes me laugh, each and every time). I'm not even going to attempt to try to teach you some of the amazing information Don has spent the last week pouring into my ears (since most of  it spilled on the floor). But, I do want to pass on some high points, gotchas, tips, insights, that Don communicated to us during the class because they might help you pick up on the fundamentals of PowerShell. That's the most important lesson I got out of this week, you need the fundamentals to really start to put PowerShell to work. It's very easy to make the mistake that I did. I…
Read More

PASS Board Nominations

PASS
If you haven't heard, please allow me to let you in on a little secret. The Professional Association of SQL Server users (PASS) is holding open nominations for the board. If you are interested in running for the board or know someone who should run for the board, get to this location as soon as possible and get their name in. I feel that PASS does a lot for individual database users all over the world. I know people who take the contrary position and say that PASS doesn't do anything for them. If you're of that opinion, that's great. As a matter of fact, if you're of that opinion, I'd suggest you should run for the board. Now is your chance to make a difference. Now is the time…
Read More

Learning Powershell

PowerShell
I've been attending a Powershell fundamentals class with Don Jones (blog|twitter). If you read my blog you might be aware of the fact that I've posted a few PowerShell scripts in the past.  So why was I attending a fundamentals class? Because I didn't know what I was doing. I knew going into the class that I needed a better grounding in the fundamentals of Posh, but after the first day of Don's excellent class, I realized that I had been working with PowerShell and didn't have a clue how it really worked. Don's class is excellent and I could spend a lot of time talking about just that (which I'm sure would make Don happy). However I want to concentrate on something that he said during class that really…
Read More

Sarasota SQL Server Users Group

Uncategorized
Tonight I'm presenting for the Sarasota SQL Server Users Group. If you're interested in attending, you can join in using this link. The topic will be "Query Performance Tuning 101." And in case you can't make that, Thursday, June 17th, I'll be on Quest's Pain of the Week. It should be fun too.
Read More

Virtualizing Servers in Production

Uncategorized
The company where I work has been using virtualization in development, QA, testing, etc., for many years now. We have not even attempted virtualization in production. Things change. But, before we did it, I thought I'd bounce the question out to the people who know, What are some things to watch for in using virtual servers in a production environment. Introduction Flat out, I asked people over Twitter. The overall message was extremely positive. No one suggested it was a bad idea. A few thought that some high volume servers are better served by physical boxes. Volume in this case could be read as high amounts of reads or high amount of writes, both were suggested as reasons to avoid virtualization. The cause for this is clear, from each individual; the…
Read More

Maps in Reports!

Spatial Data
I've been playing with SQL Server 2008 R2 for quite a while in the CTP's and what not. But, I hadn't made a concerted effort to look at the new version of Reporting Services... HUGE mistake. There are a number of, not insubstantial, updates to Reporting Services that, probably, are the primary selling points of 2008 R2. The big one, for me, was the incorporation of mapping directly into reports. Did I say big? I'm sorry, I meant, enormous, gigantic, galactic, really, really important... Why you ask? I work for an insurance company. We insure factories, warehouses, that sort of thing. Funny bit of information about a factory, when floods, high wind or earthquakes come calling, they just don't seem to be able to get out of the way adequately. Weird, huh?…
Read More