2016/07/19 Source / Reference : Msdn Member name Description BigInt Int64. A 64-bit signed integer. Binary Array of type Byte. A fixed-length stream of binary data ranging between 1 and 8,000 bytes. Bit Boolean. An unsigned numeric value that can be 0, 1, or null. Char String. A fixed-length stream of non-Unicode characters ranging betweenContinue reading “SQL Server data types explained with .net data types”
Category Archives: SQL Server
Quick reference for different SQL Joins
source: Visual Representation of SQL Joins from codeproject.com
SQL to Generate C# Properties from SQL Table Columns
2016/07/15 Below SQL will generate C# properties for all columns in a table in SQL server. Notes: You will have to fix datatypes that are not interchangeable between SQL and C#. You will also have to polish property names if you follow a different naming convention for column names. The query below automatically renames someContinue reading “SQL to Generate C# Properties from SQL Table Columns”
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. Since I have started to use this I faced several problems as the script wasContinue reading “Using sqlpackage.exe parameters and properties to publish your db with less hassle”
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 <= End2 AND End1 >= Start2 Time Frames do not overlap IF: End2 < Start1Continue reading “ILT – How to find if two time frames overlap or collide?”
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 use. If you had the same problem then thisContinue reading “ILT – How To Change SQL Server Default Database?”
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 do it. This gave me following result for my database. name log_reuse_wait_desc RP2_TEST LOG_BACKUP IfContinue reading “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”
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 “Properties” Select “User Mapping” from the “Select a page” section You will see the listContinue reading “ILT – Easy Method To Manage or Map SQL Server User Access To SQL Server Databases”
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, Is-Nullable, etc… You can also use sp_help ‘<TableName>’ For even more descriptive information This willContinue reading “How to get Table Information in SQL Server (Equivalent of Oracle’s desc)”
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) Date Part : – Specify which part of the date you want to increment orContinue reading “Adding or Subtracting a Date Time Variable in SQL Server Using DateAdd Function”