MS SQL Server stored procedure meaning
Posted
by den-javamaniac
on Stack Overflow
See other posts from Stack Overflow
or by den-javamaniac
Published on 2010-05-21T18:39:38Z
Indexed on
2010/05/21
18:40 UTC
Read the original article
Hit count: 179
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.
© Stack Overflow or respective owner