Hi All,
How to insert 10rows of data at a time with 1 query into a table?
Hi All,
How to insert 10rows of data at a time with 1 query into a table?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vijaya KadiyalaPosted Jun 30, 2008, 2:07 PM
Hi,
You have to write 10 different Insert statements if you have explicit values.
Thanks -- Vj
http://dotnetvj.blogspot.com
Ali ZaidiPosted Jun 30, 2008, 1:40 AM
yes
first write xml for your grid rows
ex:value value |
Now in sql server we have a procedure that converts xml to a table
XMLPreParedocument @XMLString,@Doc
OPENXML()
you can see this in sqlserver functions
ravindar paillaPosted Jun 30, 2008, 1:34 AM
yes,
and can we write with one single query?
Ali ZaidiPosted Jun 30, 2008, 1:29 AM
Niradhip ChakrabortyPosted Jun 30, 2008, 1:25 AM
Try this:
INSERT INTO thetable (field1, field2)
SELECT value1, value2
UNION ALL
SELECT value3, value4
UNION ALL
.
.
.
SELECT value5, value6;