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

Friday, March 23, 2012

Performance Dashboard Reports Error

All,

I'm using the new Performance Dashboard Reports tool, and I'm getting an error when trying to view the main dashboard report. It is:

Error: Difference of two datetime columns caused overflow at runtime.

Has anyone seen this error before and know how to correct it?

Thanks,

Eric

Applied fix from this Blog, and it corrected the error.

http://blogs.msdn.com/sqlrem/archive/2007/03/07/Performance-Dashboard-Reports-Now-Available.aspx

Eric

sql

Performance Dashboard Errors

After installing Performance Dashboard, I receive the following variations of the following error message when I run reports :

The 'version_string' parameter is missing a value.

Anyone else seen this, and how did you fix the problem?

What is the service pack level on SQL Server?|||

I am getting the same error message

Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

|||

How are you trying to run the reports? You need to open performance_dashboard_main.rdl - that's the starting point. The reports are all subreports you access from the main dashboard report.

-Sue

|||

I am also getting the "error during processing of 'version_string' report" Error even though we have service pack 2 and the latest hotfix on our 32 bit clustered SQL 2005 server (current build 9.0.3054)

I can "remote desktop" to the server and run the "performance_dashboard_main.rdl" in a local SSMS "custom report" view but when I start SSMS on my local workstation with full admin rights on the server, opening "Custom reports" and pointing to a shared network directory OR my local "D:\Program Files\Microsoft SQL Server\90\Tools\PerformanceDashboard" directory containing all the RDL files and I get the above error.

The session I connect to SQL server with has full admin rights and I can do all my normal SSMS activities with no problems .. except run the performance dashboard.

Many thanks for any suggestions on this one.

John

|||

Any resolution on this?

Thanks

|||

Still nothing and even Google doesnt seem to have much of any use.

Its a real pity as I can see it would be useful to have the performance dashboard working.

|||

I have a "Fix" for this one though I dont yet know teh consequence of it fully. Since the "version_string" was coming back with an invalid value I decided to see if I could either out in a valid version string or get rid of it completely.

The performance_dashboard_main.rdl is a XML file so I searched for and found

<ReportParameter Name="version_string">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>="1.0 (" + FormatDateTime(CDate("Jan 9, 2007")) + ")"</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>version_string</Prompt>
<Hidden>true</Hidden>
</ReportParameter>

which I changed to several different values (as a new filename) until I just removed it as below

<ReportParameter Name="version_string">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>=""</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>version_string</Prompt>
<Hidden>true</Hidden>
</ReportParameter>

and the renamed rdl file "performance_dashboard_new_main.rdl" seems to work.

Performance Dashboard Errors

After installing Performance Dashboard, I receive the following variations of the following error message when I run reports :

The 'version_string' parameter is missing a value.

Anyone else seen this, and how did you fix the problem?

What is the service pack level on SQL Server?|||

I am getting the same error message

Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

|||

How are you trying to run the reports? You need to open performance_dashboard_main.rdl - that's the starting point. The reports are all subreports you access from the main dashboard report.

-Sue

|||

I am also getting the "error during processing of 'version_string' report" Error even though we have service pack 2 and the latest hotfix on our 32 bit clustered SQL 2005 server (current build 9.0.3054)

I can "remote desktop" to the server and run the "performance_dashboard_main.rdl" in a local SSMS "custom report" view but when I start SSMS on my local workstation with full admin rights on the server, opening "Custom reports" and pointing to a shared network directory OR my local "D:\Program Files\Microsoft SQL Server\90\Tools\PerformanceDashboard" directory containing all the RDL files and I get the above error.

The session I connect to SQL server with has full admin rights and I can do all my normal SSMS activities with no problems .. except run the performance dashboard.

Many thanks for any suggestions on this one.

John

|||

Any resolution on this?

Thanks

|||

Still nothing and even Google doesnt seem to have much of any use.

Its a real pity as I can see it would be useful to have the performance dashboard working.

|||

I have a "Fix" for this one though I dont yet know teh consequence of it fully. Since the "version_string" was coming back with an invalid value I decided to see if I could either out in a valid version string or get rid of it completely.

The performance_dashboard_main.rdl is a XML file so I searched for and found

