How to puzzle SET ANSI_NULLS and resultset in sqlserver
How to puzzle SET ANSI_NULLS and resultset in sqlserver When ANSI_NULLS is OFF, the Equals (=) and Not Equal To (<>) comparison operators do not follow the ISO standard. A SELECT statement that uses WHERE column_name = NULL returns the rows that…
How to update specific column in entire database using SQL
How to update specific column in entire database using SQL The UPDATE statement changes existing data in one or more rows in a table. The following illustrates the syntax of the UPDATE statement: UPDATE table SET column1 = new_value1, column2 =…
How to start Sqlserver from Command prompt
Instance of SQL Server 2012 and here is what we would in the configuration manager. Now, I would go ahead and stop SQL Service by selecting SQL Server (MSSQLServer) > Right Click > Stop. There are multiple ways to start SQL with startup parameter.…
Querying searching Pattern Ranges and Wild Cards in sqlserver
Querying Pattern Ranges The % wildcard character represents any number of characters of any length. Let’s find all first names that end in the letter ‘A’. By using the percentage ‘%’ sign with the letter ‘A’, we achieve this goal using the code…
OFFSET and FETCH NEXT ROWS in SQL Server 2012?
OFFSET provides a starting row from which SQL Server needs to start fetching rows and FETCH provides the number of rows we want to fetch from the result set (or in a query). OFFSET and FETCH can be used only with an order by clause. Offset row count: It…
Generate New GUID (uniqueidentifier) in SQL Server
What is new GUID? The New-GUID cmdlet creates a random globally unique identifier (GUID). If you need a unique ID in a script, you can create a GUID, as needed. What is Uniqueidentifier datatype in SQL Server? The globally unique identifier (GUID) data…
Reasons for Statement Recompilation
What is recompilation in SQL Server? Recompilation is the same process as a compilation, just executed again. If the database structure or data changes significantly, a recompilation is required to create a new query execution plan that will be optimal…
SQL SERVER – Azure SQL Databases Backup Made Easy with SQLBackupAndFTP
Azure SQL database backup used to be a difficult task. Not any more. With SQLBackupAndFTP with Azure it became trivial. Here’s what you basically need to do: Once SQLBackupAndFTP with Azure is installed, click at “Connect to SQL Server /…
Adding Column Defaulting to Current Datetime in Table
Let us see our solution. Let us first create a table which does not have column with current datetime. In our case we will assume that there are only two rows in the table. USE tempdb GO -- Create Table CREATE TABLE TestTable (ID INT, Col1 VARCHAR(100));…