MS SQL Server stored procedure meaning
- by den-javamaniac
Hi. I'm developing a simple database architecture in VisualParadigm and lately ran over next code excerpt.
IF EXISTS (SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N'getType') AND type in (N'P', N'PC'))
DROP PROCEDURE getType;
Next goes my stored procedure:
CREATE PROCEDURE getType @typeId int
AS
SELECT * FROM type t WHERE t.type_id = @typeId;
Can anyone explain what does it mean?
P.S.: It would be great, if you may also check for any syntax errors as I'm totally new to MSSQL and stored procedures.