[dba-VB] How unique are SQL Server error numbers?

jwcolby jwcolby at colbyconsulting.com
Thu Jan 21 07:58:41 CST 2010


I am calling stored procedures and passing back the error number and error string to my C# program. 
  I am doing things like "create field, create index" etc.  If I am trying to create a field and it 
already exists I get an error:

pErrorDesc	"Column names in each table must be unique. Column name 'AddrValid' in table 
'_DataDepotEmailNew.dbo.AZImportFrom' is specified more than once."

And

pErrorNo	"2705"

So my question is, can I count on a 2705 being this "column name must be unique"?  If so, in my C# 
program, I can count that as a successful field creation rather than a failure of the stored procedure.

ATM I am saying that a failure occurred and not performing the next step, whereas I really can do 
the next step (update that field).

TIA for your assistance.

-- 
John W. Colby
www.ColbyConsulting.com



More information about the dba-VB mailing list