Posted By

thomasvdb on 09/23/09


Tagged

select update


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


SQL UPDATE SELECT


 / Published in: SQL
 

  1. CREATE PROCEDURE [dbo].[aStoredProcedure]
  2. @param1 AS NVARCHAR(4),
  3. @param2 AS NVARCHAR(4),
  4. @param3 AS DATETIME
  5. AS
  6. BEGIN
  7. SET NOCOUNT ON;
  8.  
  9. INSERT INTO
  10. ACommonTable
  11. (
  12. param1, param2, param3, otherfield1, otherfield2, otherfield3
  13. )
  14. SELECT
  15. @param1, @param2, @param3,
  16. sph.otherfield1, sph.otherfield2, sph.otherfield3
  17. FROM
  18. AnotherTable AS sph
  19. WHERE
  20. sph.otherfield4 = @param1;

Report this snippet  

You need to login to post a comment.