Tuesday, September 29, 2020

Buggish: C# SMO Error The name specified in the TextHeader property of StoredProcedure 'StoredProcedureName' must match Name property.

Error Message

The name specified in the TextHeader property of StoredProcedure 'spName' must match Name property. 


Results

None. I don't why this occurs.


Details

I created code to copy Stored Procedure from one server to another. This has worked have several weeks, and suddenly I have two SP that throws this error. The immediate cause is that the source TextHeader is different from its own name.

StoredProcedure spSource = dbSource.StoredProcedures[spName];


For some reason, spSource.Name is not the same as spSource.TextHeader.


I suspect the developer created the Stored Procedure then renamed it. This is not confirmed.


Edited 8/12/2021

Confirmed that this definitely occurs when a stored procedure is renamed. My fix is to use SSMS to get the alter stored procedure and execute as is. 

No comments:

Post a Comment