<ReportParameter Name="version_string">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>="1.0 (" + FormatDateTime(CDate("Jan 9, 2007")) + ")"</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>version_string</Prompt>
<Hidden>true</Hidden>
</ReportParameter>

which I changed to several different values (as a new filename) until I just removed it as below

<ReportParameter Name="version_string">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>=""</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>version_string</Prompt>
<Hidden>true</Hidden>
</ReportParameter>

and the renamed rdl file "performance_dashboard_new_main.rdl" seems to work.

Performance Dashboard Errors

After installing Performance Dashboard, I receive the following variations of the following error message when I run reports :

The 'version_string' parameter is missing a value.

Anyone else seen this, and how did you fix the problem?

What is the service pack level on SQL Server?|||

I am getting the same error message

Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

|||

How are you trying to run the reports? You need to open performance_dashboard_main.rdl - that's the starting point. The reports are all subreports you access from the main dashboard report.

-Sue

|||

I am also getting the "error during processing of 'version_string' report" Error even though we have service pack 2 and the latest hotfix on our 32 bit clustered SQL 2005 server (current build 9.0.3054)

I can "remote desktop" to the server and run the "performance_dashboard_main.rdl" in a local SSMS "custom report" view but when I start SSMS on my local workstation with full admin rights on the server, opening "Custom reports" and pointing to a shared network directory OR my local "D:\Program Files\Microsoft SQL Server\90\Tools\PerformanceDashboard" directory containing all the RDL files and I get the above error.

The session I connect to SQL server with has full admin rights and I can do all my normal SSMS activities with no problems .. except run the performance dashboard.

Many thanks for any suggestions on this one.

John

|||

Any resolution on this?

Thanks

|||

Still nothing and even Google doesnt seem to have much of any use.

Its a real pity as I can see it would be useful to have the performance dashboard working.

|||

I have a "Fix" for this one though I dont yet know teh consequence of it fully. Since the "version_string" was coming back with an invalid value I decided to see if I could either out in a valid version string or get rid of it completely.

The performance_dashboard_main.rdl is a XML file so I searched for and found

<ReportParameter Name="version_string">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>="1.0 (" + FormatDateTime(CDate("Jan 9, 2007")) + ")"</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>version_string</Prompt>
<Hidden>true</Hidden>
</ReportParameter>

which I changed to several different values (as a new filename) until I just removed it as below

<ReportParameter Name="version_string">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>=""</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>version_string</Prompt>
<Hidden>true</Hidden>
</ReportParameter>

and the renamed rdl file "performance_dashboard_new_main.rdl" seems to work.

Performance Dashboard Errors

After installing Performance Dashboard, I receive the following variations of the following error message when I run reports :

The 'version_string' parameter is missing a value.

Anyone else seen this, and how did you fix the problem?

What is the service pack level on SQL Server?|||

I am getting the same error message

Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

|||

How are you trying to run the reports? You need to open performance_dashboard_main.rdl - that's the starting point. The reports are all subreports you access from the main dashboard report.

-Sue

|||

I am also getting the "error during processing of 'version_string' report" Error even though we have service pack 2 and the latest hotfix on our 32 bit clustered SQL 2005 server (current build 9.0.3054)

I can "remote desktop" to the server and run the "performance_dashboard_main.rdl" in a local SSMS "custom report" view but when I start SSMS on my local workstation with full admin rights on the server, opening "Custom reports" and pointing to a shared network directory OR my local "D:\Program Files\Microsoft SQL Server\90\Tools\PerformanceDashboard" directory containing all the RDL files and I get the above error.

The session I connect to SQL server with has full admin rights and I can do all my normal SSMS activities with no problems .. except run the performance dashboard.

Many thanks for any suggestions on this one.

John

|||

Any resolution on this?

Thanks

|||

Still nothing and even Google doesnt seem to have much of any use.

Its a real pity as I can see it would be useful to have the performance dashboard working.

|||

I have a "Fix" for this one though I dont yet know teh consequence of it fully. Since the "version_string" was coming back with an invalid value I decided to see if I could either out in a valid version string or get rid of it completely.

The performance_dashboard_main.rdl is a XML file so I searched for and found

