You are here: Re: Hey I've got a homework problem I'm working on and am stumped. « MsSQL Server « IT news, forums, messages
Re: Hey I've got a homework problem I'm working on and am stumped.

Posted by Erland Sommarskog on 08/10/06 21:50

Nep Tune (neptuneca@go.com) writes:
> It goes like the following:
> 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.
>
> A. Execute your stored procedure to show that the insert logic works.
> B. Execute your stored procedure to show that the update logic works.
>
> Any hints from the wizards out there would be greatly appreciated!

If you are not able to carry out your homework assignments, you should
talk to the teacher, rather than sneak behind his back. Your teacher
knows what you are supposed to know, and what you yet have to learn.

But permit me to not that the parameters to the procedure should really
be nvarchar(50) and not varchar(50) to go along with the table definition.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация