ADO.NET calling T-SQL Stored Procedure causes a SqlTimeoutException

Once I determined that it is the ADO.NET connection at the root of the problem, this thread led me to the answer. Basically connections through Sql Server Management Studio (SSMS) by default have SET ARITHABORT ON. ADO.NET connections do not. Setting ARITHABORT OFF and executing the query directly through SSMS gives me the same slow … Read more

SQL Server error “Implicit conversion of because the collation of the value is unresolved due to a collation conflict.”

You’d need COLLATE in both places most likely. Select City COLLATE DATABASE_DEFAULT AS Place, State, Country FROM DEPT1 UNION ALL Select ” COLLATE DATABASE_DEFAULT AS Place, ‘Arizona’ As State, Country FROM DEPT2 Edit: You may need it on every string if you get it in one places Select City COLLATE DATABASE_DEFAULT AS Place, State COLLATE … Read more

Calling Scalar-valued Functions in SQL

Are you sure it’s not a Table-Valued Function? The reason I ask: CREATE FUNCTION dbo.chk_mgr(@mgr VARCHAR(50)) RETURNS @mgr_table TABLE (mgr_name VARCHAR(50)) AS BEGIN INSERT @mgr_table (mgr_name) VALUES (‘pointy haired boss’) RETURN END GO SELECT dbo.chk_mgr(‘asdf’) GO Result: Msg 4121, Level 16, State 1, Line 1 Cannot find either column “dbo” or the user-defined function or … Read more