﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server 2005 General Discussion  / confusion in setting up superkey / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 07:09:13 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: confusion in setting up superkey</title><link>http://www.sqlservercentral.com/Forums/Topic1372714-149-1.aspx</link><description>[quote]...now I want to set superkey on (VENDORID+ADDRESS+CITY) which identify unique record....[/quote]Why three of them? Are you saying that VENDORID in your VENDOR table is not unique by itself?Or, you want to say that the same Vendor can have different addresses or at the same address you may hold multiple vendors? If so, you better create separate Address and VendorAddress tables to this data in RDBMS way. Address table will have AddressId and address details and VendorAddress will have  VendorId and AddressId as a composite PK?Or, at least, just have separate VendorAddress table to store multiple vendor addresses in your way. Still, it will be way better than storing multiple records of the same vendor in Vendor table...</description><pubDate>Tue, 16 Oct 2012 05:09:24 GMT</pubDate><dc:creator>Eugene Elutin</dc:creator></item><item><title>RE: confusion in setting up superkey</title><link>http://www.sqlservercentral.com/Forums/Topic1372714-149-1.aspx</link><description>[quote][b]ChrisM@home (10/15/2012)[/b][hr][quote][b]deba_20032004 (10/15/2012)[/b][hr]Dear Sir,I am in great trouble, my problem is I have a vendor Tablewhich consist of some fields. I explaining the structure belowTable&amp;lt;Vendor&amp;gt;--------------fields name-----------PKID   intVENDORID intVENDORNAME  varchar (50)ADDRESS varchar(50)CITY varchar(15)I have set Primary key on PKID (cluster index)I have set non cluster index on (VENDORID,VENDORNAME/ADDRESS) FIELDSnow I want to set superkey on (VENDORID+ADDRESS+CITY) which identify unique record.is it right structure for creating indexplease give me suggestionthanks in advanceDebasis[/quote]Why does your vendor table have both a PKID and a VendorID?[/quote]Maybe he wants to be able to change the VendorID at some future time?</description><pubDate>Mon, 15 Oct 2012 19:05:29 GMT</pubDate><dc:creator>dwain.c</dc:creator></item><item><title>RE: confusion in setting up superkey</title><link>http://www.sqlservercentral.com/Forums/Topic1372714-149-1.aspx</link><description>[quote][b]deba_20032004 (10/15/2012)[/b][hr]Dear Sir,I am in great trouble, my problem is I have a vendor Tablewhich consist of some fields. I explaining the structure belowTable&amp;lt;Vendor&amp;gt;--------------fields name-----------PKID   intVENDORID intVENDORNAME  varchar (50)ADDRESS varchar(50)CITY varchar(15)I have set Primary key on PKID (cluster index)I have set non cluster index on (VENDORID,VENDORNAME/ADDRESS) FIELDSnow I want to set superkey on (VENDORID+ADDRESS+CITY) which identify unique record.is it right structure for creating indexplease give me suggestionthanks in advanceDebasis[/quote]Why does your vendor table have both a PKID and a VendorID?</description><pubDate>Mon, 15 Oct 2012 10:23:33 GMT</pubDate><dc:creator>ChrisM@home</dc:creator></item><item><title>RE: confusion in setting up superkey</title><link>http://www.sqlservercentral.com/Forums/Topic1372714-149-1.aspx</link><description>You can create a unique non clustered index on (VENDORID+ADDRESS+CITY) since your primary key is already specified.  You can specify a unique key constraint when creating the table also.</description><pubDate>Mon, 15 Oct 2012 10:20:34 GMT</pubDate><dc:creator>foxxo</dc:creator></item><item><title>confusion in setting up superkey</title><link>http://www.sqlservercentral.com/Forums/Topic1372714-149-1.aspx</link><description>Dear Sir,I am in great trouble, my problem is I have a vendor Tablewhich consist of some fields. I explaining the structure belowTable&amp;lt;Vendor&amp;gt;--------------fields name-----------PKID   intVENDORID intVENDORNAME  varchar (50)ADDRESS varchar(50)CITY varchar(15)I have set Primary key on PKID (cluster index)I have set non cluster index on (VENDORID,VENDORNAME/ADDRESS) FIELDSnow I want to set superkey on (VENDORID+ADDRESS+CITY) which identify unique record.is it right structure for creating indexplease give me suggestionthanks in advanceDebasis</description><pubDate>Mon, 15 Oct 2012 07:08:44 GMT</pubDate><dc:creator>deba_20032004</dc:creator></item></channel></rss>