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

  • SEARCH
  • Home
  • 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 8665449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:29:00+00:00 2026-06-12T17:29:00+00:00

I have a SQL Server 2000 database with a stored procedure that deletes a

  • 0

I have a SQL Server 2000 database with a stored procedure that deletes a row from a specific table, given its id. When I call the stored procedure from VB.NET, it does not delete the row, but running the same script directly on the database via SSMS, it works.

Here’s my chain of events:

  1. Start SQL Server Profiler to watch all calls to the database. I have
    it setup to track when stored procedure starts, completes, and even
    on SQL statements start/complete within that stored procedure.
  2. Call stored procedure via VB.NET dll.
  3. Stop the profiler trace to avoid excessive data to dig through.
  4. Select from table, and see that the row still exists.
  5. View the profiler trace, which only shows RPC:Starting, SP:Starting, RPC:Completed. No inner statements are traced, which verifies why the row wasn’t deleted since the delete statement never fired.
  6. Copy/paste the EXEC call directly from the RPC:Starting trace entry from when it was called via VB.NET, into SQL Server Management Studio query window pointed to the same database with same credentials.
  7. Start profiler again.
  8. Execute EXEC statement from bullet 6 in SSMS.
  9. Stop profiler.
  10. Select from table, and see that the row GOT DELETED like it should.
  11. View the profiler trace, which shows SP:Starting, all statements starting/completed including the DELETE statement, and SP:Completed.

Why would running it via RPC make it not execute any of the statements in the proc, but running directly acts as it should?

EDIT: Below is my VB.NET code. This is the same code we use in over 100 other places:

Dim paramRowID As New SqlParameter("@RowID", sRowID)
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(oConn, "spDeleteRow", paramRowID)

See SqlHelper source here.

EDIT: I hate myself right now. 🙂 SQL threw an exception “nvarchar is incompatible with image” about another parameter that I was passing NULL to. SSMS didn’t worry about the type, but VB.NET did since I didn’t explicitly tell it that it was of type image. Once I defined that param, it worked. I wish profiler would have told me there was an error though.

Any help would be appreciated,

Greg

  • 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-06-12T17:29:01+00:00Added an answer on June 12, 2026 at 5:29 pm

    That would be because SSMS does not call an RPC but a batch. There is no way in fact to call a RPC from SSMS since you cannot declare a parameter, which is what differentiate an RPC call from a batch call in TDS:

    2.2.1.3 SQL Batch To send a SQL statement or a batch of SQL statements, the SQL batch, represented by a Unicode string, is copied into the data section of a TDS packet and then sent to the database server that supports SQL. A SQL batch may span more than one TDS packet. See section 2.2.6.6 for additional detail

    2.2.1.5 Remote Procedure Call To execute a remote procedure call (RPC) on the server, the client sends an RPC message data stream to the server. This is a binary stream that contains the RPC name or numeric identifier, options, and parameters. RPCs MUST be in a separate TDS message and not intermixed with SQL statements. There can be several RPCs in one message. See section 2.2.6.5 for additional details.

    So monitor instead for the SQL:BatchCompleted event and you’ll see your SSMS statement(s).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL Server 2000 database that will not display the column list
I have an old SQL Server 2000 database that I want to get into
In a legacy database (SQL Server 2000), we have a clustered index that looks
I have a database that is on a SQL 2000 server, and I would
I have address data stored in an sql server 2000 database, and I need
We have a Sql Server 2000 database application that needs to update our applications
I'm working on a stored procedure in SQL Server 2000 with a temp table
I have two Microsoft SQL Server 2000 databases, and a stored procedure on one
I have a SQL Server 2000 database with a column of type VARCHAR(255). All
I have a SQL Server 2000 database and I want to convert it to

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.