
Import Excel Data into SQL
In order to read from an Excel Spreadsheet through SQL you need to install the Office 2010 Database Engine. Afterwards, run statements similar to the following: EXEC sp_configure ‘Show Advanced

In order to read from an Excel Spreadsheet through SQL you need to install the Office 2010 Database Engine. Afterwards, run statements similar to the following: EXEC sp_configure ‘Show Advanced

To?find?Collations?in?your?table,?you?can?use?the?following: SELECT ????SysCol.Name,?SysCol.Collation_Name FROM? ????sys.Columns?SysCol WHERE ????Object_ID?=?OBJECT_ID(‘YOUR_TABLE_NAME’)

A trigger is a stored procedure that runs automatically when various events happen (update, insert, delete, etc.) To display the contents of a Trigger, use a query similar to the

declare @SQL VARCHAR(MAX) = ‘String to Replace’set @SQL = REPLACE(@SQL, ‘)’, ‘Replacement String’)select @SQL

Use this nifty function to check the validity of an email address. CREATE FUNCTION [dbo].[fnCheckEmail](@Email VARCHAR(255)) RETURNS BIT AS BEGIN DECLARE @ValidEMail BIT IF @Email IS NOT NULL SET @Email

To bypass “the row values updated or deleted either do not make the row unique or alter multiple rows” error message, all you need to do is add a query

Sometimes when doing a search for data between date ranges, some of the data is omitted because the search doesn’t include the whole last day’s values. Here is a small

There are times that you need to access information from the previous row or next row from the current row. Here is a small trick that makes use of a

Often, we see ambiguity in accessing database objects as they exist in multiple databases and schemas. One easy way is to fully qualify the database objects, so that there is