Posts

Showing posts from 2015

Microsoft SQL Server Version List

Image
For the bazillionth time, I had to correlate a SQL Server version number (that is, 9.00, 11.0.2000.8, etc.) to what we humans usually use (SQL Server 2005, SQL Server 2012, etc.). I printed this out and taped it to my desk. Here it is for your use: RTM  (no  SP ) SP1 SP2 SP3 SP4   SQL Server 2016      codename ? CTP3.1   SQL Server 2014      codename  Hekaton   SQL14 12.0.2000.8 12.0.4100.1 or 12.1.4100.1   SQL Server 2012      codename Denali 11.0.2100.60 11.0.3000.0 or 11.1.3000.0 11.0.5058.0 or 11.2.5058.0 11.0.6020.0 or 11.3.6020.0   SQL Server 2008 R2      codename Kilimanjaro 10.50.1600.1 10.50.2500.0 or 10.51.2500.0 10.50.4000.0 or 10.52.4000.0 10.50.6000.34 or 10.53.6000.34   SQL Server 2008      codename Katmai 10.0.1600.22 10.0.2531.0 or 10.1.2531.0 10.0.4000.0 or 10.2.4000.0 10.0.5500.0 or 10.3.5500.0 10.0.6000.29 or 10.4.6000.29   SQL Server 2005      codename Yukon 9.0.1399.06 9.0.2047 9.0.3042 9.0.4035 9.0.5000   SQL Server 2000      codename

Start and Stop SQL Server Reporting Services from Windows Command Line or File

Image
After learning how to start and stop Microsoft SQL Server from the command line (and thus from a command file), I decided it was time to do the same for other SQL Server services. SQL Server Reporting Services was the next. StartSSRS.cmd NET START ReportServer$SQLEXPRESS SET /p DUMMY=Hit ENTER to continue... This will start the service and, to ensure you have the opportunity to catch any messages it might throw back, wait for you to hit the ENTER key before closing the command window. StopSSRS.cmd NET STOP ReportServer$SQLEXPRESS SET /p DUMMY=Hit ENTER to continue... This stops the service and then waits for you to hit the ENTER key. Note that both command files are set up for the instance called SQLEXPRESS. Depending on what you're running and what you named it, your instance may be called something else. You can always see what the instance is named by opening the Services application, clicking on the service, and noting the Service Name: So, if like me you&

Create a Data Stream for Free at SparkFun.com

Image
I was browsing the SparkFun website and, curious about the tab " Data ", clicked on through. What I found was a free service where you can upload data from any of your projects and share it with the world. Choice bits from their data page include: Why are you building this? We want to bring a dose of reality to the Internet of Things hype. data.sparkfun.com  is a free, robust service for use with all of your projects.  What types of projects would benefit from this service? Almost anything. Your weather station in the backyard. A classroom of kids working on science experiments. A community concerned with pollution and crowdsourcing data collection. The weight of your pug's food dish. You get the idea. If your project can send an http request, you can push data out to our servers. Can I publish a stream anonymously? Yes. But all streams are public and can be accessed by anyone with the url. Be sure to explore various streams ( https://data.sparkfun.com/s

Handy Tool to Pretty-Print Your SQL Queries

I'm having to wade through some pretty long SQL statements in SSRS -- one of them clocks in at over 2200 lines. The developer who created these wasn't big on consistent formatting so visually following subqueries, complex CASE statements, etc. is a real bear. A few minutes of Googling uncovered a tool by Gudu Software called SQL Pretty Printer: http://www.dpriver.com/products/sqlpp/ssms_index.php I'm giving the trial version of the SSMS plugin a chance and so far it's proved a time- and sanity-saver. A license will run you $50. So far it's saved me enough time that buying the license is a no-brainer. There's a free online version into which you copy-and-paste your query, hit the button, and it returns a pretty-printed version which you can then copy-and-paste into your SSMS query window (or SSRS report).

Start and Stop SQL Server from Windows Command Line or File

