Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 derive primary key

Author  Topic 

appandai
Starting Member

3 Posts

Posted - 2012-11-09 : 06:23:17
kindly help to derive primary key from two column data example primary key = studentID(nvarchar50) + date(date).
I am new to sql server

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-11-09 : 06:54:52
Take a look at this page - there is a description with examples here: http://blog.sqlauthority.com/2007/10/16/sql-server-three-t-sql-script-to-create-primary-keys-on-table/

The two columns must be non-nullable for them to be part of the PK.
Go to Top of Page

appandai
Starting Member

3 Posts

Posted - 2012-11-09 : 10:07:31
thanks, will try
Go to Top of Page
   

- Advertisement -