Wednesday, 6 March 2013

How to create auto generate field,unique key,Foreign key with two tables in Sql Server 2008


How to create Auto Generate,Unique key,Foreign key  with two tables in Sql Server 2008




create database test

use test
create table StudentInfo (RollNo int identity(1,1) primary key ,Name nvarchar(50) unique,Course nvarchar(100)NOT NULL)

Create table Books (
SrNo int identity(1,1) primary key,BookName nvarchar(50),Quantity int,RollNo int foreign key references StudentInfo (RollNo))









0 comments:

Post a Comment