It has been a while since I created a Stored Procedure, is this the correct way. After selecting Create New Stored Procedure I proceded to do this:SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO-- =============================================-- Author: <Author,,Name>-- Create date: <Create Date,,>-- Description: <Description,,>-- =============================================CREATE PROCEDURE [dbo].[insertIntoQuin]-- Add the parameters for the stored procedure here-- Replace the variable type in this section with the type-- they actually are, I did not know the type so I made them all the same @Type1 varchar(50), @DateRaised varchar(50), @Status1 varchar(50), @Company varchar(50), @Address1 varchar(50), @Postcode varchar(50), @Support varchar(50), @TasksCompleted varchar(50), @HoursAllocated varchar(50), @HoursUsed varchar(50), @OverLim varchar(50), @HourlyRate varchar(50), @ExtendedCost varchar(50), @MonthlySupport varchar(50), @Vat varchar(50), @Total varchar(50), @qutask varchar(50), @qucost varchar(50)ASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements.SET NOCOUNT ON; -- Insert statements for procedure here -- Type, Status and Address are reserved words rename themINSERT INTO quin (Type1, DateRaised, Status1, Company, Address1, Postcode, Support, TasksCompleted, HoursAllocated, HoursUsed, OverLim, HourlyRate, ExtendedCost, MonthlySupport, Vat, Total, qutask, qucost)Values (@Type1, @DateRaised, @Status1, @Company, @Address1, @PostCode, @Support, @TasksCompleted, @HoursAllocated, @HoursUsed, @OverLim, @HourlyRate, @ExtendedCost, @MonthlySupport, @Vat, @Total, @qutask, @qucost)ENDGO
And ended up with this as a SPROC:USE [TestDataBase]-- name of database goes hereGO/****** Object: StoredProcedure [dbo].[insertIntoQuin] Script Date: 09/13/2009 16:29:36 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO-- =============================================-- Author: <Author,,Name>-- Create date: <Create Date,,>-- Description: <Description,,>-- =============================================ALTER PROCEDURE [dbo].[insertIntoQuin] -- Add the parameters for the stored procedure here @Type1 varchar(50), @DateRaised varchar(50), @Status1 varchar(50), @Company varchar(50), @Address1 varchar(50), @Postcode varchar(50), @Support varchar(50), @TasksCompleted varchar(50), @HoursAllocated varchar(50), @HoursUsed varchar(50), @OverLim varchar(50), @HourlyRate varchar(50), @ExtendedCost varchar(50), @MonthlySupport varchar(50), @Vat varchar(50), @Total varchar(50), @qutask varchar(50), @qucost varchar(50)ASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements.SET NOCOUNT ON; -- Insert statements for procedure here -- Type, Status and Address are reserved words rename themINSERT INTO quin (Type1, DateRaised, Status1, Company, Address1, Postcode, Support, TasksCompleted, HoursAllocated, HoursUsed, OverLim, HourlyRate, ExtendedCost, MonthlySupport, Vat, Total, qutask, qucost)Values (@Type1, @DateRaised, @Status1, @Company, @Address1, @PostCode, @Support, @TasksCompleted, @HoursAllocated, @HoursUsed, @OverLim, @HourlyRate, @ExtendedCost, @MonthlySupport, @Vat, @Total, @qutask, @qucost)END
I am just refreshing some rusty skills so the varaibles are all the same, that is not important. Shouldn't I be able to execute the SPORC by right clicking on it in the StoredProcedures folder or did I miss something?Thanks for the helpCoachBarker