03-10-2014 12:00 PM
I created a stored procedure on my machine just like yours using my own table. Using the code below I got a value of 17 (verified in SSMS), Did you modify the Create Parameterized Query VI as I originally stated in my first post?
CREATE PROCEDURE getLastSequenceNumber
-- Add the parameters for the stored procedure here
@p1 nvarchar(10) = ''
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT max(pk_tporlog) from tporlog where cuserid = @p1;
END
GO
03-10-2014 12:41 PM
I did not modify the Create Parameterized Query VI. I just did and now it works! Thanks so much for all the time and effort you put in to helping me, it is much appreciated and was a huge help.
08-05-2017 12:10 PM - edited 08-05-2017 12:19 PM
Attached is a VI that will:
(a) Open a connection to MS SQL Server database,
(b) Run a parameter laden stored procedure by name, and
(c) Return results table if any w/column names.
Other features are:
1. Return second table of results (2nd table of results)
2. Execute Stored Procedure is a Global VI that can be run from anywhere (e.g. subVIs) in the code
For the connection string you can also use the SQL Native Client connectivity string:
Driver={SQL Server Native Client 11.0};Server=myServerAddress;
Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Be sure that you have installed the MS SQL Server native client driver ver: 11.
This one uses ADO (legacy).
See attached VI library.
Anthony Lukindo
Mezintel Inc.
01-04-2020 06:00 AM
Hello,
You can use this example which is tested.
01-04-2020 06:05 AM
hello,
Find attached snippet