Created
June 28, 2011 10:29
-
-
Save pellepim/1050865 to your computer and use it in GitHub Desktop.
Stored procedure for inserting a new activity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE [ppdbuser].[createActivityWithTitle] @project_id integer, @creator_id integer, @title varchar(255) | |
AS | |
INSERT INTO ppActivities (project_id, creator_id, title, local_id) | |
VALUES (@project_id, @creator_id, @title, (SELECT ISNULL(MAX(local_id)+1,1) FROM ppActivities WHERE project_id = @project_id)) | |
SELECT * FROM ppActivities WHERE id = scope_identity() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment