SqlException

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I've got a script that sets up a publisher on a msde database. Runs fine
from Query Analyzer. I run it from my program and get two warnings (class
10 sqlExceptions). The second warning causes problems. When the script is
executed from the application the second warning occurs and the sql process
gets hung in a networkio wait type. When I step through the application, I
see the second warning occur, continue to step through and everything works
fine (no networkio wait type). I've tried inserting pauses, disposing of
the sqlCommand object and recreating it, closing and re-opening the
sqlConnection when these warnings occur but nothing seems to change the
networkio wait type when run from the application (not stepping through).
Anyone seen this before? Have any ideas what else I can try?

TIA,
Dave
 
I've narrowed the problem down to the sp_addpublication_snapshot stored
procedure. The second time it runs (it sets up both a snapshot and merge
publisher) it returns the warning and hangs only when run from the
application as the end user will be running it (as stated below).
 
You are being very vague about what these warning are - and why the second
warning causes a problem, if it's only a warning. Is there an error message?
How about showing us the contents of the script and how you are trying to
execute it?
 
The warnings I get back are -
"A server error occurred on the current command. The results, if any,
should be discarded."

The script is pretty big. It's executed by opening a text file, reading
line by line into a stringBuilder variable until a "GO" line is reached, the
contents of the stringBuilder are executed, cleared and continue reading the
file. It sets up a snapshot publication and a merge publication, and adds
the associated articles to each publication.

I've narrowed the problem down to the sp_addpublication_snapshot stored
procedure. The second time it runs it returns the warning and the
application hangs.
 
Back
Top