Return to Snippet

Revision: 18159
at September 23, 2009 04:40 by thomasvdb


Initial Code
CREATE PROCEDURE [dbo].[aStoredProcedure]
	@param1 AS NVARCHAR(4),
	@param2 AS NVARCHAR(4),
	@param3 AS DATETIME
AS
BEGIN
	SET NOCOUNT ON;

	INSERT INTO
		ACommonTable
		(
			param1, param2, param3, otherfield1, otherfield2, otherfield3
		)
		SELECT 
			@param1, @param2, @param3,
			sph.otherfield1, sph.otherfield2, sph.otherfield3
		FROM
			AnotherTable AS sph
		WHERE
			sph.otherfield4 = @param1;

Initial URL

                                

Initial Description

                                

Initial Title
SQL UPDATE SELECT

Initial Tags
update

Initial Language
SQL