Set IDENTITY_INSERT On and Off
Cannot insert explicit value for identity column in table ‘sometableWithIdentity’ when IDENTITY_INSERT is set to OFF
Sql Grant Permission
Grants permissions on a table, view, table-valued function, stored procedure, extended stored procedure, scalar function, aggregate function, service queue, or synonym. Syntax Object permission Implied by object permission Implied by schema permission ALTER CONTROL ALTER CONTROL CONTROL CONTROL DELETE CONTROL DELETE EXECUTE CONTROL EXECUTE INSERT CONTROL INSERT RECEIVE CONTROL CONTROL REFERENCES CONTROL REFERENCES SELECT RECEIVE... » read more
SQL Server Compatibility Level
Sets Transact-SQL and query processing behaviors to be compatible with the specified version of the SQL Server Database Engine. Product Database Engine Version Default Compatibility Level Designation Supported Compatibility Level Values SQL Server 2019 preview 15 150 150, 140, 130, 120, 110, 100 SQL Server 2017 (14.x) 14 140 140, 130, 120, 110, 100 Azure... » read more
Disable All Jobs Script
Generate a script to disable all active jobs on server. Returns all jobs that are not idle or suspended.
SQL Server Type: money vs smallmoney
Data type Range Storage money -922,337,203,685,477.5808 to 922,337,203,685,477.5807 (-922,337,203,685,477.58to 922,337,203,685,477.58 for Informatica. Informatica only supports two decimals, not four.) 8 bytes smallmoney – 214,748.3648 to 214,748.3647 4 bytes The money and smallmoney data types are accurate to a ten-thousandth of the monetary units that they represent. For Informatica, the money and smallmoney data types are accurate to a one-hundredth of the monetary units... » read more
Adding Error Handling and Transaction to Stored Procedure
Error Handling Error Handling with Transaction
Passing Table Type to Stored Procedure
User-Defined Table Types Stored Procedure Code Note: Need to make sure the type type has the right access permissions.
SQL Server Build Verions
RTM SP1 SP2 SP3 SP4 Most Recent Version ↓SQL Server 2019 15.0.1600.8 (CTP 3.0) ↓SQL Server 2017 14.0.1000.169 14.0.3192.2 (CVE-2019-1068) ↓SQL Server 2016 13.00.1601.5 13.0.4001.0 13.0.5026.0 13.0.5366.0 (CVE-2019-1068) ↓SQL Server 2014 12.00.2000.8 12.0.4100.1 12.0.5000.0 12.0.6024.0 12.0.6293.0 (CVE-2019-1068) ↓SQL Server 2012 11.00.2100.60 11.0.3000.0 11.0.5058.0 11.0.6020.0 11.0.7001.0 11.0.7469.6 (FIX for SP4) ↓SQL Server 2008R2 10.50.1600.1 10.50.2500 10.50.4000 10.50.6000 10.50.6560.0 (KB4057113) ↓SQL Server 2008... » read more
Database Backup Encryption
Restoring encrypted database on another server (using Backup Encryption). Only works with SQL Server 2014 and later. Backup If a certificate is not backed up prior to backing up a database in T-SQL the following warning will be displayed in the results: Warning: The certificate used for encrypting the database encryption key has not been... » read more