Elcin Asyali
|
| Posted: 12/20/2002, 11:20 PM |
|
Hello,
I have a simple Stored Procedure which inserts a new record and returns the
autoincremented identity field information for this record. The account I
use to connect to this MS SQL database has the proper right to execute this
sp. But it is not working.
Source type=Procedure
Data Source= The name of the stored procedure
Variables are associated with the correct field names on the form. Actually
this is done automatically, when I selected the stored procedure name from
the dropdown list in data source section.
My first question: why this stored procedure is not working? What am I
missing?
Second : How can I return the return value of my stored procedure?
Thanks,
Elcin
|
|
|
 |
Nabor
|
| Posted: 12/20/2002, 11:28 PM |
|
"Elcin Asyali" <easyali@kfshrc.edu.sa>, haber iletisinde şunları
yazdı:au14ng$abc$1@news.codecharge.com...
> Hello,
> I have a simple Stored Procedure which inserts a new record and returns
the
> autoincremented identity field information for this record. The account I
> use to connect to this MS SQL database has the proper right to execute
this
> sp. But it is not working.
> Source type=Procedure
> Data Source= The name of the stored procedure
> Variables are associated with the correct field names on the form.
Actually
> this is done automatically, when I selected the stored procedure name from
> the dropdown list in data source section.
>
> My first question: why this stored procedure is not working? What am I
> missing?
> Second : How can I return the return value of my stored procedure?
>
> Thanks,
>
> Elcin
>
>
|
|
|
 |
Nabor
|
| Posted: 12/20/2002, 11:31 PM |
|
Your SQL Query which part of events is trying to work?
"Elcin Asyali" <easyali@kfshrc.edu.sa>, haber iletisinde şunları
yazdı:au14ng$abc$1@news.codecharge.com...
> Hello,
> I have a simple Stored Procedure which inserts a new record and returns
the
> autoincremented identity field information for this record. The account I
> use to connect to this MS SQL database has the proper right to execute
this
> sp. But it is not working.
> Source type=Procedure
> Data Source= The name of the stored procedure
> Variables are associated with the correct field names on the form.
Actually
> this is done automatically, when I selected the stored procedure name from
> the dropdown list in data source section.
>
> My first question: why this stored procedure is not working? What am I
> missing?
> Second : How can I return the return value of my stored procedure?
>
> Thanks,
>
> Elcin
>
>
|
|
|
 |
Elcin Asyali
|
| Posted: 12/21/2002, 3:16 AM |
|
My Stored Procedure is working now. My only problem is to receive the Return
Value of my sp.
Any help?
Elcin
"Nabor" <nabor@myself.com> wrote in message
news:au15bj$bbj$1@news.codecharge.com...
> Your SQL Query which part of events is trying to work?
>
> "Elcin Asyali" <easyali@kfshrc.edu.sa>, haber iletisinde şunları
> yazdı:au14ng$abc$1@news.codecharge.com...
> > Hello,
> > I have a simple Stored Procedure which inserts a new record and returns
> the
> > autoincremented identity field information for this record. The account
I
> > use to connect to this MS SQL database has the proper right to execute
> this
> > sp. But it is not working.
> > Source type=Procedure
> > Data Source= The name of the stored procedure
> > Variables are associated with the correct field names on the form.
> Actually
> > this is done automatically, when I selected the stored procedure name
from
> > the dropdown list in data source section.
> >
> > My first question: why this stored procedure is not working? What am I
> > missing?
> > Second : How can I return the return value of my stored procedure?
> >
> > Thanks,
> >
> > Elcin
> >
> >
>
>
|
|
|
 |
BJ Freeman
|
| Posted: 12/21/2002, 10:23 AM |
|
first use profiler to verify the SP is getting to the SQL server.
Second you need to declare an output in the input list.
@ProductID int =0 output
then after the insert
SELECT @ProductID = @@IDENTITY
Select ProductID=@ProductID
This gives you two returns. If you pass a variable in with the call, when
the Sp is completed then that var will have the ID in it.
you create a RS from the SP call then the RS will have an ID as ProductID.
"Elcin Asyali" <easyali@kfshrc.edu.sa> wrote in message
news:au14ng$abc$1@news.codecharge.com...
> Hello,
> I have a simple Stored Procedure which inserts a new record and returns
the
> autoincremented identity field information for this record. The account I
> use to connect to this MS SQL database has the proper right to execute
this
> sp. But it is not working.
> Source type=Procedure
> Data Source= The name of the stored procedure
> Variables are associated with the correct field names on the form.
Actually
> this is done automatically, when I selected the stored procedure name from
> the dropdown list in data source section.
>
> My first question: why this stored procedure is not working? What am I
> missing?
> Second : How can I return the return value of my stored procedure?
>
> Thanks,
>
> Elcin
>
>
|
|
|
 |
|