Altaf Razzaque
Altaf Razzaque

Reputation: 152

Error when creating stored procedure SQL Server 2008 R2

i'am getting error on '{' and 'END'

CREATE PROCEDURE getLogsdata 
{
    @id int
}
AS
BEGIN

END

how to remove this errors

Upvotes: 0

Views: 22

Answers (1)

SqlZim
SqlZim

Reputation: 38023

Use parenthesis () instead of curly braces {}, and include some code in your procedure.

create procedure dbo.getLogsdata (@id int) as
  begin;
    set nocount on;

    select *
    from dbo.logs
    where id = @id;
  end;
go

Upvotes: 1

Related Questions