<ReportParameter Name="version_string">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>="1.0 (" + FormatDateTime(CDate("Jan 9, 2007")) + ")"</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>version_string</Prompt>
<Hidden>true</Hidden>
</ReportParameter>

which I changed to several different values (as a new filename) until I just removed it as below

<ReportParameter Name="version_string">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>=""</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>version_string</Prompt>
<Hidden>true</Hidden>
</ReportParameter>

and the renamed rdl file "performance_dashboard_new_main.rdl" seems to work.

Performance Dashboard Errors

After installing Performance Dashboard, I receive the following variations of the following error message when I run reports :

The 'version_string' parameter is missing a value.

Anyone else seen this, and how did you fix the problem?

What is the service pack level on SQL Server?|||

I am getting the same error message

Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

|||

How are you trying to run the reports? You need to open performance_dashboard_main.rdl - that's the starting point. The reports are all subreports you access from the main dashboard report.

-Sue

|||

I am also getting the "error during processing of 'version_string' report" Error even though we have service pack 2 and the latest hotfix on our 32 bit clustered SQL 2005 server (current build 9.0.3054)

I can "remote desktop" to the server and run the "performance_dashboard_main.rdl" in a local SSMS "custom report" view but when I start SSMS on my local workstation with full admin rights on the server, opening "Custom reports" and pointing to a shared network directory OR my local "D:\Program Files\Microsoft SQL Server\90\Tools\PerformanceDashboard" directory containing all the RDL files and I get the above error.

The session I connect to SQL server with has full admin rights and I can do all my normal SSMS activities with no problems .. except run the performance dashboard.

Many thanks for any suggestions on this one.

John

|||

Any resolution on this?

Thanks

|||

Still nothing and even Google doesnt seem to have much of any use.

Its a real pity as I can see it would be useful to have the performance dashboard working.

|||

I have a "Fix" for this one though I dont yet know teh consequence of it fully. Since the "version_string" was coming back with an invalid value I decided to see if I could either out in a valid version string or get rid of it completely.

The performance_dashboard_main.rdl is a XML file so I searched for and found

<ReportParameter Name="version_string">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>="1.0 (" + FormatDateTime(CDate("Jan 9, 2007")) + ")"</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>version_string</Prompt>
<Hidden>true</Hidden>
</ReportParameter>

which I changed to several different values (as a new filename) until I just removed it as below

<ReportParameter Name="version_string">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>=""</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>version_string</Prompt>
<Hidden>true</Hidden>
</ReportParameter>

and the renamed rdl file "performance_dashboard_new_main.rdl" seems to work.

sql

Tuesday, March 20, 2012

PErformance and SQL Server Error Log

I am using SQL 2K.
Size of the SQL Server error log file will degrade the performance of SQL
Server.
I am talking about log file which I cleared using SP_CYCLE_ERRORLOG.
Thanks,
JJ
Recycle more often then. How did you determine that it "degraded"
performance?
bert
|||Sorry,
It was my quetion as whether it will degrade the performance or not?
Thanks,
JJ
"bert" <bertcord@.gmail.com> wrote in message
news:1107297013.482698.267950@.l41g2000cwc.googlegr oups.com...
> Recycle more often then. How did you determine that it "degraded"
> performance?
> bert
>
|||Hi
Not that I have ever found. Output to the log file is appended and is not
read by SQL Server itself.
The bigger issue is how do you view it. A 10Mb log file does take a while to
open in EM (or notepad).
We cycle our error logs on our 400 servers every night. This helps us to
keep the Error log entries by day.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"John Smith" <JJSmith45@.hotmail.com> wrote in message
news:#bkfy5KCFHA.3524@.TK2MSFTNGP15.phx.gbl...
> Sorry,
> It was my quetion as whether it will degrade the performance or not?
> Thanks,
> JJ
> "bert" <bertcord@.gmail.com> wrote in message
> news:1107297013.482698.267950@.l41g2000cwc.googlegr oups.com...
>
|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:euXu08KCFHA.1936@.TK2MSFTNGP14.phx.gbl...
> Hi
> Not that I have ever found. Output to the log file is appended and is not
> read by SQL Server itself.
> The bigger issue is how do you view it. A 10Mb log file does take a while
to
> open in EM (or notepad).
> We cycle our error logs on our 400 servers every night. This helps us to
> keep the Error log entries by day.
>
We do it on the first of the month. But same idea.. keep it somewhat
reasonable and have enough "old" ones to troubleshoot problems.
|||Another helpful hint: either by registry key or by using SQLEM, you can
modify the properties of the SQL Error logs to increase the number retained.
We set ours to 32 and recycle at 11:59 PM every night.
Another thing to consider, most of what is output to the SQL Server Error
logs also ends up in the server's Application Event log; so, you might want
to increase the size of that log too.
Finally, if you have your security settings to Audit all logins, both the
SQL Server Error logs and the system's Application Event logs can be
enourmous. We currently only set for failed login attempts.
Sincerely,
Anthony Thomas

"Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
news:EthMd.26166$ZD1.5393@.twister.nyroc.rr.com...
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:euXu08KCFHA.1936@.TK2MSFTNGP14.phx.gbl...
> Hi
> Not that I have ever found. Output to the log file is appended and is not
> read by SQL Server itself.
> The bigger issue is how do you view it. A 10Mb log file does take a while
to
> open in EM (or notepad).
> We cycle our error logs on our 400 servers every night. This helps us to
> keep the Error log entries by day.
>
We do it on the first of the month. But same idea.. keep it somewhat
reasonable and have enough "old" ones to troubleshoot problems.

PErformance and SQL Server Error Log

I am using SQL 2K.
Size of the SQL Server error log file will degrade the performance of SQL
Server.
I am talking about log file which I cleared using SP_CYCLE_ERRORLOG.
Thanks,
JJRecycle more often then. How did you determine that it "degraded"
performance?
bert|||Sorry,
It was my quetion as whether it will degrade the performance or not?
Thanks,
JJ
"bert" <bertcord@.gmail.com> wrote in message
news:1107297013.482698.267950@.l41g2000cwc.googlegroups.com...
> Recycle more often then. How did you determine that it "degraded"
> performance?
> bert
>|||Hi
Not that I have ever found. Output to the log file is appended and is not
read by SQL Server itself.
The bigger issue is how do you view it. A 10Mb log file does take a while to
open in EM (or notepad).
We cycle our error logs on our 400 servers every night. This helps us to
keep the Error log entries by day.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"John Smith" <JJSmith45@.hotmail.com> wrote in message
news:#bkfy5KCFHA.3524@.TK2MSFTNGP15.phx.gbl...
> Sorry,
> It was my quetion as whether it will degrade the performance or not?
> Thanks,
> JJ
> "bert" <bertcord@.gmail.com> wrote in message
> news:1107297013.482698.267950@.l41g2000cwc.googlegroups.com...
> > Recycle more often then. How did you determine that it "degraded"
> > performance?
> >
> > bert
> >
>|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:euXu08KCFHA.1936@.TK2MSFTNGP14.phx.gbl...
> Hi
> Not that I have ever found. Output to the log file is appended and is not
> read by SQL Server itself.
> The bigger issue is how do you view it. A 10Mb log file does take a while
to
> open in EM (or notepad).
> We cycle our error logs on our 400 servers every night. This helps us to
> keep the Error log entries by day.
>
We do it on the first of the month. But same idea.. keep it somewhat
reasonable and have enough "old" ones to troubleshoot problems.|||Another helpful hint: either by registry key or by using SQLEM, you can
modify the properties of the SQL Error logs to increase the number retained.
We set ours to 32 and recycle at 11:59 PM every night.
Another thing to consider, most of what is output to the SQL Server Error
logs also ends up in the server's Application Event log; so, you might want
to increase the size of that log too.
Finally, if you have your security settings to Audit all logins, both the
SQL Server Error logs and the system's Application Event logs can be
enourmous. We currently only set for failed login attempts.
Sincerely,
Anthony Thomas
"Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
news:EthMd.26166$ZD1.5393@.twister.nyroc.rr.com...
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:euXu08KCFHA.1936@.TK2MSFTNGP14.phx.gbl...
> Hi
> Not that I have ever found. Output to the log file is appended and is not
> read by SQL Server itself.
> The bigger issue is how do you view it. A 10Mb log file does take a while
to
> open in EM (or notepad).
> We cycle our error logs on our 400 servers every night. This helps us to
> keep the Error log entries by day.
>
We do it on the first of the month. But same idea.. keep it somewhat
reasonable and have enough "old" ones to troubleshoot problems.

PErformance and SQL Server Error Log

I am using SQL 2K.
Size of the SQL Server error log file will degrade the performance of SQL
Server.
I am talking about log file which I cleared using SP_CYCLE_ERRORLOG.
Thanks,
JJRecycle more often then. How did you determine that it "degraded"
performance?
bert|||Sorry,
It was my quetion as whether it will degrade the performance or not?
Thanks,
JJ
"bert" <bertcord@.gmail.com> wrote in message
news:1107297013.482698.267950@.l41g2000cwc.googlegroups.com...
> Recycle more often then. How did you determine that it "degraded"
> performance?
> bert
>|||Hi
Not that I have ever found. Output to the log file is appended and is not
read by SQL Server itself.
The bigger issue is how do you view it. A 10Mb log file does take a while to
open in EM (or notepad).
We cycle our error logs on our 400 servers every night. This helps us to
keep the Error log entries by day.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"John Smith" <JJSmith45@.hotmail.com> wrote in message
news:#bkfy5KCFHA.3524@.TK2MSFTNGP15.phx.gbl...
> Sorry,
> It was my quetion as whether it will degrade the performance or not?
> Thanks,
> JJ
> "bert" <bertcord@.gmail.com> wrote in message
> news:1107297013.482698.267950@.l41g2000cwc.googlegroups.com...
>|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:euXu08KCFHA.1936@.TK2MSFTNGP14.phx.gbl...
> Hi
> Not that I have ever found. Output to the log file is appended and is not
> read by SQL Server itself.
> The bigger issue is how do you view it. A 10Mb log file does take a while
to
> open in EM (or notepad).
> We cycle our error logs on our 400 servers every night. This helps us to
> keep the Error log entries by day.
>
We do it on the first of the month. But same idea.. keep it somewhat
reasonable and have enough "old" ones to troubleshoot problems.|||Another helpful hint: either by registry key or by using SQLEM, you can
modify the properties of the SQL Error logs to increase the number retained.
We set ours to 32 and recycle at 11:59 PM every night.
Another thing to consider, most of what is output to the SQL Server Error
logs also ends up in the server's Application Event log; so, you might want
to increase the size of that log too.
Finally, if you have your security settings to Audit all logins, both the
SQL Server Error logs and the system's Application Event logs can be
enourmous. We currently only set for failed login attempts.
Sincerely,
Anthony Thomas
"Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
news:EthMd.26166$ZD1.5393@.twister.nyroc.rr.com...
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:euXu08KCFHA.1936@.TK2MSFTNGP14.phx.gbl...
> Hi
> Not that I have ever found. Output to the log file is appended and is not
> read by SQL Server itself.
> The bigger issue is how do you view it. A 10Mb log file does take a while
to
> open in EM (or notepad).
> We cycle our error logs on our 400 servers every night. This helps us to
> keep the Error log entries by day.
>
We do it on the first of the month. But same idea.. keep it somewhat
reasonable and have enough "old" ones to troubleshoot problems.

Saturday, February 25, 2012

perform aggregate function & group by

