SQL Server

XML PAD !!!

Do you have any difficulty to edit XML files? You can use this cool application to feel better when you are working with XML !! good luck 🙂 Downlod here

Cursor in SQL Server

SQL Server Cursor is a row base operator but it does not have good performance because it create different execution plan per each rows, personality I do not like use this operator so always I look for standards operators same… Read More ›

How to create table in SQL Server

USE Arm_DB Go IF (OBJECT_ID(‘TBL_Product’,’U’) IS NOT NULL) DROP TABLE TBL_Product Go CREATE TABLE TBL_Product ( ID INT IDENTITY(1,1) ,NAME NVARCHAR(50) ,Price DECIMAL(10,2) ,[Desc] NVARCHAR(MAX) ,InsertedDate DATETIME DEFAULT SYSDATETIME() ,MOdifiedDate DATETIME DEFAULT SYSDATETIME() CONSTRAINT PK_TBL_Product PRIMARY KEY (ID) ) GO… Read More ›

How to get list of the most expensive queries in SQL Server

SELECT TOP 20 (total_logical_reads + total_logical_writes) / execution_count AS AverageIO ,(total_logical_reads + total_logical_writes) AS TotalIO ,qt.text Query ,o.name ObjectName ,DB_NAME(qt.dbid) AS DATABASEName FROM sys.dm_exec_query_stats qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt LEFT OUTER JOIN sys.objects o ON o.object_id = qt.objectid ORDER… Read More ›