DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Posts
    288

    SQL 2000; Delete Trigger

    SQL 2000 Server
    -------------------

    I have three tables connected by a parent-child relationship :a,b &c

    I have a trigger in table b with line:
    SET @lng_clientid = (SELECT lng_clientid FROM deleted)

    Through the Enterprises manager when I delete a record from table a, I get the following message:
    "Subquery returned more than one value"

    However, even though there are two records in b, it should delete one record at a time (in that way there is only one value for @lng_clientid ) and should not give that error; right?

    Why is this happening so?

  2. #2
    Join Date
    Jun 2006
    Posts
    4
    Its a table level trigger and not row level trigger. You should count the rows in deleted table (Select Count(*) from deleted) before process the table.

  3. #3
    Join Date
    Jun 2004
    Posts
    288
    Can we make a row level trigger? What is the difference between a table level and row level trigger?

  4. #4
    Join Date
    Jun 2006
    Posts
    4
    No, it is not possible in SQL Server 2000 or earlier. It is there with Oracle

Similar Threads

  1. find version & service packs
    By rperez in forum Database
    Replies: 5
    Last Post: 01-02-2009, 04:14 PM
  2. Call External Program from SQL Server 2000 Trigger
    By lagyossarian in forum Database
    Replies: 1
    Last Post: 04-06-2006, 02:43 PM
  3. Replies: 1
    Last Post: 08-13-2002, 01:58 PM
  4. Replies: 3
    Last Post: 01-29-2002, 09:58 AM
  5. Re - SQL 2000
    By Dan in forum Database
    Replies: 0
    Last Post: 12-06-2000, 07:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links