Hello, anyone can help?
below SQL works in sybase but fail in sql2000. sql2000 show error on the sum
of netweight (cannot perform aggregate function) and group by commodity_code
(invalid column name !!)
SELECT
(select HTS
from bur_inv_item_list
where item = material
and plantcode = plant) as commodity_code,
(select DESCRIPTION
from bur_inv_item_list
where item = material
and plantcode = plant) as description,
uom as uom,
(select Orig
from bur_inv_item_list
where item = material
and plantcode = plant) as coo,
netweight =
sum(case when plant = '0014' or plant = '0024' then
round(qty * (select weight
from bur_inv_item_list
where item = material
and plantcode = plant), 2)
else
round(qty * (select weight
from bur_inv_item_list
where item = material
and plantcode = plant) /2.20462, 2)
end),
sum(ext_cost) as cost
from bur_inv_cntr_list
group by
commodity_code,
description,
uom,
coo
order by
commodity_code,
description,
uom,
coo
;The logical evaluation order of a SELECT statement is (top to bottom):
FROM
WHERE
GROUP BY
HAVING
SELECT
ORDER BY
TOP
As you see, the SELECT hasn't happened yet when the GROUP BY is performed. T
his mean that you cannot
refer to any column alias name in the GROUP BY clause. Some product diverts
from the ANSI SQL
standard behavior, SQL Server does not (in this regard). So push the express
ions in a derived table
and work against that.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"frankie lo" <frankiecblo@.hotmail.com> wrote in message
news:emgGyQOaGHA.1196@.TK2MSFTNGP03.phx.gbl...
> Hello, anyone can help?
>
> below SQL works in sybase but fail in sql2000. sql2000 show error on the s
um of netweight (cannot
> perform aggregate function) and group by commodity_code (invalid column na
me !!)
>
> SELECT
> (select HTS
> from bur_inv_item_list
> where item = material
> and plantcode = plant) as commodity_code,
> (select DESCRIPTION
> from bur_inv_item_list
> where item = material
> and plantcode = plant) as description,
> uom as uom,
> (select Orig
> from bur_inv_item_list
> where item = material
> and plantcode = plant) as coo,
> netweight =
> sum(case when plant = '0014' or plant = '0024' then
> round(qty * (select weight
> from bur_inv_item_list
> where item = material
> and plantcode = plant), 2)
> else
> round(qty * (select weight
> from bur_inv_item_list
> where item = material
> and plantcode = plant) /2.20462, 2)
> end),
> sum(ext_cost) as cost
> from bur_inv_cntr_list
> group by
> commodity_code,
> description,
> uom,
> coo
> order by
> commodity_code,
> description,
> uom,
> coo
> ;
>|||hi tibor,
thanks for your info. do you have any sample/case. I want to see the sample
to modify below script.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:u3R1jsPaGHA.504@.TK2MSFTNGP03.phx.gbl...
> The logical evaluation order of a SELECT statement is (top to bottom):
> FROM
> WHERE
> GROUP BY
> HAVING
> SELECT
> ORDER BY
> TOP
> As you see, the SELECT hasn't happened yet when the GROUP BY is performed.
> This mean that you cannot refer to any column alias name in the GROUP BY
> clause. Some product diverts from the ANSI SQL standard behavior, SQL
> Server does not (in this regard). So push the expressions in a derived
> table and work against that.
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "frankie lo" <frankiecblo@.hotmail.com> wrote in message
> news:emgGyQOaGHA.1196@.TK2MSFTNGP03.phx.gbl...
>|||Here's a very simple example where a derived table is used so you don't have
to repeat the DATEPART
expression:
USE pubs
SELECT DATEPART(mm, pubdate) AS pub_month, COUNT(*) AS no_of_titles
FROM titles
GROUP BY DATEPART(mm, pubdate)
SELECT pub_month, COUNT(*) AS titles
FROM
(
SELECT DATEPART(mm, pubdate) AS pub_month
FROM titles
) AS i
GROUP BY pub_month
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"frankie lo" <frankiecblo@.hotmail.com> wrote in message
news:OqUKBdRaGHA.2368@.TK2MSFTNGP03.phx.gbl...
> hi tibor,
> thanks for your info. do you have any sample/case. I want to see the sampl
e to modify below
> script.
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:u3R1jsPaGHA.504@.TK2MSFTNGP03.phx.gbl...
>|||Hi Tibor,
Many Thanks.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:ebF1yHSaGHA.1196@.TK2MSFTNGP03.phx.gbl...
> Here's a very simple example where a derived table is used so you don't
> have to repeat the DATEPART expression:
> USE pubs
> SELECT DATEPART(mm, pubdate) AS pub_month, COUNT(*) AS no_of_titles
> FROM titles
> GROUP BY DATEPART(mm, pubdate)
> SELECT pub_month, COUNT(*) AS titles
> FROM
> (
> SELECT DATEPART(mm, pubdate) AS pub_month
> FROM titles
> ) AS i
> GROUP BY pub_month
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "frankie lo" <frankiecblo@.hotmail.com> wrote in message
> news:OqUKBdRaGHA.2368@.TK2MSFTNGP03.phx.gbl...
>