Seeing as how I was given a regular workstation rather than a developer's workstation at my new job, RAM is at a premium. It's amazing what you can still accomplish with 4 GB but you have to be judicious in its use. Towards that end, I'm running the local instance of SQL Server on an as-needed basis. Rather than opening Services from the Windows Start menu's "Administrative Tools" item, I created two cmd files (and, yes, I should've used PowerShell): one to start the database engine instance and a second to stop the database engine instance. StartSql.cmd NET START MSSQL$SQLEXPRESS2008R2 SET /p DUMMY=Hit ENTER to continue... StopSql.cmd NET STOP MSSQL$SQLEXPRESS2008R2 SET /p DUMMY=Hit ENTER to continue... Once I had the cmd files done, I went into Services and updated the SQL Server service for that instance so that it was manually started rather than automatically started. Finally, I placed a shortcut for each cmd file on my desktop. Now, wh

Installing the Northwinds Database with SQL Server 2012

Image
As mentioned earlier , my new gig requires a lot more day-to-day work with SQL Server, including SSIS, SSRS, and SSDS. Since most tutorials use either the AdventureWorks  database or the Northwinds database, you ought to have both in place if you want to get hands-on with the tutorials and sample out there. In the last post, we downloaded and attached the AdventureWorks database to our SQL Server 2012 installation . In this post, we'll grab the Northwinds database and attach it to the same server. Follow the steps below to obtain and install the Northwinds database. Open a web browser and go to  http://www.microsoft.com/en-us/download/details.aspx?id=23654 : Click the "Download" button and save the file  SQL2000SampleDb.zip . Click on the file to run it. You'll be asked if you really want to run the installation: Click the "Run" button. Step through the prompts: You'll find that the installation has created a new folder,  SQL Ser

Installing the AdventureWorks Database with SQL Server 2012

Image
My newest gig requires more day-to-day work with Microsoft SQL Server. In fact, I was told there'd be more SQL than C# involved in this job. I do pretty well with SQL but I figure it wouldn't hurt to reinforce the basics and learn some new tricks. Plus, I want to play in-depth with SQL Server Integration Services ( SSIS ), SQL Server Reporting Services ( SSRS ), and SQL Server Data Services ( SSDS ). Nearly every tutorial out there uses the Northwinds database or the AdventureWorks database. AdventureWorks is pretty easy to install, so it's a good warm up exercise before we get into dealing with Northwinds. Follow the steps below to obtain and install the AdventureWorks database. Open a web browser and go to  http://msftdbprodsamples.codeplex.com/ Click on the link " AdventureWorks Databases – 2008, 2008R2 and 2012 " ( http://msftdbprodsamples.codeplex.com/releases/view/93587 ). You'll be taken to the following page: Decide which version of the Ad

C# and VB.NET Comparison

Seeing as how my new gig will require me to root around some legacy VB.NET code, I thought it might be useful to familiarize myself with the language. Most of us has dealt with classic Visual Basic way back when and, more recently, when you peruse the MSDN documentation there's usually a C# example and a VB.NET example for each concept. So, VB.NET is not a totally foreign language. However, I still found the following web page useful when I wanted to do something in VB.NET and didn't know the specific syntax: VB.NET and C# Comparison http://www.harding.edu/fmccown/vbnet_csharp_comparison.html (And, as a bonus, there's a link to a Java and C# Comparison .) And, since I'm not too proud to admit that I'm going to spend the morning banging through VB.NET tutorials, I'm going to share this link to a so-far-so-good set of video tutorials: VB.NET,  by Nicholas Dingle, 38 videos https://www.youtube.com/playlist?list=PLsJBMeqEdtggJi2khGAjgnQ3ssgzWw_uz As o

Dealing with the Error "ERROR [HY008] [IBM][CLI Driver][DB2/NT] SQL0952N Processing was cancelled due to an interrupt. SQLSTATE=57014"

During a recent DB2 to SQL Server conversion, I received the following run-time exception: ERROR [HY008] [IBM][CLI Driver][DB2/NT] SQL0952N Processing was cancelled due to an interrupt. SQLSTATE=57014 A little research showed me that the error typically occurs when a SQL query against a DB2 database runs an excessively long time. To address or get around this, you can adjust the CommandTimeout property of the DB2Command object. Increase the value to allow more time for your query. While there's quite a few links concerning this issue, the following was most helpful: http://www-01.ibm.com/support/docview.wss?uid=swg21424265 Addendum Ideally, you should look into why the query ran so long in the first place. In my case, I found that a a single row in my Invoices table (and likewise in my Payments table) had some issues with a pseudo foreign key. That is, someone was using a column like a foreign key, there was no official foreign key constraint which used this column, and

WPF Binding Cheat Sheet

WPF Bindings are pretty straight-forward. However, when you're in the thick of things sometimes you need a cheat sheet to jog your memory. The following cheat sheet (not of my making) has been very useful: http://www.cheat-sheets.org/saved-copy/WpfBinding.pdf Thanks to whomever posted and maintains it over at Cheat-Sheets.org !

Quick & Dirty Code First with Entity Framework 6

I've never had the opportunity to work with the Code First approach in Entity Framework. All my work professionally has been against existing databases. However, I was given the opportunity to create two new applications for another business unit and decided it was time to try Code First. Code First definitely feels strange to me, as I was brought up to design the database first and work from there. Computers are about data, right? So, why wouldn't you start there when building a new application. But, it's always good to try something new and perhaps gain a fresh perspective. Code First isn't something I expect to use much but, heck, why not give it a try? Okay, first off, all those videos on YouTube where people rip through a Code First example in under ten minutes? Bah. In real life, I'm not working against an instance of LocalDb or SqlExpress -- I'm hitting an instance of a full-fledged SQL Server engine on a server somewhere deep in the bowels of the co