call procedure problem

maniekPL's profile image maniekPL posted 4 years ago in Running SQL scripts Permalink

Hi tell me why the application not call this procedure?

ALTER PROCEDURE [dbo].[proc_GenerateRandomTicket_ImportOsoba] AS BEGIN DECLARE @Random numeric(10,0); DECLARE @Upper numeric(10,0); DECLARE @Lower numeric(10,0); DECLARE @TicketCode VARCHAR(10); DECLARE @i smallint=0; SET @Lower =268435456; -- The lowest random 32 bits number SET @Upper = 4294967295; -- The highest random 32 bits number

WHILE @i < 200

Begin SELECT @Random = ROUND(((@Upper-@Lower-1) * RAND() + @Lower), 0); SELECT @TicketCode = CONVERT(VARCHAR(10), @Random);

EXEC [dbo].[proc_ImportOsoba_Bilety] @TicketCode;

SET @i = @i + 1 END

maniekPL's profile image maniekPL posted 4 years ago Permalink

i get the error:

ALTER PROCEDURE [dbo].[proc_GenerateRandomTicket_ImportOsoba] AS BEGIN DECLARE @Random numeric(10,0); / Error SQL (102): Incorrect syntax near ')'. /

ansgar's profile image ansgar posted 4 years ago Permalink

Please note that HeidiSQL cuts your ALTER/CREATE code at semicolon's. So, if you need the semicolon inside a query, you should set Heidi's delimiter to something else:

Description

Please login to leave a reply, or register at first.