November 10, 2006 at 9:24 am
Im trying to create and execute a simple stored procedure from a batchfile.
in the batch file I use just to test the batch file
isql /U username /P password /S servername /d database name
CREATE PROCEDURE dbo.IMPORT_DATA_TEST_SP
@P_OBJECT_TYPE NVARCHAR(2),
@R_OUT_COUNT INTEGER OUTPUT
AS
/* ------------------------------------------------------------------------ */
/* Procedure IMPORT_DATA_TEST_SP */
/* Created 08/11/2006 */
/* Description: */
/* A test stored procedure that can be used for testing command-line */
/* calls using isql e.g. when running from a batch file. */
/* ------------------------------------------------------------------------ */
DECLARE @V_COUNT int
SET NOCOUNT ON
SELECT @V_COUNT = COUNT(*)
FROM sysobjects
WHERE xtype = @P_OBJECT_TYPE
SET @R_OUT_COUNT = @V_COUNT
RETURN
SET NOCOUNT OFF
DECLARE @V_NUM integer
set @V_NUM = 0
EXEC IMPORT_DATA_TEST_SP 'U', @R_OUT_COUNT = @V_NUM output
SELECT @V_NUM
GO
'U' is user table
The problem is, when I run this, the command prompt window returns the 1st line and then >1 and then nothing else
November 10, 2006 at 2:35 pm
found where I was going wrong..thanks
November 12, 2006 at 2:49 pm
Mind sharing the solution?
Also, using ISQL is "Death by SQL" because, compared to OSQL, it is severely deprecated. Change the ISQL to OSQL and you'll be much better off.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply