DBCC CHECKTABLE Fix Database Table

Examples A. Checking a specific table The following example checks the data page integrity of the HumanResources.Employee table in the AdventureWorks2012 database.SQLCopy B. Performing a low-overhead check of the table The following example performs a low overhead check of the Employee table in the AdventureWorks2012 database.SQLCopy C. Checking a specific index The following example checks a specific index, obtained... » read more

An inconsistency was detected

Error: Running a query and got this error… An inconsistency was detected during an internal operation. Please contact technical support. Fix: DBCC CHECKDB (‘DMS’) WITH NO_INFOMSGS, ALL_ERRORMSGS DBCC CHECKDB(‘DMS’, REPAIR_REBUILD) dbcc CHECKDB(‘DMS’, REPAIR_ALLOW_DATA_LOSS) Sources: https://dba.stackexchange.com/questions/11235/an-inconsistency-was-detected

Allow SQL Server Access for Azure VM

From portal.azure.com … Go to “Networking” section of VM. Add Inbound port rule … Port: 1433 Protocol: Any Check List: SQL Server Properties -> Connections -> “Allow remote connections to this server” is checked SQL Server Network Configuration -> TCP/IP is enabled and set to port 1433 Windows Defender Firewall with Advanced Security -> Inbound... » read more

Enable email notification for SQL Jobs

Note: Make sure email profile and account are setup on the SQL Server first. To enable SQL Server Agent job email notification go to … SQL Server Agent -> Properties -> Alert System -> Mail session -> Enable mail profile

Setup Mail for SQL Server to use Gmail

SQL Server Mail Account Setup Server name: smtp.gmail.com Port number: 587 This server requires a secure connection (SSL): Checked Basic Authentication: enter your username and password Google Email Make sure “Allow less secure apps” is set to ON Note: for Google Admin users go to Gmail -> Security -> Less Secure Apps Error: You will... » read more

Linked Server to SQL Azure Database

Error: OLE DB provider “SQLNCLI11” for linked server “xxxxx” returned message “Unspecified error”. Msg 40515, Level 16, State 2, Line 1 Reference to database and/or server name in ‘xxxxx.sys.sp_tables_info_90_rowset_64’ is not supported in this version of SQL Server. Fix: Create linked server to SQL Azure Database using script. Sources: http://yasqlsb.blogspot.com/2014/07/sql-azure-linked-servers.html

Noncluster Index Design

An index is a copy of information from a table that speeds up retrieval of rows from the table or view. Two main characteristics of an index are: Smaller than a table – this allows SQL Server to search the index more quickly, so when a query hits a particular column in our table and if... » read more

Backing up to NUL

Yes, I spelled that correctly. NUL not NULL. NUL is basically a location you can send a backup to. In fact, one of the awesome bonuses of this location is that your backup will take up exactly 0 bytes of space. You got it, absolutely none! Now before you get too excited (and some of you did didn’t... » read more

Back Up SQL Server Faster by Writing to Multiple Files

Even if you’re not writing to different physical drives, you can get faster backups with Microsoft SQL Server when you back up to multiple files. Your exact numbers are going to vary based on your server. Test round 1:Backing up to multiple files on one volume In this test, the backup files were on one... » read more