sql Archives - Sion IT

Simple script to backup all databases at once

Script to backup all non system databases To backup all your MS SQL databases quickly on a SQL instance use the following script in a new query window. You must change the “SET @path” string to a suitable location.

Posted on March 21, 2013 at 20:00 by simon · Permalink · Leave a comment
In: SQL · Tagged with: , , ,

Setting SQL Server to accept date in DD/MM/YYYY format

I’ve been working on a web based database project for the wifes business and during development I realised that half of the dates where being saved in M-D-Y format. As I live in the UK we use the correct date format which is D-M-Y obviously ;). The problem turned out to be a single settings […]

Posted on December 3, 2012 at 23:22 by simon · Permalink · One Comment
In: ASP.NET, SQL, Tech · Tagged with: , , ,

Cannot shrink transaction log SQL 2005

If you ever come across a MS SQL 2005 transaction log that refuses to shrink, this little bit of code might help you out.

Posted on July 28, 2012 at 20:12 by simon · Permalink · Leave a comment
In: SQL · Tagged with: , ,

SQL Cheat Sheet

ThisSQL Cheat Sheet has examples of various SQL commands that work on most major flavours of SQL.  Though they all work on T-SQL.

Posted on July 12, 2012 at 18:54 by simon · Permalink · Leave a comment
In: SQL · Tagged with: , , , , , , ,

T-SQL Example code: Data Types

The various datatypes:

Posted on July 12, 2012 at 14:08 by simon · Permalink · Leave a comment
In: SQL · Tagged with: , , , , , , , , ,