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)
 Intelligent SQL-UPDATE

Author  Topic 

joriveek
Starting Member

33 Posts

Posted - 2006-04-10 : 11:15:58
Hi Experts,

I am looking for an intelligent SQL UPDATE Statement in SQL Server

My problem is:

I have the table as follows:
===================
Description | Rate | Item
====================
I have three fields above in a table

I want to set Item to a value based on the WHERE search criteria of first two fields. None of them guarrantee uniqueness

Data Case 1)

Desc1 200
Desc2 200

In this case I need to set one row ITEM as Say 99.99 (suppose I can do this with UPDATE TOP(1) no problem

Data Case 2)

Desc1 200
Desc2 300

In this case I need to set all or some rows ITEM depends on the data arrive. I cannot use TOP(1) here because it could be all of them,

How can I deal with this situation?

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-04-10 : 11:18:09
a bit vague but try exploring instead of triggers or
you can validate and manipulate your data in your application before saving it into the table

HTH

--------------------
keeping it simple...
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-10 : 11:21:43
Can you explain what are you trying to achieve here. And also post more sample data with the required result with more explaination please ?



KH


Go to Top of Page
   

- Advertisement -