Click to See Complete Forum and Search --> : MS SSMSE - Creating Sprocs


WesTurrant
April 17th, 2007, 05:00 PM
I am using SSMSE to create my database and sprocs. I am use to Enterprise Manager. When I created a new sproc I received a template with a lot more code then I am use to with EM. I've tried to modify it with my sproc but I continue to get errors when I try to execute it. The errors come from the commented lines added by SSMSE.

I look at the book store but can't locate any good books on SSMSE. Can someone explain the difference to me.

Also when I try to save my sproc it wants to save it as a file and it doesnt appear that its included in the database in any way, so I have no idea how I would call it from SqlClient. I also cannot figure out how to test the sproc. In EM there was an option to "check syntax" before I saved.

What parts of this is garbage from the template, and which parts do I need. The sprocs seem to be a lot more complicated.


-- ================================================

-- Template generated from Template Explorer using:

-- Create Procedure (New Menu).SQL

--

-- Use the Specify Values for Template Parameters

-- command (Ctrl-Shift-M) to fill in the parameter

-- values below.

--

-- This block of comments will not be included in

-- the definition of the procedure.

-- ================================================

SETANSI_NULLSON

GO

SETQUOTED_IDENTIFIERON

GO

-- =============================================

-- Author: <Kenneth R. Jones>

-- Create date: <04/17/2007>

-- Description: <Insert Department Record>

-- =============================================

CREATEPROCEDURE<Procedure_Name,sysname, Procedu reName>

-- Add the parameters for the stored procedure here

<@Param1,sysname, @p1><Datatype_For_Param1,,int>=<Default_Value_For_Param1,, 0>,

<@Param2,sysname, @p2><Datatype_For_Param2,,int>=<Default_Value_For_Param2,, 0>

AS

BEGIN

-- SET NOCOUNT ON added to prevent extra result sets from

-- interfering with SELECT statements.

SETNOCOUNTON;

-- Insert statements for procedure here

SELECT<@Param1,sysname, @p1>,<@Param2,sysname, @p2>

END

GO