inserting multible columns from one table into a single column in another table

inserting multible columns from one table into a single column in another table

Post by Angelique Worrel » Tue, 06 Apr 1999 04:00:00



example:  in gupta I could write the following sql statement to insert
multible columns from one table into a singe column in another table.

insert into receipttable (id,name) select id,firstname|| ' ' lastname
from mastertbl where id=1

results:

1,Angelique Worrell

sql server 7.0  -- i get the following error:

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '|'.

How is this done?

Angel

 
 
 

inserting multible columns from one table into a single column in another table

Post by Rick Sawtel » Tue, 06 Apr 1999 04:00:00


In SQL Server 7, you use the + symbol for concatenation.

Try:

insert into receipttable (id,name) select id, firstname + ' ' + lastname
from mastertbl where id=1

--
Rick Sawtell MCP, MCT, MCSD

We are what we repeatedly do. Excellence, then, is not an act, but a
habit. -- Aristotle


>example:  in gupta I could write the following sql statement to insert
>multible columns from one table into a singe column in another table.

>insert into receipttable (id,name) select id,firstname|| ' ' lastname
>from mastertbl where id=1

>results:

>1,Angelique Worrell

>sql server 7.0  -- i get the following error:

>Server: Msg 170, Level 15, State 1, Line 1
>Line 1: Incorrect syntax near '|'.

>How is this done?

>Angel