Category Archives: SQL Server

Quick reference for different SQL Joins

                  source: Visual Representation of SQL Joins from codeproject.com

Posted in SQL, SQL Server | Tagged , , | Leave a comment

Using sqlpackage.exe parameters and properties to publish your db with less hassle

2015-09-25 This article is for anyone who already knows how to use sqlpackage.exe. Visit the Microsoft link at the bottom to learn about sqlpackage.exe usage. Where I work we use sqlpackage.exe to deploy our database snapshots (DACPACs) to various locations. … Continue reading

Posted in SQL Server | Leave a comment

ILT – How to find if two time frames overlap or collide?

14/06/2013 Let’s assume that time frame 1 starts from Start1 and ends on End1 (Time Frame 1 = Start1 – End1) Similarly Time frame 2 = Start2 – End 2 Time Frame 1 and Frame 2 Over Lap IF: Start1 … Continue reading

Posted in Database-Concepts, General Computing, SQL Server | Tagged , , | Leave a comment

ILT – How To Change SQL Server Default Database?

16-10-2012 I have been annoyed by having to change the database from the available databases drop-down whenever I want to write a query. This was because the default database which is always selected was the “Master” database which I never … Continue reading

Posted in Social Science, SQL Server | Tagged , , , , , , , , , , , , , , , , , | Leave a comment

The transaction log for database is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases

09-10-2012 I got this error today for one of my test databases. Following are the steps to solve this. Step 1 The error message gives a hint to look in the log_reuse_wait_desc column in sys.databases table. So we will just … Continue reading

Posted in SQL Server | Tagged , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

ILT – Easy Method To Manage or Map SQL Server User Access To SQL Server Databases

14-08-2012 How to easily map a SQL Server user to databases? Select the login you want to grant or deny access from the “Logins” sub-folder in the “Security” Folder in the SQL Server Right click on the user and select … Continue reading

Posted in SQL Server | Tagged , , , , | Leave a comment

How to get Table Information in SQL Server (Equivalent of Oracle’s desc)

01-06-2012 You can use following stored procedures to get table information similar to what you get by calling “Desc” in Oracle. Sp_columns ‘<TableName>’ This will show the list of columns along with other useful information such as: data type, length, … Continue reading

Posted in SQL Server | Tagged , , , | Leave a comment

Adding or Subtracting a Date Time Variable in SQL Server Using DateAdd Function

28-05-2012 You can use dateadd function to add or subtract a number of units from any part (year, month, day, hour, minute, second, millisecond, etc…) of a datetime variable. Syntax: – DateAdd(Date Part, Number Of Units To Add, Source Date) … Continue reading

Posted in SQL Server | Tagged , | Leave a comment

What is Go in SQL Server and the Importance of Using Go

25-05-2012 Go is not a SQL or Transact SQL command. Go is a command recognized by sqlcmd and osql facilities provided by SQL server studio. Go specifies an end to a particular SQL batch. Once the parser interprets a Go, … Continue reading

Posted in SQL Server | Tagged , , | Leave a comment

Importance Of Specifying Variable Length For Varchar in SQL Stored Procedures

23-05-2012 If you don’t specify a variable length for NVarchar, Varchar variables, the parser will assume the length of 1. It will not complain. Instead it will just truncate whatever you pass to the variable and use the first character. … Continue reading

Posted in SQL Server | Tagged , , , , | Leave a comment