How to write Stored Procedure for Insert Data & Execute it in MS SQL?
View Complete Post
Here is my SP:
create or replacePROCEDURE ZGETUSERSSIGNONS (vUid IN VARCHAR2, p_getuserssignon_recordset1 OUT SYS_REFCURSOR) ASBEGIN Open p_getuserssignon_recordset1 for SELECT Distinct(Userid), UserPassword, SecurityLevel, ActiveStatusFROM ZSIGNON WHERE substr(UserId,1,2) <> vUidOrder By UserId;END ZGETUSERSSIGNONS;
I would like to run this SP from code and fill a gridview with the result.
I am not sure how to go about this, as I have found several different examples, other than the one I think I need.
I am using the oracle data provider and I have an input parameter (vUid, which will equal "zz").
First question. When filling a gridview with a result set from a stored procedure should the recordset OUT be defined as a REFCURSOR (like i did above)?
Do you have example code as to how to execute the SP and fill a gridview? I keep trying different variations of code i've found on the internet without any success other than getting more confused.
(I am using VS 2005, VB).
I'm using Dynamic Data and have created a custom List.aspx page. I simply want to populate the grid with a stored procedure. I've seen some posts about doing this with a LinqDataSource but not an EntityDataSource. Does someone have an example or a different way of doing this? Thanks.
I am working on an asp.net application which uses quite a few sql 2005 procedures. Due to some change in requirement I had to modify a couple of the procedures.
During this change, I found that most of the procedures contain clause With Recompile, Execute As Caller.
I am planning to refactor the code in procedure but not sure if I can remove these clauses. Can any one please help me with these?
Thanks in advance.
Hi!! I need your help again.
I have a gridview with a button in the first column of the footer row and some controls (textbox, dropdowlist...) in the rest of the columns. I want to click that button and insert into a database table using an stored procedure the text properties of the controls in the other columns.
I don't know what's wrong... could you help me or post me a link to read it??
I'm setting the insert command with my stored procedure, I'm setting the storedprocedure as the insertcommandtype, I'm able to load the controls with correct values, but finally when I click the insert button that's not work!!!!
I'm trying to create a stored procedure that get a Key and Name (both varchar), the procedure will check if a the key allready exists in the table, if it exists it will update the name, if its not exists it will add it to the table..
I have no clue how to use IF to check if the row exists, please help.
Which is a better way to do in Execute SQL Task : Direct SQL input or Create a stored proc in database and then use that.
In my opinion, Stored Procedure is a better and recommended way for following reasons:
Please let me know if this is not the case with SSIS Execute SQL Task.
If I have the following XML being passed as a parameter into a stored procedure.