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
 FAST insert ?

Author  Topic 

pazzy11
Posting Yak Master

145 Posts

Posted - 2007-12-18 : 06:44:03
I need to insert data to a temp table in SQL ,
I have
[CODE]
CREATE TABLE TMP_X (
doc_name varchar(200)
)


--select * from TMP_X

INSERT into TMP_X
values
(
'...,

[/CODE]

but its saying there isn't a match, and i know why its trying to insert all the data as one row, but i need them as seperate rows as i want only 1 column..
is there another INSERT type function ?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2007-12-18 : 06:51:02
use

INSERT into TMP_X
SELECT {value1}
UNION
SELECT {value2}
UNION
..........
to insert values as different rows...

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-12-18 : 06:55:18
[code]CREATE TABLE TMP_X
(
doc_name varchar(200)
)
GO

INSERT into TMP_X
select col1 from TMP_X -- select only one column, not all with the * approach.[/code]




E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -