Tag Archive | "microsoft sql server"

Creating Temporary Tables in SQL Server

Friday, October 2, 2009

Comments Off on Creating Temporary Tables in SQL Server

Here are three methods of creating and working with temporary tables in Microsoft SQL Server: Method 1: Select Into This is a quick and dirty method to create a temporary table. Compared to the other methods, you do not have to define the column names. Just add the ‘into #temptablename’ at the end of the […]

Continue reading...

Include Column Headers in SQL Results

Thursday, July 9, 2009

Comments Off on Include Column Headers in SQL Results

To include column headers when pasting or saving sql results in Microsoft SQL Server Management Studio you must make a change on the Options Panel: Open the Options panel in the menu bar Navigate to Query Results -> SQL Server -> Results to Grid Check “Include column headers when copying or saving the results.” This […]

Continue reading...

GUID Primary Keys in SQL

Thursday, June 18, 2009

Comments Off on GUID Primary Keys in SQL

Creating a GUID in Microsoft SQL Server: select newid(); Creating a GUID in MYSQL: select uuid(); Why use a GUID as a primary key? The main reason is if you want to guarantee uniqueness between databases and servers. I have never been a fan of GUIDs. Especially when having to write sql statements for reports. […]

Continue reading...