SQL Cursors

I see SQL cursor as a loop on the table. It is highly inefficient, and can result in infinite loops if not used properly. I highly recommend trying other alternatives (like Common table Expressions – CTE’s) if it is possible. Anyway, here is the syntax of a SQL cursor SELECT * INTO tmpTbl FROM (SELECT 1 AS SaleID) A[…]

Management Data Warehouse

Management Data Warehouse is a very powerful tool for monitoring the SQL Server (CPU, Memory, Disk) on the server, database, and query level. Configure the Management Data warehouse: In the Monitoring server:Right click on Data Collection > Tasks > Configure Management Data Warehouse: Then walk on the wizard, and choose the security configuration, the user[…]