Procedure conversion from MS SQL to HeidiSQL

saviomr's profile image saviomr posted 5 years ago in HeidiSQL portable Permalink

Hello guys,

I am new working with HeidiSQL databases and I have got an example code where it creates a procedure in SQL and I would like to create the same procedure on HeidiSQL. However I see that there are some differences is someone here that could explain to me how to convert this procedure.

See procedure code for Microsoft SQL below:

CREATE PROCEDURE [dbo].[Dynamic_Query]

@tablename AS VARCHAR(10)

AS

BEGIN DECLARE @query_a AS nvarchar (500) SET @query_a = SELECT TOP 10 * FROM dbo+@tablename EXECUTE sp_executesql @query_a

END

The main doubts that I have is how to declare the variable tablename',query_a` and the correspondent execute function on heidisql for sp_executsql.

Highly appreciate any thoughts guys.

Thank you very much.

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