A Domain Error Occurred
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies domain error occurred sybase of this site About Us Learn more about Stack Overflow the company
A Domain Error Occurred Sql
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges a domain controller for the domain cannot be contacted Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:
Sql Server A Domain Error Occurred
Sign up How to fix “domain error” in SQL Server 2005 when using LOG() function to get product of set up vote 1 down vote favorite I have a inline select statement to calculate the product of the set of values. Since SQL Server 2005 doesn't have a built in Product aggregate function, I am using LOG/EXP to get it. My select a domain error occurred sql server 2005 statement is: (select exp(sum(log(value))) from table where value > 0) Unfortunately I keep getting the following error: Msg 3623, Level 16, State 1, Line 1 A domain error occurred. I've ensured that none of the values are zero or negative so I'm not really sure why this error is occurring. Does anyone have any ideas? sql-server sql-server-2005 tsql share|improve this question asked Oct 14 '09 at 5:27 user189600 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote accepted One of the features of the query planner introduced in SQL 2005 is that, in some circumstances where the table statistics indicate it will be more efficient, the WHERE clause of a statement will be processed after the SELECT clause. (I can't find the Books On-Line reference for this right now). I suspect this is what is happening here. You either need to exclude the rows where value = 0 before carrying out the calculation - the most reliable way being to store the rows you need in a temporary (#) table - or to modify your query to handle zero int
I am running a query that takes the cross product of a table against itself and uses some trigonometry functions to determine the distance between all
System Data Sqlclient Sqlexception A Domain Error Occurred
the values. The cross product works but when I introduce the trig function
Error Occurred Attempting To Join The Domain
only part of the result set comes back. No error is reported only a very non-descriptive message: A domain error error occurred attempting to join the domain specified account already exists occurred. Has anyone ever seen this before? I have not been able to find any information on it web. Here is a query that tes the error I am getting using the http://stackoverflow.com/questions/1564405/how-to-fix-domain-error-in-sql-server-2005-when-using-log-function-to-get-pr Northwind database: Select o1.OrderID, o2.OrderID, foo = ACOS( COS(o1.OrderID) ... Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode August 21st,05:51 PM #1 ??? Domain Error Occurred ??? I am running a query that takes the cross product of a table against itself and uses some trigonometry functions to determine the distance http://www.justskins.com/forums/domain-error-occurred-302471.html between all the values. The cross product works but when I introduce the trig function only part of the result set comes back. No error is reported only a very non-descriptive message: A domain error occurred. Has anyone ever seen this before? I have not been able to find any information on it web. Here is a query that tes the error I am getting using the Northwind database: Select o1.OrderID, o2.OrderID, foo = ACOS( COS(o1.OrderID) * COS(o2.OrderID) + SIN(o1.OrderID) * SIN(o2.OrderID) ) From Orders o1 Cross Join Orders o2 Thanks for taking a look. -Scott Scott Guest August 21st,05:59 PM #2 Re: ??? Domain Error Occurred ??? I get the same thing on 2000 SP3 (760). I'll see what I can do to report it... "Scott Archibald"
up Recent PostsRecent Posts Popular TopicsPopular Topics Home Search Members Calendar Who's On Home http://www.sqlservercentral.com/Forums/Topic1444977-149-1.aspx » SQL Server 2005 » SQL Server 2005 General Discussion » A domain error occurred in Sql server 2005... A domain error occurred in Sql server 2005 while updating the data Rate Topic Display Mode Topic Options Author Message roshan.nc 74309roshan.nc 74309 Posted Monday, April 22, 2013 7:21 AM Grasshopper Group: General Forum Members Last Login: Monday, September 21, 2015 error occurred 1:05 AM Points: 14, Visits: 47 I have created a function like the one belowCreate FUNCTION fn_Calc(@Lat1 Float, @Lng1 Float, @Lat2 Float, @Lng2 Float)RETURNS FloatASBEGINDeclare @x as FloatDeclare @y as FloatDeclare @Distance as FloatSelect @x = (SIN(RADIANS(@Lat1)) * SIN(RADIANS(@Lat2)) + COS(RADIANS(@Lat1)) * COS(RADIANS(@Lat2)) * COS(ABS((RADIANS(@Lng2)) - (RADIANS(@Lng1)))))Select @y = ATAN((SQRT(1-(POWER(@x,2))) / @x))Select @Distance = (1.852 * 60.0 * ((@y / domain error occurred PI()) * 180)) / 1.609344RETURN @DistanceENDI am using the above function to update a column in a table like below:Update test set calc = dbo.fn_Calc( cast(Lat as float), cast(Long as float), dblLat, dblLong) While running the above query I got the error."A domain error occured."What can be causing this error?Thanks,Roshan. N Post #1444977 wolfkilljwolfkillj Posted Tuesday, April 23, 2013 10:26 AM Ten Centuries Group: General Forum Members Last Login: Monday, August 24, 2015 12:20 PM Points: 1,064, Visits: 2,582 I had this problem once before, but I was using a slightly different formula for calculating distances between lat/long pairs. Unfortunately, I no longer work for my employer at the time and don't have the notes I made of this issue to be more specific, so I only vaguely recollect the circumstances. IIRC, I discovered that there were certain input values that would cause the T-SQL COS function to return results just slightly outside the -1 < x < 1 range. This cascaded through the calculation and resulted in an input to the ACOS function that also fell outside the