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 |
|
ryanlcs
Yak Posting Veteran
62 Posts |
Posted - 2009-10-27 : 05:28:57
|
| HiIs there a way to generate a "Unique Session variable" key through stored proc? As those unique values generate under ASP.Net.Thank You. |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-10-27 : 06:44:44
|
| Do you mean unique id's like this??select convert(varchar,getdate(),112)+replace(convert(varchar,getdate(),114),':','')Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
Eli Kohen
Starting Member
6 Posts |
Posted - 2009-10-27 : 07:22:26
|
| Hi. The better way is to use the function NEWID(). The small sample from MSDN below.DECLARE @myid uniqueidentifierSET @myid = NEWID()PRINT 'Value of @myid is: '+ CONVERT(varchar(255), @myid)-- Result:-- Value of @myid is: 4FFB0451-5A33-4366-A522-4B14FFD2A80EDevart team. Database managment and data access solutions.www.devart.com |
 |
|
|
|
|
|