Search This Blog

Friday 4 March 2016

Log Shipping Problems

If you have problems with Log Shipping jobs failing when you do failovers the chances are that you problem is down to the shared tools being installed to different drives on each of your nodes.  See my page on how to fix this:

Fix broken log ship jobs after a failover

Monday 2 November 2015

Checking for Existence of a Temporary Table

This is a little problem that drove me nuts!!  If you're working with temporary tables usually you can just reference the table name without including the database name and the SQL engine knows the table is in the temporary database.  I was creating a script which needed to check for the existence of a temporary table and if it does exist delete it - this was to make sure that if the script needed to be run more than once consecutively that not only did it not error but it also ensured that I was only working with the current entries in the temporary table and not any left over from previous script runs.  To see the solution go to the page I have written on this:

Check for existence of a temporary table

Thursday 26 March 2015

Handling Nulls

I've done a page on how to handle nulls, in particular how to handle them when concatenating strings:

http://sqlservergoddess.blogspot.co.uk/p/blog-page_26.html 

Fetching top 3 sales people

If you've ever been asked to return the top 3 sales people in a technical test and thought it will be a walk in the park till you actually attempted it.  Sounds simple enough, sum the sales, group by sales person and it is at this point that I came unstuck the first time I tackled it many moons ago.  Well I've posted a page that explains how to do this and has some sample code for you. I use the AdventureWorks2012 database so it should be easy enough for you to reuse my code on your own system.  The page is here:

click here to open page with explanation and sample code

Monday 16 March 2015

Replication Types

I've added a page which gives a basic and brief description of the 4 different types of replication available in SQL Server 2012:

Click here for replication types page

Using BCP to Import and Export Data

I've done a page showing some simple syntax for using the BCP command line utility to import and export data to and from a database:

http://sqlservergoddess.blogspot.co.uk/p/using-bcp-to-import-and-export-data.html

Thursday 12 March 2015

sqlservr Command Line Syntax

I struggled to find a list of the arguments for the sqlservr command line so went a hunting till I found something useful.  I figured if I didn't I'd probably get a question on it in the exam and I only know the -f argument. Anyway I've now published a page with all the sqlservr arguments.