Ads were blocked by your webbrowser.

This is not a problem, but keep in mind that developing HeidiSQL, user support and hosting takes time and money.

You may want to send a donation instead.

Create Stored Procedures for MS SQL Server

HamptonNorth's profile image HamptonNorth posted 4 years ago in General
Hi
Using Microsoft SQL Server 2014 and Heidi 9.3.0.4999 right click and 'create stored routine'

Heidi generates following code:

CREATE PROCEDURE "test"(IN "@MyLimit" INT)
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
SELECT * FROM Country ORDER BY CountryID OFFSET 0 ROWS
FETCH NEXT @MyLimit ROWS ONLY
END


This cannot be saved. Correct code should be:

DELIMITER //
CREATE PROCEDURE clipdogTest2
(
@MyLimit INT
)
AS
BEGIN
SELECT * FROM Country ORDER BY CountryID OFFSET 0 ROWS
FETCH NEXT @MyLimit ROWS ONLY  
END//
DELIMITER ;


Is there some way to change the 'snippets' used in create procedure?
ansgar's profile image ansgar posted 4 years ago
No, I have to adjust the resulting CREATE code for each database system. The procedure editor has most of its features for MySQL. But I guess with the above code snippet I can solve that for MSSQL, at least for the exact case.
HamptonNorth's profile image HamptonNorth posted 4 years ago
Great response

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