Focusing on setup and development using SQL Server products from 2000 to 2008 and beyond. Also about anything geeky that compels me to write a blog entry.

Saturday, September 21, 2013

Visual Studio, SQL Management Studio, and SQL Express on a Windows 8 Tablet

I recently bought a Dell Latitude 10 Essentials tablet with Windows 8, my first experience with any personal Windows 8 device.  Of course one of the first things I wanted to do was install my development tools on this 64GB tablet, but I was skeptical if it had the memory and the juice to handle the Studios and database engine service.

Side note, my tablet started with around 32GB of space free after pre-installed programs.

So I installed Visual Studio 2012, SSMS 2012, and SQL Express 2012 DB engine, and have 12 GB to spare.  Not a lot but it fits.  Now all I need is to add a 64GB or 128GB SD card to the open slot, and I will have plenty of space for database and code hosting.

So if you are considering this type of setup on a Windows 8 tablet, my one piece of advice is do not settle for 32GB of internal memory because you will be disappointed.  I would say 64GB plus SD expansion room is a minimum, and if you can get 128GB internal or better yet 256GB+ in SSD internal, the more the better.

I will post updates if anything changes after a few weeks of use.  If anyone reading this has some experience with this type of setup, please post in comments.

Saturday, September 14, 2013

Using IIF instead of CASE

For years the primary means of expressing conditional logic in SQL Server has been the CASE statement, which allows for powerful set-based logic and I personally love.  However, sometimes you just have a quick two-way decision that you need to make in your data set or just with variables, and CASE syntax feels a bit overkill.  Especially if you also code in a programming language that gives you the IIF function.

Thank you SQL Server 2012.  The IIF has arrived.

Now you can (and I already have, extensively) deal with situations where if the Boolean answer to a formula is true, do this, else do that using IIF.  Here is a quick, simple example.

Declare @Value1 Int = 1,

@Value2 Int = 2

Print '@Value1=' + Convert(varchar(1),@Value1)

Print '@Value2=' + Convert(varchar(1),@Value2)

Print IIF(@Value1 = @Value2,'They Equal','They Do Not Equal')

Set @Value2 = 1

Print '@Value1=' + Convert(varchar(1),@Value1)

Print '@Value2=' + Convert(varchar(1),@Value2)

Print IIF(@Value1 = @Value2,'They Equal','They Do Not Equal')

This is not revolutionary, but it does make for a nice shortcut in true/false scenarios, and it is another step toward shared syntax with external programs.  A small but good addition to SQL 2012.

Until next time, may well defined requirements be at your back and realistic timelines lie before you.