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 2000 Forums
 SQL Server Development (2000)
 inserting constants and select at same time?

Author  Topic 

Lord Dubu
Starting Member

12 Posts

Posted - 2004-06-14 : 17:02:34
I need to harvest one value from a table and insert that value along with a constant of '2004-04-27 00:00:00.000' for each of the newly inserted rows. Is there an easy way to do this as a single statement?

I've tried this:

insert into club_promotions (clubcustid,datestamp)
select num from case_success, '2004-04-29';

But it doesn't like the syntax of '2004-04-29

nr
SQLTeam MVY

12543 Posts

Posted - 2004-06-14 : 17:17:12
insert into club_promotions (clubcustid,datestamp)
select num, '20040429' from case_success

Always best to use yyyymmdd.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -