/ Published in: SQL
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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;