Showing posts with label current. Show all posts
Showing posts with label current. Show all posts

Sunday, March 11, 2012

AggregateOfMixedDataTypes error

I have an expression that returns Invoice amounts for the current
month. I try to Sum this though and get the aggregate of mixed data
types error. I've tried to convert the dates, but then get the 'trying
to Sum on data types other than numeric'. Can anyone help me figure
out how I can sum this column? Thank you. This is in Visual Studio on
SQL Server.
= iif(month(InvoiceDate)= month(getdate()) AND year(InvoiceDate)= year(getdate()), InvoiceAmount, 0)On Thu, 28 Feb 2008 09:44:32 -0800 (PST), p-rat <osupratt@.yahoo.com>
wrote:
>I have an expression that returns Invoice amounts for the current
>month. I try to Sum this though and get the aggregate of mixed data
>types error. I've tried to convert the dates, but then get the 'trying
>to Sum on data types other than numeric'. Can anyone help me figure
>out how I can sum this column? Thank you. This is in Visual Studio on
>SQL Server.
>= iif(month(InvoiceDate)= month(getdate()) AND year(InvoiceDate)=>year(getdate()), InvoiceAmount, 0)
This looks like a mix of Access (iif) and SQL Server (getdate()). You
might want to explain that, and show the entire SELECT with the SUM.
In SQL Server I would write this:
CASE WHEN month(invoice_date) = month(getdate())
AND year(invoice_date) = year(getdate())
THEN InvoiceAmount
ELSE 0
END
Note that they type of the constant 0 has to be compatible with the
type of the column InvoiceAmount, and InvoiceAmount has to be a number
that can be SUMmed.
Roy Harvey
Beacon Falls, CT

Sunday, February 12, 2012

Affinity mask setting in Yukon.

Hello,
Current setup: 3 instances of SQL server 2005 on a 2 CPU box.
How do I use IO/affinity to ensure that all SQL Server related I/O goes to
the first CPU? I'm aware that sp_configure is the command to be used.
But how do I exactly specify that the first CPU is to be exclusively used
for SQLServer I/O? Can someone give me an example OR point me to an page tha
t
has more info on this?
Cheers!
SQLCatzThe easiest way is to set the masks graphically in SSMS (Server Properties,
Processors).
There are more technical details about the whole process at
http://msdn2.microsoft.com/en-us/library/ms187104.aspx
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||Hello Paul,
Unfortunately I cannot use the GUI for this.
It has to be part of a script.
Which means that I have to use sp_configure.
But how do I specify which CPU gets the SQL Server related I/O?
Cheers!
SQLCatz|||For the first proc only, it'll be
sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
sp_configure 'affinity mask', 1;
RECONFIGURE;
GO
For the second proc only, it'll be
sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
sp_configure 'affinity mask', 2;
RECONFIGURE;
GO
For the both procs, it'll be
sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
sp_configure 'affinity mask', 3;
RECONFIGURE;
GO
Similarly for the affinity I/O mask.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||Hello Paul,
Thank you for that!
Recall reading on a web site that the setting was to be done using a bitmap
mask, where each bit specified the CPU number. Is this correct? And if it is
- how do I go about using this option? Just curious.
Cheers!
SQLCatz|||Please have a look at the link in my first post - htere's a good explanation
of the conversion needed for bitmasks and decimal values. The only tricky
thing to remember is that the processors are zero-indexed ie the first
processor is number 0 and the second is number 1 etc.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com

Affinity mask setting in Yukon.

Hello,
Current setup: 3 instances of SQL server 2005 on a 2 CPU box.
How do I use IO/affinity to ensure that all SQL Server related I/O goes to
the first CPU? I'm aware that sp_configure is the command to be used.
But how do I exactly specify that the first CPU is to be exclusively used
for SQLServer I/O? Can someone give me an example OR point me to an page that
has more info on this?
Cheers!
SQLCatzThe easiest way is to set the masks graphically in SSMS (Server Properties,
Processors).
There are more technical details about the whole process at
http://msdn2.microsoft.com/en-us/library/ms187104.aspx
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||Hello Paul,
Unfortunately I cannot use the GUI for this.
It has to be part of a script.
Which means that I have to use sp_configure.
But how do I specify which CPU gets the SQL Server related I/O?
Cheers!
SQLCatz|||For the first proc only, it'll be
sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
sp_configure 'affinity mask', 1;
RECONFIGURE;
GO
For the second proc only, it'll be
sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
sp_configure 'affinity mask', 2;
RECONFIGURE;
GO
For the both procs, it'll be
sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
sp_configure 'affinity mask', 3;
RECONFIGURE;
GO
Similarly for the affinity I/O mask.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||Hello Paul,
Thank you for that!
Recall reading on a web site that the setting was to be done using a bitmap
mask, where each bit specified the CPU number. Is this correct? And if it is
- how do I go about using this option? Just curious.
Cheers!
SQLCatz|||Please have a look at the link in my first post - htere's a good explanation
of the conversion needed for bitmasks and decimal values. The only tricky
thing to remember is that the processors are zero-indexed ie the first
processor is number 0 and the second is number 1 etc.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com