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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Update table with timestamp

Author  Topic 

kuttan939
Starting Member

4 Posts

Posted - 2009-03-10 : 01:32:47
Hi,

I have different tables (say table1, table2,etc) with the following fields.

table1(Timestamp,value1)
table2(Timestamp,value2)
.
.
.
All have same timestamp. I have to merge all tables into single table

table(timestamp,value1,value2,…..)

I think the time stamp can be updated as datetime format. But I dont know how to update columns by comparing with the timestamp. Please help

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-10 : 02:57:03
i dont you can convert the timestamp to datetime value
Go to Top of Page

kuttan939
Starting Member

4 Posts

Posted - 2009-03-10 : 04:27:58
quote:
Originally posted by visakh16

i dont you can convert the timestamp to datetime value



Yes we can convert timestamp to datetime
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-10 : 04:29:50
see this

http://www.sqlteam.com/article/timestamps-vs-datetime-data-types
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-03-10 : 04:49:12

declare @t table(i int, t timestamp)
insert into @t(i)
select 1 union all select 56
select i,cast(t as datetime) as dates,t from @t


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -