Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Check each cell in one table and update another table Expand / Collapse
Author
Message
Posted Thursday, May 16, 2013 8:22 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, July 16, 2014 8:33 AM
Points: 2,616, Visits: 4,720
adonetok (5/16/2013)
I do not know how to post real table but I did the same case using .net in application (create a dataset and then looping in dataset).
Now, I want to use store procedure to do it but I do not know how to do in SQL.


What is this table that you are talking about?
Is it some database table or some .NET structure?

The solution provided to you will work only for database tables.



Kingston Dhasian

How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1453577
Posted Friday, May 17, 2013 6:08 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, October 25, 2013 5:50 AM
Points: 47, Visits: 18
Below is a query for your requirment,



UPDATE ISCOLOR
SET ISCOLOR = CASE when COLOR.Blue IS NOT NULL OR COLOR.Red IS NOT NULL or COLOR.Yellow IS NOT NULL then 'Yes' else 'NO' END
FROM ISCOLOR INNER JOIN COLOR ON ISCOLOR.ID = COLOR.ID
Post #1453954
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse