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 |
|
pras2007
Posting Yak Master
216 Posts |
Posted - 2009-06-09 : 15:31:29
|
| I’ve created a GUID (uniqueidentifier) field that auto-generates; The problem is that I want to pass the latest GUID value in a stored procedure, but I’m having problems doing so. In the same record set I have a field that stores date values, maybe I can track down the latest date value then can select the latest GUID values. Below is an example of the table in question. Please advice. Thanks.ExampleREC_ID REC_Date354071EA-2392-4216-B970-8A7E5EF9F174 2009-06-09 09:14:46.040FB60940A-CDBF-48A3-8534-9040243FFE11 2009-06-09 14:19:05.083 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-06-09 : 15:47:32
|
select top 1 REC_IDfrom tableorder by REC_Date DESC No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Skorch
Constraint Violating Yak Guru
300 Posts |
Posted - 2009-06-09 : 15:48:26
|
| SELECT TOP 1 REC_IDFROM YourTableORDER BY REC_Date DESCLooks like I was late :)Some days you're the dog, and some days you're the fire hydrant. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-06-09 : 15:53:29
|
In most cases I am toooo late and in this case I am the dog  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|