Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 please let me know the correct in the code

Author  Topic 

vijay85
Starting Member

1 Post

Posted - 2009-05-12 : 13:07:54
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO







ALTER PROC [dbo].[ISP_UpdateEMP]
@emp_name varchar(50),
@emp_id bigint,
@category varchar(50)
AS
BEGIN

SELECT @emp_name = emp_name
FROM emp with(nolock)
WHERE category = @category
UPDATE
emp
SET
emp_id = @emp_id
WHERE
emp_name = @emp_name AND
category = @category
END



Thanks & Regards
vijay

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-05-12 : 13:24:52
What is your question?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-05-12 : 13:33:55
The example above makes no sense.

1. You fetch the last name for a record with certain category
2. You are updating the same record (using last name and category) and change the empID?


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -