Showing posts with label purchased. Show all posts
Showing posts with label purchased. Show all posts

Thursday, March 22, 2012

Adding two dates

I have two fields, Date Purchased (smalldatetime) and warranty in months (integer).

can anyone help me to formulate a query to show the date when the warranty ends, and/or the remaining days/months in the warranty please?

I'm not sure if its doable, but i would really appreciate it if anyone can help me!

Give a look to the DATEADD function in books online; it looks like this:

declare @.example table
( rid integer,
datePurchased smalldatetime,
warranty integer
)

insert into @.example
select 1, '4/8/7', 3 union all
select 2, '5/14/7', 12

select rid,
convert(varchar(10), datePurchased, 101) as datePurchased,
warranty,
dateadd (mm, warranty, datePurchased) as warrantyEndDate,
datediff (day, getdate(), dateadd (mm, warranty, datePurchased)) as daysRemaining,
datediff (mm, getdate(), dateadd (mm, warranty, datePurchased)) as monthsRemaining
from @.example

/*
rid datePurchased warranty warrantyEndDate daysRemaining monthsRemaining
-- - -- - -
1 04/08/2007 3 2007-07-08 00:00:00 45 2
2 05/14/2007 12 2008-05-14 00:00:00 356 12
*/

Thursday, February 9, 2012

Adding an additional CPU SQL 2005 Enterprise

Hi,
I have 2 SQL 2005 Enterprise servers currently running one a single CPU
license. I have now purchased an additional enterprise CPU license and would
like to `activate` an additional CPU.
How would I do this?
Many thanks
RichardIf you had more than 1 processor on the machine you were violating the
license agreement to begin with. If you have 2 then you need two licenses
regardless of how many you intended to use. The license does not prohibit or
enable the use of the processors.
--
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Richard Thompson" <sbc@.thompson.co.za> wrote in message
news:8378184B-64EB-473B-81AE-DD54AE2A6CAF@.microsoft.com...
> Hi,
> I have 2 SQL 2005 Enterprise servers currently running one a single CPU
> license. I have now purchased an additional enterprise CPU license and
> would like to `activate` an additional CPU.
> How would I do this?
> Many thanks
> Richard|||Ok, thanks for that. So I now have a 2 CPU license I can just add the second
CPU and it will be fine no need to worry about changing settings in SQL at
all.
Thanks a lot,
Richard
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:O9Ipsq3$HHA.5652@.TK2MSFTNGP05.phx.gbl...
> If you had more than 1 processor on the machine you were violating the
> license agreement to begin with. If you have 2 then you need two licenses
> regardless of how many you intended to use. The license does not prohibit
> or enable the use of the processors.
> --
> Andrew J. Kelly SQL MVP
> Solid Quality Mentors
>
> "Richard Thompson" <sbc@.thompson.co.za> wrote in message
> news:8378184B-64EB-473B-81AE-DD54AE2A6CAF@.microsoft.com...
>> Hi,
>> I have 2 SQL 2005 Enterprise servers currently running one a single CPU
>> license. I have now purchased an additional enterprise CPU license and
>> would like to `activate` an additional CPU.
>> How would I do this?
>> Many thanks
>> Richard
>|||By adding the 2nd CPU do you mean physically installing one? If so then
yes, the OS & SQL Server should detect the 2nd CPU and it will know what to
do without changing any settings unless you already changed some from the
defaults.
--
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Richard Thompson" <sbc@.thompson.co.za> wrote in message
news:31A8B061-7F53-4EB2-AA6A-F96AB2103149@.microsoft.com...
> Ok, thanks for that. So I now have a 2 CPU license I can just add the
> second CPU and it will be fine no need to worry about changing settings in
> SQL at all.
> Thanks a lot,
> Richard
>
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:O9Ipsq3$HHA.5652@.TK2MSFTNGP05.phx.gbl...
>> If you had more than 1 processor on the machine you were violating the
>> license agreement to begin with. If you have 2 then you need two licenses
>> regardless of how many you intended to use. The license does not prohibit
>> or enable the use of the processors.
>> --
>> Andrew J. Kelly SQL MVP
>> Solid Quality Mentors
>>
>> "Richard Thompson" <sbc@.thompson.co.za> wrote in message
>> news:8378184B-64EB-473B-81AE-DD54AE2A6CAF@.microsoft.com...
>> Hi,
>> I have 2 SQL 2005 Enterprise servers currently running one a single CPU
>> license. I have now purchased an additional enterprise CPU license and
>> would like to `activate` an additional CPU.
>> How would I do this?
>> Many thanks
>> Richard
>