Stop Using PRINT to Track Query Progress
Stop using PRINT. Start using RAISERROR. PRINT PRINT with GO RAISEERROR with NOWAIT Source:
Stop using PRINT. Start using RAISERROR. PRINT PRINT with GO RAISEERROR with NOWAIT Source:
The LAG function has the ability to fetch data from a previous row, while LEAD fetches data from a subsequent row. Sources:
#temp tables are available ONLY to the session that created it and are dropped when the session is closed. ##temp tables (global) are available to ALL sessions, but are still dropped when the session that created it is closed and all other references to them are closed. Local temporary tables are visible only in the... » read more
Record the number of rows affects in the last transaction.
Bitwise Operators X Y X&Y X|Y X^Y ~X 0 0 0 0 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 See the following topics: & (Bitwise AND) &= (Bitwise AND Assignment) | (Bitwise OR) |= (Bitwise OR Assignment) ^ (Bitwise Exclusive OR) ^=... » read more
Example 1: Example 2:
Unique constraint on a column to prevent duplicate entry on a column. Using SQL Server Management Studio In Object Explorer, right-click the table to which you want to add a unique constraint, and click Design. On the Table Designer menu, click Indexes/Keys. In the Indexes/Keys dialog box, click Add. In the grid under General, click Type and choose Unique Key from the drop-down list box to the right... » read more