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
 General SQL Server Forums
 New to SQL Server Programming
 select and insert record in table in one sp in sql

Author  Topic 

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2009-04-20 : 02:29:11
hi
how can i write i have select record in table to current date and insert this records in another table in one store procedure. there r multipal select records.

thanks in advance

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-04-20 : 03:05:52
insert into target_table(column_list)
select column_list from source_table
where date_col>=dateadd(day,datediff(day,0,getdate()),0) and date_col<dateadd(day,datediff(day,0,getdate()),1) and


Madhivanan

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

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2009-04-20 : 03:59:31
thanks to replay
it is work
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-04-20 : 04:05:59
quote:
Originally posted by amirs

thanks to replay
it is work


You are welcome

Madhivanan

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

- Advertisement -