0

hello,

I'm trying to create a database in SQL Server management Studio for a project. I have created a tabel named Employee and I have 14 columns. I need to set the firts column (Emp_ID) as Primary Key (accomplished) and then generate a unique number for each Emp_ID that I insert. currently I have no information in my database I'm stuck in finding the procedure to correctly code the SQL statement that will generate a unique Emp_ID when I insert new values or add a new row of information. Can someone please help? I"ve look all over my text and searched the web and cannot find something useful to help.

thanks in advance

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by kevlam
0
CREATE TABLE Employee
(
Emp_Id int PRIMARY KEY IDENTITY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
postalcode vachar(6),
/* other columns*/
)

not sure about sql server, identity SHOULD be the keyword to make it autoincrement

Edited by almostbob: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.