473,396 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
Dec 18 '06 #1
0 1157

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tolga Yaramis via SQLMonster.com | last post by:
Hi All I have a question about generating dynmamicly If Update() statement in a trigger.. in My db, there is a table that holds some column names of an another table. for example; Columns...
8
by: Remove the obvious for replies | last post by:
I am using DB2 8.1.4 with SDE and Info Integrator. I am trying to create a trigger to populate a spatial table based on values from an attribute table. However, it appears to not recognize the CASE...
3
by: Arijit Chatterjee | last post by:
Dear All, I have written a query in Oracle.It is actually doing a running sum for a particular field.I am giving the query details =============================================================...
1
by: vidyayegnaraman | last post by:
Hi, I need to find out the time taken to insert a certain number of records into a table in oracle. The insertion was not a direct insert, rather it was done through an application functionality, so...
1
by: write2ashokkumar | last post by:
hi... i have the table like this, Table Name : sample Total Records : 500000 (Consider like this) Sample Records: id ------------ name
2
by: chandra131 | last post by:
Query used in cursor: DECLARE CURSOR2 CURSOR FOR SELECT TDET_DET_PAR_NBR ,TDET_SYS_ID ...
2
by: jith87 | last post by:
hi, how do you truncate a table inside a trigger(plsql) if the table size is more than 1000 records??? regards, jith
1
by: veerunrt | last post by:
Hi All, one column is having no of values separated by comma in the table that any one value should match with some other column of another table one value how to join in oracle I need result...
1
by: DineshGa | last post by:
hi all, i'm having the table like table: emp ------------------------------ empno ename deptno --------- ----------- --------- 101 aaa 10
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.