Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Wednesday, March 21, 2012

number of errorlogs in mssql 7.0

hi,
Is there any setting in mssql 7.0 to change the number of
sqlserver error logs from the default value of 6?
I know for sure - we can change a registry setting for
mssql2000. IS there anything for mssql7.0?
regards,
bharathbharath wrote:
> hi,
> Is there any setting in mssql 7.0 to change the number of
> sqlserver error logs from the default value of 6?
> I know for sure - we can change a registry setting for
> mssql2000. IS there anything for mssql7.0?
> regards,
> bharath
You need to change the registry entry:
HKLM\SOFTWARE\Microsoft\MSSQLServer\MSSQ
LServer
DWORD NumErrorLogs = <xx>
(answered previously by Neil Pike, MVP)
http://groups.google.pl/groups?hl=p...&rnu
m=4
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.sql

Monday, March 19, 2012

Number limit of table columns in transactional replication

I was setting up transactional replication for a big table and got the
following error message:
The article cannot be created on table 'TEST' because it has more than 255
columns
Is that the limit of replication in SQL Server 2000? If yes, Is there any
way to increase the limit, or it can be configured?
Thanks!
This is the limit and it isn't configurable . One possible solution is to
partition the table into smaller tables and replicate each one separately.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Monday, March 12, 2012

Number / description of sql error

Hi

All Sql Server errors have a number. Is there any MS or MSDN website or any .net method in which I can see these errors?

Thanks a lot

switch (error.Number)

{

case 17:

msgErro =...

break;

case 4060:

msgErro =...

break;

case 18456:

msgErro = ....

break;

default:

msgErro = exSql.Message;

break;

}

Roberot,

The SQL Server error codes are in SQL Server Books On-line, which is part of the documentation that's installed with SQL Server. You may try googling "SQL Server error codes" if you don't have access to the documentation.

Good luck

|||

Roberot:

Hi

All Sql Server errors have a number. Is there any MS or MSDN website or any .net method in which I can see these errors?

Thanks a lot

switch (error.Number)

{

case 17:

msgErro =...

break;

case 4060:

msgErro =...

break;

case 18456:

msgErro = ....

break;

default:

msgErro = exSql.Message;

break;

}

Try the link below to download the BOL(books online). Hope this helps.

http://www.microsoft.com/downloads/details.aspx?FamilyID=BE6A2C5D-00DF-4220-B133-29C1E0B6585F&displaylang=en

Friday, March 9, 2012

NullReferenceException: Object Reference not set

