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 2012 Forums
 Transact-SQL (2012)
 Selecting rows based on Timestamp column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rockstar283
Yak Posting Veteran

90 Posts

Posted - 11/18/2013 :  17:40:52  Show Profile  Reply with Quote
I have source and target tables, both having Timestamp column in them. I would like to select all the rows from Source table which have higher Timestamp than max(Target_Timestamp). As it is a timestamp column, I am having problems with this. Can anyone please help me. Thank you!!

Lamprey
Flowing Fount of Yak Knowledge

4614 Posts

Posted - 11/18/2013 :  17:48:19  Show Profile  Reply with Quote
The data type is TIMESTAMP or is it a datetime "timestamp?"

If the data type is TIMESTAMP, then I don't think you can guarantee that the next value in the sequence is Larger.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 11/19/2013 :  01:33:24  Show Profile  Reply with Quote
timestamp has no relationship with date or time. Its just a rowversion info which is added by sql server.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 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.05 seconds. Powered By: Snitz Forums 2000