Hi, Could we Insert Multiple Rows within a Single Round Trip? IF so can you guide me please. Thank you. Usha Rani
Not sure I understand you. Do you mean something like INSERT INTO...SELECT...? -- Frank Kalis Moderator Microsoft SQL Server MVP Webmaster:http://www.insidesql.de
ex: Insert Selected Categories from front end as multiple records into a detail table. I have constructed a string with IDS to insert, passed it to SP as a parameter, and then from SP I have used an Insert Into Table(guid, CatID) (Select @GUID, CAtID from ategories WHerre CatID in(IDS) to insert. IS there any other way than The above and XML? Thank you. Usha Rani
Dynamic SQL ?!? ...and, as always...http://www.sommarskog.se/dynamic_sql.html -- Frank Kalis Moderator Microsoft SQL Server MVP Webmaster:http://www.insidesql.de
Hm?!?<br />I'm pretty much it IS mentioned. Even in the 2000 BOL. At least in the 2005 BOL you can find it at "Using INSERT with the VALUE Clause and a SELECT Subquery" and ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/a2336a30-1793-4a29-bffc-500e24204d70.htm for example. [<img src='/community/emoticons/emotion-1.gif' alt='' />]<br /><br />--<br />Frank Kalis<br />Moderator<br />Microsoft SQL Server MVP<br />Webmaster:<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a>
But can't avoid dynamic SQL <img src='/community/emoticons/emotion-6.gif' alt='' /><br /><br />Usha Rani
Adriaan, what happened to your posting? [<img src='/community/emoticons/emotion-5.gif' alt='' />]<br /><br />--<br />Frank Kalis<br />Moderator<br />Microsoft SQL Server MVP<br />Webmaster:<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a>
Upload data to holding table (for instance in Access you can have ODBC linked tables, into which you can insert) then start stored procedure to do the merge? Upload a text/MDB/XLS file to SQL Server, then start DTS job or stored procedure to do the merge?
Frank, I deleted the posting when I noticed you guys had taken the discussion in another direction.[<img src='/community/emoticons/emotion-1.gif' alt='' />]
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by FrankKalis</i><br /><br />Hm?!?<br />I'm pretty much it IS mentioned. Even in the 2000 BOL. At least in the 2005 BOL you can find it at "Using INSERT with the VALUE Clause and a SELECT Subquery" and ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/a2336a30-1793-4a29-bffc-500e24204d70.htm for example. [<img src='/community/emoticons/emotion-1.gif' alt='' />]<br /><br />--<br />Frank Kalis<br />Moderator<br />Microsoft SQL Server MVP<br />Webmaster:<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a><br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">And Frank - indeed the SELECT version is mentioned, but one of the problems is that there are multiple entries for INSERT INTO, and not all of them have the SELECT version.<br /><br />Now you've made me post what I deleted, you[xx(][<img src='/community/emoticons/emotion-2.gif' alt='' />]
Hey, cheap way to increase post count. [<img src='/community/emoticons/emotion-4.gif' alt='' />]<br /><br />--<br />Frank Kalis<br />Moderator<br />Microsoft SQL Server MVP<br />Webmaster:<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a>
[<img src='/community/emoticons/emotion-2.gif' alt='' />]<br /><br />--<br />Frank Kalis<br />Moderator<br />Microsoft SQL Server MVP<br />Webmaster:<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a>
With me and SQL-Server [<img src='/community/emoticons/emotion-2.gif' alt='' />]<br /><br />Usha Rani