SQL Server Development

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 ›

Update from in SQL Server (lookup)

USE Arm_DB Go CREATE TABLE TBL_ARM1 ( ID INT IDENTITY(1,1) ,Title Nvarchar(50) ) Go CREATE TABLE TBL_Arm2 ( ID INT Identity(1,1) ,Name Nvarchar(50) ,Arm1_ID Int ,Arm_Title Nvarchar(50) ) GO INSERT INTO TBL_ARM1 VALUES (‘Arm1_1’) INSERT INTO TBL_ARM1 VALUES (‘Arm1_2’) INSERT… Read More ›