SQL Beginner

  •  

    Hi everyone,

    I'm a beginner with SQL Server 2005 and trying to complete a project with the following question, can someone please help?

    Use AdventureWorks database and HumanResources.Department table.

     

    Create a stored procedure called spDepartmentAddUpdate.  This procedure accepts two parameters: Name, and GroupName.  The data types are VarChar(50), and VarChar(50) respectively.  Define logic in this procedure to check for an existing Department record with the same Name.  If the department record exists, update the GroupName and ModifiedDate. Otherwise, insert a new department record.

     

    1. Execute your stored procedure to show that the insert logic works.
    2. Execute your stored procedure to show that the update logic works.

      Note:

     

    1.        DepartmentID is an identity column.

    2.        You may use GETDATE() to insert or update the modified date.

    Thanks in advance!

  • Please don't cross-post.  You already have a response in the other forum where this same message was posted.

    Francis

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply