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.
| Author |
Topic |
|
kote_alex
Posting Yak Master
112 Posts |
Posted - 2009-11-24 : 08:37:18
|
| So I work with an E.R.P. program , as does almost everybody else on this forum , at some report the program generates a unique number like so... abs(tablexxx.columnxxx)='xxxx' and I have to fetch somehow that values, and it doesn't use any temp table or something like that it just has a stored select that runs when u want it and automatically generates that 4 digit value.Can I somehow grab that value after it's declared ? Thanks ! |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-25 : 01:25:30
|
| select abs(checksum(newid()))%10000MadhivananFailing to plan is Planning to fail |
 |
|
|
kote_alex
Posting Yak Master
112 Posts |
Posted - 2009-11-25 : 02:28:19
|
| sorry , but it doesn't generate the same number ... I should tell you that all these values are stored in table but there's no way to distinguish them because it has no date or other kind of entry. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-25 : 02:51:34
|
| Why do you want to generate the same number?MadhivananFailing to plan is Planning to fail |
 |
|
|
kote_alex
Posting Yak Master
112 Posts |
Posted - 2009-11-27 : 02:18:35
|
quote: Originally posted by madhivanan Why do you want to generate the same number?MadhivananFailing to plan is Planning to fail
because that number identifies a unique number stored in a large table . |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-11-27 : 02:22:19
|
| so you want to get the unique number and use it in lots of other places? or is the reqmnt to grab unique number thats generated in a table? |
 |
|
|
kote_alex
Posting Yak Master
112 Posts |
Posted - 2009-11-27 : 04:02:06
|
quote: Originally posted by visakh16 so you want to get the unique number and use it in lots of other places? or is the reqmnt to grab unique number thats generated in a table?
exactly the second question... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-11-27 : 22:20:26
|
| are you using sql 2005? |
 |
|
|
|
|
|