unable to update multiple rows with sql query or trigger(URGENT)

S

sanju

Hi,

I have a table called Photos, where user will have 1 to 10 photos and only
one photo will set to be active at any given point of time.(i.e IsPermitted
='True' and remaining all photos set to false),
user will have an option to make another photo as active.

when this happens newly selected photo should be set to 'True' and rest of
the photos to 'False'

when i am trying to do this using Sql trigger i am getting an error as
follows.

System.Data.SqlClient.SqlException: Subquery returned more than 1 value.
This is not permitted when the subquery follows =, !=, <, <= , >, >= or when
the subquery is used as an expression. The statement has been terminated.

Is there any way to fire the trigger before updating the row with stored
proc.


Any help is much appreciated


Thanks
Sanju
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top