SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 derive primary key
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

appandai
Starting Member

India
3 Posts

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

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 11/09/2012 :  06:54:52  Show Profile  Reply with Quote
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

India
3 Posts

Posted - 11/09/2012 :  10:07:31  Show Profile  Reply with Quote
thanks, will try
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000