1. You use a SqlClient class in a Finalize method or in a C# destructor.

2. You do not specify an explicit SQLDbType enumeration when you create a SqlParameter object. When you do not specify an explicit SQLDbType, the Microsoft .NET Framework Data Provider for SQL Server (SqlClient) tries to select the correct SQLDbType based on the data that is passed. SqlClient is not successful.

3. The size of the parameter that you explicitly specify in the .NET Framework code is more than the maximum size that you can use for the data type in Microsoft SQL Server.

None of these are true in my case. Are there any other reasons that can cause these problems..

Interesting enough, I put a raise error in SPROC right before and after the call to sp_addmerge thing and i discover that the error is definitely being generated when that line in sproc runs, before anything gets passed back to .NET...

So then i just get curious, and I run the sproc from query analyzer.... and it works fine, no error. So it does have something to do with .NET, but i don't know way around this.

BTW, the results of this error occurring when i run this, it does create a publication that i can see in Enterprise Manager, but when i try to start the snap shot that was created i get this error:

Error 14262: The specified @job_id('asdfsdfasdfasdfadsfasdfsadfa some long hex number') does not exist.

I hope that this reply aids those of you that have encountered the infamous “A severe error occurred command. The results, if any, should be discarded.” from System.Data.SqlCient in your .NET development.

I came across this same problem today and after a few hours was able to solve the issue.

In my application, I was calling an INSERT stored proc; which would then fire a TRIGGER on insert. This trigger’s job was to map to another server and perform a file move. The file move was done via Windows/DOS NET USE command.

NOTE: The stored proc was working just great until we inserted the TRIGGER logic.

The problem was that the user id used to perform the connection to the data store DID NOT have sufficient Windows privileges to perform NET USEs. And that my friends, was the cause of my “SEVERE ERROR”.

I am not sure if this may be the case in some of your cases, but hopefully it will guide you in the right direction into trying to examine what kind of privileges are needed for the task(s) performed by your TRIGGER.

For i As Int16 = 0 To 5000 'MAX OF TWO MINUTES, THEN EXIT REGARDLESS If i > 0 Then Threading.Thread.Sleep(25) If iarNIT IsNot Nothing AndAlso Not iarNIT.IsCompleted Then Continue For Exit For 'if we get here, exit Next i

Using sdr As New Core.SmartDataReader(scNIT.EndExecuteReader(iarNIT)) If sdr.Read() Then Me.NetworkItemType = Products.NetworkItemType.GetChild(sdr) End Using-----------------------

it errors out on the third to the last .NET line "Using sdr As New Core.SmartDataReader(scNIT.EndExecuteReader(iarNIT))" and I can not figure it out. Would corrupt data cause this? I looked at the ProductsNetworkItemTypes Table and the data looks good... so what am I missing?

Here is my error message:Event Type: ErrorEvent Source: capeventsEvent Category: NoneEvent ID: 0Date: 2/22/2008Time: 2:09:49 PMUser: N/AComputer: GRPOS2Description:A severe error occurred on the current command. The results, if any, should be discarded.A severe error occurred on the current command. The results, if any, should be discarded.

I encountered this error in a stored proc. Not seeing anything obvious and having covered all previously mentioned scenarios, on a hunch, I changed my stored proc to stop using a temp table and start using a table variable.

The proc created a temp table, inserted some rows, did some updates to the temp table and then returned the results as a query in the stored proc.

When I changed the temp storag from a temp table to a table variable, the error went away.

I can't necessarily explain it, but I can identify this as the change that eliminated the error.