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.
| Author |
Topic |
|
Frankp2112
Starting Member
4 Posts |
Posted - 2008-11-05 : 09:44:33
|
| I have created an insert query which uses a select query to get some of the values to insert into the new table. Something like this.INSERT INTO tbl_contact_status( [Season], [Ref], [IdividualCode], [Call], [Call_Status] )SELECT Season, ref,IndividualCodeFROM dbo.Details INNER JOINWHERE (dbo.Tbl_Contact_Status.IdividualCode IS NULL)This works fine. What I am trying to do is insert some fixed values into 2 columns.Is there any way I can insert fixed values into the table at the same time as I insert the values from the source table?ThanksFrank |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2008-11-05 : 09:46:23
|
| INSERT INTO tbl_contact_status( [Season], [Ref], [IdividualCode], [Call], [Call_Status] ,[fixed column1],[fixed column 2])SELECT Season, ref,IndividualCode,'fixed string',1FROM dbo.Details INNER JOINWHERE (dbo.Tbl_Contact_Status.IdividualCode IS NULL) |
 |
|
|
NeilG
Aged Yak Warrior
530 Posts |
Posted - 2008-11-05 : 09:47:51
|
| Try just entering the fixed value onto the select statement this will work like below INSERT INTO tbl_contact_status( [Season], [Ref], [IndividualCode], [Call], [Call_Status] )SELECT Season, ref,IndividualCode, 'fixed value','Fixedvalue'FROM dbo.Details INNER JOINWHERE (dbo.Tbl_Contact_Status.IdividualCode IS NULL) |
 |
|
|
|
|
|
|
|