Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql 2005 Create SP disable error

Status
Not open for further replies.

gtjr921

Programmer
Aug 30, 2006
115
Is there a way to disable error checking when creating a Stored Procedure in SQL 2005 or when a particular SP is run?
I keep getting
Code:
 Operand type clash: varbinary(max) is incompatible with float

My SP exec another SP that changes the column type of the column from VarBin to VarChar. Then the SP i am trying to create then imports data to a table. The Stored Procedure doesn't realize that The column type will change and just wants to throw the error and not let me create it.

When I execute the syntax manually it works fine because then Sql realizes that the column type has been changed from varbin to varchar.
So is there a way to either turn off error checking within a particular stored procedure or in SQL all together. Prefer for it to be withing the individual SP.
I realize what I am doing may not be the best practice, but it is working out the best to do it this way for my situation.
Thanks
 
This error also comes up when I execute the SP from ASP.NET
SO it would probably be best if I could disable the error checking withing the SP itself
 
You aren't going to be able to disable the error checking.

If you are converting from varbin to varchar why is it saying that you can't convert from varbin to float? Sounds like somethings come funky here.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Because the data i am inserting is float
 
Conversition from varbinary to float isn't allowed.
Code:
select convert(float, convert(varbinary(16), convert(float, 13.234)))
produces
Error said:
[red]
Msg 529, Level 16, State 2, Line 1
Explicit conversion from data type varbinary to float is not allowed.
[/red]

However this does work.
Code:
select convert(numeric(12,4), convert(varbinary(16), convert(numeric(16,3), 13.234)))

What data type is the data before it's converted into the varbinary data type?

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top