MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 11th, 2004, 08:34 AM
Damo Damo is offline
The Never Ending Curve
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: Nottingham UK
Posts: 105 Damo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 34 m 6 sec
Reputation Power: 7
Unique ID, without an ID column

Hi,

How can I assign or retrieve a unique ID from a msSQL table where there isn't a unique column.

Is there a hidden 'raw id' i can retrieve from msSQL for each record?

I'm not allowed to change the current database at all, but the developers who created it managed to use it without Unique IDs.... which doesn't help me coming from a mySQL background where UID's are kind of mandatory.

Thanks
__________________
Damo

Reply With Quote
  #2  
Old July 11th, 2004, 10:02 AM
swampBoogie swampBoogie is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2003
Location: Paris Uppland
Posts: 1,784 swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 21 h 42 m 49 sec
Reputation Power: 37
Quote:
Is there a hidden 'raw id' i can retrieve from msSQL for each record?


No. You need a primary key or unique constraint. Tell that to the developers.

Quote:
which doesn't help me coming from a mySQL background where UID's are kind of mandatory.


There is no difference between Mysql and Mssql with regard to this.

Reply With Quote
  #3  
Old July 11th, 2004, 10:16 AM
Damo Damo is offline
The Never Ending Curve
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: Nottingham UK
Posts: 105 Damo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 34 m 6 sec
Reputation Power: 7
Quote:
No. You need a primary key or unique constraint. Tell that to the developers.


I've gotten a little further, I've discovered how do find out the primary key. (in this case there are 3)

Quote:
There is no difference between Mysql and Mssql with regard to this


True, the SQL is the same. I'll rephrase. I'm used to doing things in a certain way with mySQL, where as in this case someone else has designed the database without my beloved unique ID's.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Unique ID, without an ID column


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT