MSSQL Stored Procedure not reported correctly.

[expired user #8393]'s profile image [expired user #8393] posted 9 years ago in General Permalink
Hi.

Using HeidiSQL 9.2.0.4974 (64 bit) Compiled on 2015-06-28 13:40:29

Connected to a client's MSSQL remote server.

Looking at the parameters for a stored procedure. First few characters are missing.

Executing
EXEC sp_helptext N'xxxxxx.dbo.MC_Savebooking';
shows the first few lines as
Text
CREATE PROCEDURE [dbo].[MC_SaveBooking]
@Action as char(1),                 --Valid Values are N=New, U=Update, D=Deletion 
@BookType as int,                   --0 = Internet (Must be set to 0 for all bookings from the Internet)
@Branch as smallint,                --Set this to 0
@BookingRef as Int,                       --Required if Updating or Deleting. 0 will create new booking header + detail.
@BkSeq as Smallint,                       --Required if Updating or Deleting.
@Surname  as varchar(20),           --The Surname of the individual making the booking
...


But if I view the stored procedure using the HeidiSQL UI, I see ...

CREATE PROCEDURE "MC_SaveBooking"()
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
,                 --Valid Values are N=New, U=Update, D=Deletion 
@BookType as int,                   --0 = Internet (Must be set to 0 for all bookings from the Internet)
@Branch as smallint,                --Set this to 0
@BookingRef as Int,                       --Required if Updating or Deleting. 0 will create new booking header + detail.
@BkSeq as Smallint,                       --Required if Updating or Deleting.
@Surname  as varchar(20),           --The Surname of the individual making the booking
@PinNo  as varchar(4),              --Not Used - set to blank
...



The @Action parameter is NOT being displayed as part of the stored procedure, but it is present when asked directly.

Other stored procedures seem to be muddled similarly.

Regards,

Richard Quadling.
[expired user #9072]'s profile image [expired user #9072] posted 9 years ago Permalink
Hi,

I can confirm the odd MS SQL stored procedure behavior. Looking at the routine body, it looks like the first couple of lines are missing, see attachment.

Regards,
Frans

1 attachment(s):
  • Capture001

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