October 17, 2013 at 6:33 am
aeri_q (10/17/2013)
it returns 3 rows for a specific table of my database.But when i wrote stored procedure using the same query it inserted the first row in my table. (The first of the 3 rows which where returned by the query,when executed alone)
it will because .
you below query will basically executed ONE time during every Sp execution and fill all the variable of INSERT statement once.
INSERT INTO SY.DB03F(FKNAME,SCHM,FKFLD,FKTBL,PKFLD,PKTBL)
VALUES(
@FKNAME,
@SCHNAME,
@FKFLDNAME,
@FKTBLNAME,
@PKFLDNAME,
@PKTBLNAME)
Instead .... go with the query which OTF mentioned and use it in place of above SQL insert. .
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
October 17, 2013 at 6:45 am
Ohh thank you so much ,
It was just a little and silly mistake i was doing .
INSERT ..SELECT works fine in this case .
October 17, 2013 at 6:49 am
Glad we could help.
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy