I'm building a query in SQLFiddle using SQL Server 2008. This query is a procedure that selects information. I can't post the query itself, but I can post the Syntax surrounding the procedure:
CREATE PROCEDURE BusinessInfo
@Variable VarChar(10)
AS
BEGIN
SELECT Info.*
FROM Table Info
WHERE Info.PersonKey = @Variable
ORDER BY Info.LastName
END
GO
EXECUTE BusinessInfo '1'
GO
The problem is that no matter what I do, as soon as I put create procedure, it returns nothing. I even built the Procedure, said END GO and re-wrote the entire procedure query afterwards and it pulled back nothing, and then I deleted the Procedure and it pulled back the information I was looking for. What am I doing wrong?
If you need a working example, this will work on any Schema in SQLFiddle
CREATE PROCEDURE Sample
AS
BEGIN
SELECT 'Information'
END
GO
EXECUTE Sample
GO
Possible solutions:
1) Change to this (default terminator is semicolon): SqlFiddleDemo
2) Change query terminator using 4th button to GO and your example will work.
Your code after selecting GO as terminator
Based on documentation