Hello,
I have a strange error. When I try to add a table to the reporting
services I sometimes get errors depending on the table. I have one table
that I can view fine, but the other one is giving me a ton of problems. The
problem occurs when I go to add the table. When I select the table that I
want, and I get the error NullReferenceException:Object reference not set.
They are both as/400 files and I can't see any big differences in them. Any
ideas?
Thanks,
BrianWould you like to provide more details?
What exactly are you doing and when this message being shown?
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian" <javelin@.amc.com> wrote in message
news:5FC5A491-D69E-47CF-ACD7-47518BDB560F@.microsoft.com...
> Hello,
> I have a strange error. When I try to add a table to the reporting
> services I sometimes get errors depending on the table. I have one table
> that I can view fine, but the other one is giving me a ton of problems.
> The
> problem occurs when I go to add the table. When I select the table that I
> want, and I get the error NullReferenceException:Object reference not set.
> They are both as/400 files and I can't see any big differences in them.
> Any
> ideas?
> Thanks,
> Brian|||I right click and say add table. As soon as add the table I get the error.
"Lev Semenets [MSFT]" wrote:
> Would you like to provide more details?
> What exactly are you doing and when this message being shown?
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Brian" <javelin@.amc.com> wrote in message
> news:5FC5A491-D69E-47CF-ACD7-47518BDB560F@.microsoft.com...
> > Hello,
> > I have a strange error. When I try to add a table to the reporting
> > services I sometimes get errors depending on the table. I have one table
> > that I can view fine, but the other one is giving me a ton of problems.
> > The
> > problem occurs when I go to add the table. When I select the table that I
> > want, and I get the error NullReferenceException:Object reference not set.
> > They are both as/400 files and I can't see any big differences in them.
> > Any
> > ideas?
> >
> > Thanks,
> > Brian
>
>|||AS/400 is not supported by Visual Studio query designer (see
http://support.microsoft.com/default.aspx?scid=kb;en-us;811241 )
Please try using our Generic Query Designer rather than the VS query
designer.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian" <javelin@.amc.com> wrote in message
news:AEDBA0E9-9231-453E-9342-1D844A917B22@.microsoft.com...
>I right click and say add table. As soon as add the table I get the error.
> "Lev Semenets [MSFT]" wrote:
>> Would you like to provide more details?
>> What exactly are you doing and when this message being shown?
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Brian" <javelin@.amc.com> wrote in message
>> news:5FC5A491-D69E-47CF-ACD7-47518BDB560F@.microsoft.com...
>> > Hello,
>> > I have a strange error. When I try to add a table to the reporting
>> > services I sometimes get errors depending on the table. I have one
>> > table
>> > that I can view fine, but the other one is giving me a ton of problems.
>> > The
>> > problem occurs when I go to add the table. When I select the table
>> > that I
>> > want, and I get the error NullReferenceException:Object reference not
>> > set.
>> > They are both as/400 files and I can't see any big differences in them.
>> > Any
>> > ideas?
>> >
>> > Thanks,
>> > Brian
>>|||What that means is that while the Visual Studio tool does not explicitly deny you from connecting to
and possibly even using other OLE-DB providers, they have done very little (if any) testing with
those providers and would generally not be willing to take bug fixes for any problems found therein.
In other words, if there are situations where it works, its luck rather than by design.
The GQD was written to help in these scenarios.
--
Thanks.
Donovan R. Smith
Software Test Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian" <javelin@.amc.com> wrote in message
news:502BF2D9-8401-4C97-A5A0-9F9AE3A97D54@.microsoft.com...
> If you can not use the as/400 how come I can connect to the other as/400
> file?
> "Lev Semenets [MSFT]" wrote:
> > AS/400 is not supported by Visual Studio query designer (see
> > http://support.microsoft.com/default.aspx?scid=kb;en-us;811241 )
> > Please try using our Generic Query Designer rather than the VS query
> > designer.
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> >
> > "Brian" <javelin@.amc.com> wrote in message
> > news:AEDBA0E9-9231-453E-9342-1D844A917B22@.microsoft.com...
> > >I right click and say add table. As soon as add the table I get the error.
> > >
> > > "Lev Semenets [MSFT]" wrote:
> > >
> > >> Would you like to provide more details?
> > >> What exactly are you doing and when this message being shown?
> > >>
> > >> --
> > >> This posting is provided "AS IS" with no warranties, and confers no
> > >> rights.
> > >>
> > >>
> > >> "Brian" <javelin@.amc.com> wrote in message
> > >> news:5FC5A491-D69E-47CF-ACD7-47518BDB560F@.microsoft.com...
> > >> > Hello,
> > >> > I have a strange error. When I try to add a table to the reporting
> > >> > services I sometimes get errors depending on the table. I have one
> > >> > table
> > >> > that I can view fine, but the other one is giving me a ton of problems.
> > >> > The
> > >> > problem occurs when I go to add the table. When I select the table
> > >> > that I
> > >> > want, and I get the error NullReferenceException:Object reference not
> > >> > set.
> > >> > They are both as/400 files and I can't see any big differences in them.
> > >> > Any
> > >> > ideas?
> > >> >
> > >> > Thanks,
> > >> > Brian
> > >>
> > >>
> > >>
> >
> >
> >|||I went to a msdn event and I was told by the microsoft guy that the reporting
services was made to work on any database, not just sql. It was supposed to
be MS's Crystal Reports. Am I understanding you correctly, are you saying
that this is not true?
Brian
"Donovan R. Smith [MSFT]" wrote:
> What that means is that while the Visual Studio tool does not explicitly deny you from connecting to
> and possibly even using other OLE-DB providers, they have done very little (if any) testing with
> those providers and would generally not be willing to take bug fixes for any problems found therein.
> In other words, if there are situations where it works, its luck rather than by design.
> The GQD was written to help in these scenarios.
> --
> Thanks.
> Donovan R. Smith
> Software Test Lead
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Brian" <javelin@.amc.com> wrote in message
> news:502BF2D9-8401-4C97-A5A0-9F9AE3A97D54@.microsoft.com...
> > If you can not use the as/400 how come I can connect to the other as/400
> > file?
> >
> > "Lev Semenets [MSFT]" wrote:
> >
> > > AS/400 is not supported by Visual Studio query designer (see
> > > http://support.microsoft.com/default.aspx?scid=kb;en-us;811241 )
> > > Please try using our Generic Query Designer rather than the VS query
> > > designer.
> > >
> > > --
> > > This posting is provided "AS IS" with no warranties, and confers no rights.
> > >
> > >
> > > "Brian" <javelin@.amc.com> wrote in message
> > > news:AEDBA0E9-9231-453E-9342-1D844A917B22@.microsoft.com...
> > > >I right click and say add table. As soon as add the table I get the error.
> > > >
> > > > "Lev Semenets [MSFT]" wrote:
> > > >
> > > >> Would you like to provide more details?
> > > >> What exactly are you doing and when this message being shown?
> > > >>
> > > >> --
> > > >> This posting is provided "AS IS" with no warranties, and confers no
> > > >> rights.
> > > >>
> > > >>
> > > >> "Brian" <javelin@.amc.com> wrote in message
> > > >> news:5FC5A491-D69E-47CF-ACD7-47518BDB560F@.microsoft.com...
> > > >> > Hello,
> > > >> > I have a strange error. When I try to add a table to the reporting
> > > >> > services I sometimes get errors depending on the table. I have one
> > > >> > table
> > > >> > that I can view fine, but the other one is giving me a ton of problems.
> > > >> > The
> > > >> > problem occurs when I go to add the table. When I select the table
> > > >> > that I
> > > >> > want, and I get the error NullReferenceException:Object reference not
> > > >> > set.
> > > >> > They are both as/400 files and I can't see any big differences in them.
> > > >> > Any
> > > >> > ideas?
> > > >> >
> > > >> > Thanks,
> > > >> > Brian
> > > >>
> > > >>
> > > >>
> > >
> > >
> > >
>
>|||Reporting Services certainly does work against AS/400 databases (and Terradata, Oracle, Informix,
MySql, etc...). In this particular case, the Visual Studio Visual Database Tool does not support
visually creating queries against an AS/400. We included this visual query designer since it made
some tasks easier but we also made sure that - in cases where it would not work - we provided an
alternative. That alternative is our Generic Query Designer. It does not provide some of the same
visuals but it does allow you to overcome the other designer's limitations.
Also, keep in mind that this only affects the way in which you design queries. It does not affect
how you design reports based on the results of your queries. Also, the server side of Reporting
Services is extremely flexible is not impacted by this Visual Studio limitations at all.
So what they told you is correct - it will work against any database, not just SQL Server.
--
Thanks.
Donovan R. Smith
Software Test Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian" <javelin@.amc.com> wrote in message
news:50DCDF13-0C11-4CC2-9026-F42E7FBBDF45@.microsoft.com...
> I went to a msdn event and I was told by the microsoft guy that the reporting
> services was made to work on any database, not just sql. It was supposed to
> be MS's Crystal Reports. Am I understanding you correctly, are you saying
> that this is not true?
> Brian
> "Donovan R. Smith [MSFT]" wrote:
> > What that means is that while the Visual Studio tool does not explicitly deny you from
connecting to
> > and possibly even using other OLE-DB providers, they have done very little (if any) testing with
> > those providers and would generally not be willing to take bug fixes for any problems found
therein.
> > In other words, if there are situations where it works, its luck rather than by design.
> >
> > The GQD was written to help in these scenarios.
> >
> > --
> > Thanks.
> >
> > Donovan R. Smith
> > Software Test Lead
> >
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> > "Brian" <javelin@.amc.com> wrote in message
> > news:502BF2D9-8401-4C97-A5A0-9F9AE3A97D54@.microsoft.com...
> > > If you can not use the as/400 how come I can connect to the other as/400
> > > file?
> > >
> > > "Lev Semenets [MSFT]" wrote:
> > >
> > > > AS/400 is not supported by Visual Studio query designer (see
> > > > http://support.microsoft.com/default.aspx?scid=kb;en-us;811241 )
> > > > Please try using our Generic Query Designer rather than the VS query
> > > > designer.
> > > >
> > > > --
> > > > This posting is provided "AS IS" with no warranties, and confers no rights.
> > > >
> > > >
> > > > "Brian" <javelin@.amc.com> wrote in message
> > > > news:AEDBA0E9-9231-453E-9342-1D844A917B22@.microsoft.com...
> > > > >I right click and say add table. As soon as add the table I get the error.
> > > > >
> > > > > "Lev Semenets [MSFT]" wrote:
> > > > >
> > > > >> Would you like to provide more details?
> > > > >> What exactly are you doing and when this message being shown?
> > > > >>
> > > > >> --
> > > > >> This posting is provided "AS IS" with no warranties, and confers no
> > > > >> rights.
> > > > >>
> > > > >>
> > > > >> "Brian" <javelin@.amc.com> wrote in message
> > > > >> news:5FC5A491-D69E-47CF-ACD7-47518BDB560F@.microsoft.com...
> > > > >> > Hello,
> > > > >> > I have a strange error. When I try to add a table to the reporting
> > > > >> > services I sometimes get errors depending on the table. I have one
> > > > >> > table
> > > > >> > that I can view fine, but the other one is giving me a ton of problems.
> > > > >> > The
> > > > >> > problem occurs when I go to add the table. When I select the table
> > > > >> > that I
> > > > >> > want, and I get the error NullReferenceException:Object reference not
> > > > >> > set.
> > > > >> > They are both as/400 files and I can't see any big differences in them.
> > > > >> > Any
> > > > >> > ideas?
> > > > >> >
> > > > >> > Thanks,
> > > > >> > Brian
> > > > >>
> > > > >>
> > > > >>
> > > >
> > > >
> > > >
> >
> >
> >

nullifying value from FOR XML EXPLICIT

In this query (using T-SQL, don't know about SQLXML) hello becomes NULL and an error is returned...
select 2 as tag, null as parent
,null as [ffffff:eeeeeeeeeeeeeee!2!bbbbbbbbbbbbbbbbbbbbbbbb !element]
,null as [ffffff:eeeeeeeeeeeeeee!2!cccccccccccccccccccccccc !element]
,null as [aaaaaaaaaaaaaaaaaaaaaaa!19]
union all
select 19 as tag, 2 as parent
,null as [ffffff:eeeeeeeeeeeeeee!2!bbbbbbbbbbbbbbbbbbbbbbbb !element]
,null as [ffffff:eeeeeeeeeeeeeee!2!cccccccccccccccccccccccc !element]
,'hello' as [aaaaaaaaaaaaaaaaaaaaaaa!19]
for xml explicit
But change just about anything (make it xml auto, add or remove a few chars, change the 2 to a 12 or the 19 to either a 9 or a 190...) and it will work fine.
Anyone know what gives? Seems to be related to string lengths... Our workaround is to start tag ID's at >100 but does that mean some other combination will flake out?
Cheers...
John
Try changing alias [aaaaaaaaaaaaaaaaaaaaaaa!19] to
[aaaaaaaaaaaaaaaaaaaaaaa!19!] - there's a known bug in FOR XML EXPLICIT
code.
Best regards,
Eugene
This posting is provided "AS IS" with no warranties, and confers no rights.
"John Nowak" <anonymous@.discussions.microsoft.com> wrote in message
news:08168845-CD3E-47DD-A4A9-686AF2B2525F@.microsoft.com...
> In this query (using T-SQL, don't know about SQLXML) hello becomes NULL
and an error is returned...
> select 2 as tag, null as parent
> ,null as [ffffff:eeeeeeeeeeeeeee!2!bbbbbbbbbbbbbbbbbbbbbbbb !element]
> ,null as [ffffff:eeeeeeeeeeeeeee!2!cccccccccccccccccccccccc !element]
> ,null as [aaaaaaaaaaaaaaaaaaaaaaa!19]
> union all
> select 19 as tag, 2 as parent
> ,null as [ffffff:eeeeeeeeeeeeeee!2!bbbbbbbbbbbbbbbbbbbbbbbb !element]
> ,null as [ffffff:eeeeeeeeeeeeeee!2!cccccccccccccccccccccccc !element]
> ,'hello' as [aaaaaaaaaaaaaaaaaaaaaaa!19]
> for xml explicit
> But change just about anything (make it xml auto, add or remove a few
chars, change the 2 to a 12 or the 19 to either a 9 or a 190...) and it
will work fine.
> Anyone know what gives? Seems to be related to string lengths... Our
workaround is to start tag ID's at >100 but does that mean some other
combination will flake out?
> Cheers...
> John

Monday, February 20, 2012

null login error

ok Here is the picture:
I have a consultant that is VPNing to our network and has no trouble getting
in.
He can then remote into a server that has SQL client tools on it. But when
he tries to register a SQL Server that he is db creator on in Ent Manager, h
e
gets the null loign errorOn Jun 13, 9:30 pm, DBA <D...@.discussions.microsoft.com> wrote:
> ok Here is the picture:
> I have a consultant that is VPNing to our network and has no trouble getti
ng
> in.
> He can then remote into a server that has SQL client tools on it. But when
> he tries to register a SQL Server that he is db creator on in Ent Manager,
he
> gets the null loign error
You need to create a login and databse user for the consultant in SQL
Server

Null Error

Data Source: Oracle 10g R2
Data DestinationTongue TiedQL Server 2000

The date data in Oracle is stored as Number. i.e. yyyymmdd
So I am moving the date data from Number(8,0) to datetime field. I using script component to convert the data to mm/dd/yyyy.
When there is no data at the source I do not want to populate the destination datetime column. I want to keep it as Null.
So ....
My script looks like this....

if SourceData.Length = 8 then
Populate the destination data
end if
I am getting error when I hit the row which does not have date data.
How to solve the above problem.
Thank you,
Smith

Instead of setting a value, you can set MyColumn_IsNull property to True.
|||

Thank you, Jay.

Smith

Null Error

The following query results in the below error msg, althoug it worked just a
few days earlier and the data hasn't changed since then(notice the date
range). Can someone put me on the right track?
SELECT AVG(Arrival_to_Closed_numeric_seconds) AS 'Q115c- Average Time
Arrival to Clear'
FROM [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
WHERE (Create_time BETWEEN '10/01/04' AND '09/30/05')
Warning: Null value is eliminated by an aggregate or other SET operation.
Server: Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type int.Is your date type for field Arrival_to_Closed_numeric_seconds a number? You
may have nulls in that column for some of the records. You can try casting
them or set the null to zero prior to this query.
"Dave S." <davidstedman@.colliergov.net> wrote in message
news:eQPYCgnJGHA.2012@.TK2MSFTNGP14.phx.gbl...
> The following query results in the below error msg, althoug it worked just
> a
> few days earlier and the data hasn't changed since then(notice the date
> range). Can someone put me on the right track?
> SELECT AVG(Arrival_to_Closed_numeric_seconds) AS 'Q115c- Average Time
> Arrival to Clear'
> FROM [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
> WHERE (Create_time BETWEEN '10/01/04' AND '09/30/05')
>
> Warning: Null value is eliminated by an aggregate or other SET operation.
> Server: Msg 8115, Level 16, State 2, Line 1
> Arithmetic overflow error converting expression to data type int.
>|||Casting? I think I got it confuse with MySQL. I meant VAL() so you can try
SELECT AVG(val('' & Arrival_to_Closed_numeric_seconds)) AS 'Q115c-
Average Time
Arrival to Clear'
FROM [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
WHERE (Create_time BETWEEN '10/01/04' AND '09/30/05')
UNTESTED..................
"Grant" <email@.nowhere.com> wrote in message
news:uiUg%23qnJGHA.3492@.TK2MSFTNGP09.phx.gbl...
> Is your date type for field Arrival_to_Closed_numeric_seconds a number?
> You may have nulls in that column for some of the records. You can try
> casting them or set the null to zero prior to this query.
> "Dave S." <davidstedman@.colliergov.net> wrote in message
> news:eQPYCgnJGHA.2012@.TK2MSFTNGP14.phx.gbl...
>|||Don't be too certain that the data has not changed. Time stamps are not
always updated as you might expect, and Create_time does not logically
correspond to the last time a value was modified.
I would bet if you select the data you will find nulls in there...
select Arrival_to_Closed_numeric_seconds, Create_time
from [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
where Arrival_to_Closed_numeric_seconds is null
"Dave S." <davidstedman@.colliergov.net> wrote in message
news:eQPYCgnJGHA.2012@.TK2MSFTNGP14.phx.gbl...
> The following query results in the below error msg, althoug it worked just
a
> few days earlier and the data hasn't changed since then(notice the date
> range). Can someone put me on the right track?
> SELECT AVG(Arrival_to_Closed_numeric_seconds) AS 'Q115c- Average Time
> Arrival to Clear'
> FROM [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
> WHERE (Create_time BETWEEN '10/01/04' AND '09/30/05')
>
> Warning: Null value is eliminated by an aggregate or other SET operation.
> Server: Msg 8115, Level 16, State 2, Line 1
> Arithmetic overflow error converting expression to data type int.
>|||Create time corresponds to the time a 911 dispatcher took the call, so it
should not change legally. I did some experimenting and found that if I run
this on a smaller date range it works. A that point I thought same as you
that a single or small group of records was messing me up, but this turned
out to be not true since I could move the interval of 5 months or so up and
down the calendar with the same results when I should ahve been able to pin
it down...unless it takes more than one null to mess it up...will try VAL in
any case though.
ds
"Jim Underwood" <james.underwoodATfallonclinic.com> wrote in message
news:%23VdaqRoJGHA.1368@.TK2MSFTNGP10.phx.gbl...
> Don't be too certain that the data has not changed. Time stamps are not
> always updated as you might expect, and Create_time does not logically
> correspond to the last time a value was modified.
> I would bet if you select the data you will find nulls in there...
> select Arrival_to_Closed_numeric_seconds, Create_time
> from [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
> where Arrival_to_Closed_numeric_seconds is null
> "Dave S." <davidstedman@.colliergov.net> wrote in message
> news:eQPYCgnJGHA.2012@.TK2MSFTNGP14.phx.gbl...
just
> a
Time
operation.
>|||Is val a valid function for SQL2k? Can't find a mention in help.
"Grant" <email@.nowhere.com> wrote in message
news:eKbM8LoJGHA.3856@.TK2MSFTNGP12.phx.gbl...
> Casting? I think I got it confuse with MySQL. I meant VAL() so you can try
> SELECT AVG(val('' & Arrival_to_Closed_numeric_seconds)) AS 'Q115c-
> Average Time
> Arrival to Clear'
> FROM [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
> WHERE (Create_time BETWEEN '10/01/04' AND '09/30/05')
> UNTESTED..................
> "Grant" <email@.nowhere.com> wrote in message
> news:uiUg%23qnJGHA.3492@.TK2MSFTNGP09.phx.gbl...
Time
operation.
>|||Dave,
I guess you are not concerned about the warning (with respect to NULLs).
The NULLs are not causing the error.
The error clearly shows that the selected data set has changed. What SQL
Server will do is add up all Arrival_to_Closed_numeric_seconds values
and finally divide this by the number of rows.
If the sum exceeds the outer limit of the data type (in this case
2,147,483,647), an overflow will occur. This is probably happening here.
It also explains why the query works if you limit the date range.
One way around this, is to case the Arrival_to_Closed_numeric_seconds
value to a different data type, such as bigint or decimal.
Gert-Jan
"Dave S." wrote:
> The following query results in the below error msg, althoug it worked just
a
> few days earlier and the data hasn't changed since then(notice the date
> range). Can someone put me on the right track?
> SELECT AVG(Arrival_to_Closed_numeric_seconds) AS 'Q115c- Average Time
> Arrival to Clear'
> FROM [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
> WHERE (Create_time BETWEEN '10/01/04' AND '09/30/05')
> Warning: Null value is eliminated by an aggregate or other SET operation.
> Server: Msg 8115, Level 16, State 2, Line 1
> Arithmetic overflow error converting expression to data type int.|||I ran this ( looking for the sum to see what the total was and if it was
greater than 2b):
SELECT cast(sum(Create_to_closed_numeric_second
s) AS decimal(20,2))
FROM [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
WHERE (Create_time BETWEEN '10/01/04' AND '09/30/05')
and I still got this
Server: Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type int.
I also verified by shortening a day at a time that the total sum before it
starts behaving like this is just over 40787180 ( it crashing after that and
the next day adds only 219649 more)
ds
"Gert-Jan Strik" <sorry@.toomuchspamalready.nl> wrote in message
news:43DFBEBD.69510FCF@.toomuchspamalready.nl...
> Dave,
> I guess you are not concerned about the warning (with respect to NULLs).
> The NULLs are not causing the error.
> The error clearly shows that the selected data set has changed. What SQL
> Server will do is add up all Arrival_to_Closed_numeric_seconds values
> and finally divide this by the number of rows.
> If the sum exceeds the outer limit of the data type (in this case
> 2,147,483,647), an overflow will occur. This is probably happening here.
> It also explains why the query works if you limit the date range.
> One way around this, is to case the Arrival_to_Closed_numeric_seconds
> value to a different data type, such as bigint or decimal.
> Gert-Jan
>
> "Dave S." wrote:
just a
Time
operation.|||Try casting the data before you sum it, rather than after...
SELECT sum(cast(Create_to_closed_numeric_second
s AS decimal(20,2)))
FROM [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
WHERE (Create_time BETWEEN '10/01/04' AND '09/30/05')
"Dave S." <davidstedman@.colliergov.net> wrote in message
news:%236I%23Hv2JGHA.2828@.TK2MSFTNGP12.phx.gbl...
> I ran this ( looking for the sum to see what the total was and if it was
> greater than 2b):
> SELECT cast(sum(Create_to_closed_numeric_second
s) AS decimal(20,2))
> FROM [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
> WHERE (Create_time BETWEEN '10/01/04' AND '09/30/05')
> and I still got this
> Server: Msg 8115, Level 16, State 2, Line 1
> Arithmetic overflow error converting expression to data type int.
> I also verified by shortening a day at a time that the total sum before it
> starts behaving like this is just over 40787180 ( it crashing after that
and
> the next day adds only 219649 more)
> ds
>
>
>
> "Gert-Jan Strik" <sorry@.toomuchspamalready.nl> wrote in message
> news:43DFBEBD.69510FCF@.toomuchspamalready.nl...
> just a
date
> Time
> operation.
>|||Xref: TK2MSFTNGP08.phx.gbl microsoft.public.sqlserver.programming:581752
Dave,
You need to cast the value to a bigger data type before the SUM (or
AVG). Try this:
SELECT sum(cast(Create_to_closed_numeric_second
s AS decimal(20,2)))
FROM [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
WHERE (Create_time BETWEEN '10/01/04' AND '09/30/05')
Gert-Jan
"Dave S." wrote:
> I ran this ( looking for the sum to see what the total was and if it was
> greater than 2b):
> SELECT cast(sum(Create_to_closed_numeric_second
s) AS decimal(20,2))
> FROM [27.0.3.63].UDT4.dbo.v_Incident_TimesMedical
> WHERE (Create_time BETWEEN '10/01/04' AND '09/30/05')
> and I still got this
> Server: Msg 8115, Level 16, State 2, Line 1
> Arithmetic overflow error converting expression to data type int.
> I also verified by shortening a day at a time that the total sum before it
> starts behaving like this is just over 40787180 ( it crashing after that a
nd
> the next day adds only 219649 more)
> ds
> "Gert-Jan Strik" <sorry@.toomuchspamalready.nl> wrote in message
> news:43DFBEBD.69510FCF@.toomuchspamalready.nl...
> just a
> Time
> operation.