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)
DECLARE @query_a AS nvarchar (500)
SET @query_a =
SELECT TOP 10 * FROM dbo+@tablename
EXECUTE sp_executesql @query_a
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.