| Author |
Topic |
|
fosterc
Starting Member
3 Posts |
Posted - 2009-01-20 : 09:49:22
|
| I've got a Stored Procedure that is working fine using the IDENTITY function, but now need to create a VIEW instead. As I am unable to create temporary tables within the view, is there an alternative function for me to use that does the same as IDENTITY? |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2009-01-20 : 09:52:57
|
| Are you using SQL Server 2005?Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
fosterc
Starting Member
3 Posts |
Posted - 2009-01-20 : 09:54:12
|
| No it's SQL Server 2000 |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-01-20 : 10:29:26
|
Use Correlated Subquery.But beware, it will bring your server down to it's knees if the resultset is large. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
fosterc
Starting Member
3 Posts |
Posted - 2009-01-20 : 11:31:22
|
| Ooh thanks for that - I'll give it a try :) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-20 : 11:34:43
|
| welcome |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-01-20 : 11:46:54
|
The link refers to SQL Server 2005. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-20 : 11:51:18
|
quote: Originally posted by Peso The link refers to SQL Server 2005. E 12°55'05.63"N 56°04'39.26"
Nope. I have given 2000 solution as well |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-01-20 : 13:00:17
|
Oh, you mean the last post regarding correlated subquery?Which was already mentioned? E 12°55'05.63"N 56°04'39.26" |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2009-01-20 : 14:39:09
|
| You could cheat by create a user-defined table function that uses your Identity logic, and then just have your view select from the function...________________________________________________If it is not practically useful, then it is practically useless.________________________________________________ |
 |
|
|
|