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 2005 Forums
 Transact-SQL (2005)
 Something is wrong here in this statement
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

SwePeso
Patron Saint of Lost Yaks

Sweden
30111 Posts

Posted - 08/11/2008 :  11:59:07  Show Profile  Visit SwePeso's Homepage  Reply with Quote
If you have 100+ users in your system accessing the same table,
you are so in trouble using

Exec GetNextId @NewID OUTPUT

to get unique @NewID value. Under stress, your technique will not guarantee that @NewID value is unique between calls.
An IDENTITY column will ensure that.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

tanu
Yak Posting Veteran

57 Posts

Posted - 08/11/2008 :  12:44:31  Show Profile  Reply with Quote
We want system wide uniqueid for a person. Identity column will work for only one table.
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36596 Posts

Posted - 08/11/2008 :  12:48:45  Show Profile  Visit tkizer's Homepage  Reply with Quote
System wide uniqueid works with an identity column.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tanu
Yak Posting Veteran

57 Posts

Posted - 08/11/2008 :  13:25:50  Show Profile  Reply with Quote
I have to use it according to our software vendor.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 08/11/2008 :  13:34:34  Show Profile  Reply with Quote
[quote]Originally posted by tanu

I have to use it according to our software vendor.
[/quote
How is unique id generated by your udf differing from identity generated value?
Go to Top of Page

tanu
Yak Posting Veteran

57 Posts

Posted - 08/11/2008 :  14:10:38  Show Profile  Reply with Quote
There are 5 tables.
The udf looks at all the tables and get next uniqueid out of all
tables.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30111 Posts

Posted - 08/11/2008 :  15:07:28  Show Profile  Visit SwePeso's Homepage  Reply with Quote
UniqueID is still an INT?
And from the GetNextID you get an unique id for all those five tables?

GetNextID is stored procedure, not an UDF.
If GetNextID where an UDF, there would be no problem incorporating that in the set-based solution.

Please tell us which application this is, and which vendor wrote this application, so I know what to avoid to buy.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

tanu
Yak Posting Veteran

57 Posts

Posted - 08/11/2008 :  16:22:33  Show Profile  Reply with Quote
yes, that's the stored procedure. We are sharing this uniqueid for address table,contact table and some more tables.

We already bought this and can't do anything about it.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30111 Posts

Posted - 08/12/2008 :  02:53:58  Show Profile  Visit SwePeso's Homepage  Reply with Quote
If you bought the software, what is the purpose for this topic? To copy the addresses and faculty belongings and link them?
Shouldn't this be part of the software?

What is the software name?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 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.14 seconds. Powered By: Snitz Forums 2000