Saturday, 8 September 2012

Create database to test Queries of this blog..........

Run this script:


CREATE DATABASE dbTest;

CREATE TABLE Person
(
pid INT IDENTITY(1,1),
name VARCHAR(200) NOT NULL,
dob DATETIME NULL,
occupation varchar(100) NULL,
address VARCHAR(200),
city VARCHAR(100),
state VARCHAR(100),
isBlock BIT,
PRIMARY KEY(PID)
)

USE [dbTest]
GO
/****** Insert Data into Person table   ******/
SET IDENTITY_INSERT [dbo].[Person] ON
INSERT [dbo].[Person] ([pid], [name], [dob], [occupation], [address], [city], [state], [isBlock]) VALUES (1, N'Abhishek', CAST(0x00007A1B00000000 AS DateTime), N'Student', N'E-56', N'Delhi', N'Delhi', 0)
INSERT [dbo].[Person] ([pid], [name], [dob], [occupation], [address], [city], [state], [isBlock]) VALUES (2, N'Ram', CAST(0x00006E2500000000 AS DateTime), N'DBA', N'PritVihar', N'Lucknow', N'U.P.', 0)
INSERT [dbo].[Person] ([pid], [name], [dob], [occupation], [address], [city], [state], [isBlock]) VALUES (3, N'Abhijit', CAST(0x00007E8300000000 AS DateTime), N'J.DBA', N'', NULL, NULL, 1)
SET IDENTITY_INSERT [dbo].[Person] OFF


No comments:

Post a Comment

Please leave a comment for this post