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
 Inserting into a #temp table

Author  Topic 

nt86
Yak Posting Veteran

54 Posts

Posted - 2009-12-02 : 05:11:01
I've created a temp table and I have a field in it called DAY_HOUR_RATE to get the value for this I need to get it from another field DAY_RATE in a table called TBL_ELECTRICITY_RATES, should I use inner join or possibly SELECT INTO or what is the best way to do it, its only one set value. This is what I got so far

SELECT DAY_RATE
INTO day_hour_rate
FROM TBL_ELECTRICITY_RATES

insert into #savingstemp (day_hour_rate)
Values ('')

I am also unsure about how to insert it correctly into the table, Thanks :)

niall

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-12-02 : 07:20:26
insert into #savingstemp (day_hour_rate)
SELECT DAY_RATE FROM TBL_ELECTRICITY_RATES

Madhivanan

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

nt86
Yak Posting Veteran

54 Posts

Posted - 2009-12-02 : 10:31:44
Thanks for that :)

quote:
Originally posted by madhivanan

insert into #savingstemp (day_hour_rate)
SELECT DAY_RATE FROM TBL_ELECTRICITY_RATES

Madhivanan

Failing to plan is Planning to fail



niall
Go to Top of Page
   

- Advertisement -