Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3224082
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:10:54+00:00 2026-05-17T16:10:54+00:00

I am working on a project using SqlSiteMapProvider. I have two tables Articles and

  • 0

I am working on a project using SqlSiteMapProvider. I have two tables Articles and SiteMap

Articles table:

CREATE TABLE [dbuser].[Articles](
 [ArticleId] [uniqueidentifier] NOT NULL,
 [Title] [nvarchar](500) NULL,
 [Description] [ntext] NULL,
 [CategoryId] [int] NULL,
 [pubDate] [datetime] NULL,
 [Author] [nvarchar](255) NULL,
 [Hit] [int] NULL,
 [Auth] [bit] NULL
)...

And SiteMap Table:

CREATE TABLE [dbuser].[SiteMap](
 [ID] [int] IDENTITY(0,1) NOT NULL,
 [Title] [nvarchar](50) NULL,
 [Description] [nvarchar](512) NULL,
 [Url] [nvarchar](512) NULL,
 [Roles] [nvarchar](512) NULL,
 [Parent] [int] NULL,
 CONSTRAINT [PK_SiteMap] PRIMARY KEY CLUSTERED 
(...

When I insert an Article my asp.net page also inserts that articles url and such information into SiteMap table. What I am trying to do is when I delete an Article from my Articles table (from asp.net page) the related row from SiteMap table with a trigger.

My asp.net page inserts the Article info into Sitmap table in this format:

Dim SMUrl As String = "~/c.aspx?g=" & ddlCategoryId.SelectedValue & "&k=" & BaslikNo.ToString

I mean there is no one column exactly matchin in two tables.

My Trigger is as follows:

USE [MyDB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET NOCOUNT ON
GO
SET ROWCOUNT 1
GO
ALTER TRIGGER [dbuser].[trig_SiteMaptenSil] ON [dbuser].[Articles]
AFTER DELETE
AS
BEGIN
DECLARE  @AID UNIQUEIDENTIFIER, @ttl NVARCHAR,@CID INT
SELECT @AID=ArticleId, @ttl = Title, @CID=CategoryId  FROM DELETED
IF EXISTS(SELECT * FROM dbuser.SiteMap WHERE Url = N'~/c.aspx?g=' + CONVERT(nvarchar(5), @CID) + N'&k=' + CONVERT(nvarchar(36), @AID))
BEGIN
 DELETE FROM dbuser.SiteMap WHERE Url = N'~/c.aspx?g=' + CONVERT(nvarchar(5), @CID) + N'&k=' + CONVERT(nvarchar(36), @AID)
END
END
GO

I am using SSMSE 2008 and my remote db server’s version is 8.0

The Error I get is:

No rows were deleted.
A problem occurred attempting to delete row 1.
Error Source: Microsoft.VisualStudio.DataTools.
Error Message: The row value(s) updated or deleted either do not make the row unique or they alter multiple rows(2 rows).
Correct the errors and attempt to delete the row again or press ESC to cancel the change(s).

May you help me how to get this working? I have searched for this for about a few days.. Couldn’t find a solution for my case…

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:10:54+00:00Added an answer on May 17, 2026 at 4:10 pm

    To deal with the original issue and cope with deletions of multiple rows your trigger could be rewritten as follows.

    ALTER TRIGGER [dbuser].[trig_SiteMaptenSil] ON [dbuser].[Articles]
    AFTER DELETE
    AS
    BEGIN
     SET NOCOUNT ON
    
    DELETE
    FROM   s
    FROM   dbuser.SiteMap     AS s
           INNER JOIN Deleted AS d
           ON     s.Url = N'~/c.aspx?g=' + CONVERT(nvarchar(5), d.CategoryId) + N'&k=' 
                                         + CONVERT(nvarchar(36), d.ArticleId)
    
    END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on my 1st project using MS Unity IoC framework. If I have
I'm working on a project using Tkinter and Python. In order to have native
I have been working on the project where application is using grails 1.2.2.... Now
I'm working on a project using Windows 2008, .NET 3.5 and WCF for some
I am working on a project using rails 2.1.1. With the new release of
I am working on a project using Castle Active Record. I stumbled across the
I'm working on a project using C++, Boost, and Qt. I understand how to
Working in Eclipse on a Dynamic Web Project (using Tomcat (v5.5) as the app
I'm working on an ASP.NET project using MVP architecture. We would like to use
I am working on a Java project using Netbeans for the first time. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.