Showing posts with label indicate. Show all posts
Showing posts with label indicate. Show all posts

Monday, March 19, 2012

"Slipt" rows based on datetime

Hello!

I have a table that, among other columns, has two datetime columns which indicate the initial and the final time. This would be an exemple of data in this table:

row1:

initial_time: 2006-05-24 8:00:00

final_time: 2006-05-24 8:30:00

row2:

initial_time: 2006-05-24 8:35:00

final_time: 2006-05-24 9:15:00

I would like to split a row in two new rows if final time's hour is different of initial time's hour, so I would like to split row2 into:

row2_a:

initial_time: 2006-05-24 8:35:00

initial_time: 2006-05-24 8:59:59

row2_b:

initial_time: 2006-05-24 9:00:00

initial_time: 2006-05-24 9:15:00

Is it possible to do it in a query, I mean, without using procedures?

Thank you!

? It gets a bit complex, but here's one way: create table #table ( initial_time datetime, final_time datetime) insert #table values( '2006-05-24 8:00:00', '2006-05-24 8:30:00') insert #table values( '2006-05-24 8:35:00', '2006-05-24 9:15:00') SELECT CASE x.N WHEN 0 THEN T.initial_time WHEN 1 THEN DATEADD(ms, ((DATEPART(minute, T.final_time) * 60000) + (DATEPART(second, T.final_time) * 1000) + DATEPART(millisecond, T.final_time)) * -1, T.final_time) END AS initial_time, CASE x.N WHEN 0 THEN CASE DATEDIFF(hour, T.initial_time, T.final_time) WHEN 0 THEN T.final_time WHEN 1 THEN DATEADD(millisecond, -3, DATEADD(millisecond, ((DATEPART(minute, T.final_time) * 60000) + (DATEPART(second, T.final_time) * 1000) + DATEPART(millisecond, T.final_time)) * -1, T.final_time)) END WHEN 1 THEN T.final_time END AS final_timeFROM #table TJOIN( SELECT 0 UNION ALL SELECT 1) x (N) ON x.N <= DATEDIFF(hour, T.initial_time, T.final_time) drop table #tablego -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <AnaC@.discussions.microsoft..com> wrote in message news:bdb330d8-5a34-409c-aaf3-57044628fc13@.discussions.microsoft.com... Hello! I have a table that, among other columns, has two datetime columns which indicate the initial and the final time. This would be an exemple of data in this table: row1: initial_time: 2006-05-24 8:00:00 final_time: 2006-05-24 8:30:00 row2: initial_time: 2006-05-24 8:35:00 final_time: 2006-05-24 9:15:00 I would like to split a row in two new rows if final time's hour is different of initial time's hour, so I would like to split row2 into: row2_a: initial_time: 2006-05-24 8:35:00 initial_time: 2006-05-24 8:59:59 row2_b: initial_time: 2006-05-24 9:00:00 initial_time: 2006-05-24 9:15:00 Is it possible to do it in a query, I mean, without using procedures? Thank you!|||Thank you!

Thursday, February 16, 2012

>2G ram & Standard Edition supported?

We have SQLServer standard edition running on a machine
with 2.2G of RAM. The sales faq appears to indicate that
SQLServer is not supported on a machine with more than 2G
of RAM. Is this the case?
Thanks,
Simon
http://www.microsoft.com/sql/howtobuy/faq.asp
Q. What is the maximum amount of RAM supported by SQL
Server 2000?
A. SQL Server 2000 Standard Edition supports up to 2
gigabytes (GB) of RAM. SQL Server 2000 Enterprise Edition
supports up to 64 GB of RAM.Simon
http://support.microsoft.com/defaul...kb;en-us;274750
"Simon Massey" <anonymous@.discussions.microsoft.com> wrote in message
news:3e9101c3e40f$4aa2c710$a301280a@.phx.gbl...
quote:

> We have SQLServer standard edition running on a machine
> with 2.2G of RAM. The sales faq appears to indicate that
> SQLServer is not supported on a machine with more than 2G
> of RAM. Is this the case?
> Thanks,
> Simon
> --
> http://www.microsoft.com/sql/howtobuy/faq.asp
> Q. What is the maximum amount of RAM supported by SQL
> Server 2000?
> A. SQL Server 2000 Standard Edition supports up to 2
> gigabytes (GB) of RAM. SQL Server 2000 Enterprise Edition
> supports up to 64 GB of RAM.
>
|||SQL Server Standard Edition is "supported" on machines with > 2GB, meaning
that MS will still give you technical support if you run it this way.
However Standard Edition only "supports" 2GB of RAM, meaning it will not use
more even if the machine has more installed.
To get SQL Server to use more than 2GB RAM you need the Enterprise Edition.
Note that the OS and other programs on that server could utilize the RAM,
like Analysis Services, Reporting Services or Notification Services.
Mike Kruchten
"Simon Massey" <anonymous@.discussions.microsoft.com> wrote in message
news:3e9101c3e40f$4aa2c710$a301280a@.phx.gbl...
quote:

> We have SQLServer standard edition running on a machine
> with 2.2G of RAM. The sales faq appears to indicate that
> SQLServer is not supported on a machine with more than 2G
> of RAM. Is this the case?
> Thanks,
> Simon
> --
> http://www.microsoft.com/sql/howtobuy/faq.asp
> Q. What is the maximum amount of RAM supported by SQL
> Server 2000?
> A. SQL Server 2000 Standard Edition supports up to 2
> gigabytes (GB) of RAM. SQL Server 2000 Enterprise Edition
> supports up to 64 GB of RAM.
>

>2G ram & Standard Edition supported?

We have SQLServer standard edition running on a machine
with 2.2G of RAM. The sales faq appears to indicate that
SQLServer is not supported on a machine with more than 2G
of RAM. Is this the case?
Thanks,
Simon
--
http://www.microsoft.com/sql/howtobuy/faq.asp
Q. What is the maximum amount of RAM supported by SQL
Server 2000?
A. SQL Server 2000 Standard Edition supports up to 2
gigabytes (GB) of RAM. SQL Server 2000 Enterprise Edition
supports up to 64 GB of RAM.Simon
http://support.microsoft.com/default.aspx?scid=kb;en-us;274750
"Simon Massey" <anonymous@.discussions.microsoft.com> wrote in message
news:3e9101c3e40f$4aa2c710$a301280a@.phx.gbl...
> We have SQLServer standard edition running on a machine
> with 2.2G of RAM. The sales faq appears to indicate that
> SQLServer is not supported on a machine with more than 2G
> of RAM. Is this the case?
> Thanks,
> Simon
> --
> http://www.microsoft.com/sql/howtobuy/faq.asp
> Q. What is the maximum amount of RAM supported by SQL
> Server 2000?
> A. SQL Server 2000 Standard Edition supports up to 2
> gigabytes (GB) of RAM. SQL Server 2000 Enterprise Edition
> supports up to 64 GB of RAM.
>|||SQL Server Standard Edition is "supported" on machines with > 2GB, meaning
that MS will still give you technical support if you run it this way.
However Standard Edition only "supports" 2GB of RAM, meaning it will not use
more even if the machine has more installed.
To get SQL Server to use more than 2GB RAM you need the Enterprise Edition.
Note that the OS and other programs on that server could utilize the RAM,
like Analysis Services, Reporting Services or Notification Services.
Mike Kruchten
"Simon Massey" <anonymous@.discussions.microsoft.com> wrote in message
news:3e9101c3e40f$4aa2c710$a301280a@.phx.gbl...
> We have SQLServer standard edition running on a machine
> with 2.2G of RAM. The sales faq appears to indicate that
> SQLServer is not supported on a machine with more than 2G
> of RAM. Is this the case?
> Thanks,
> Simon
> --
> http://www.microsoft.com/sql/howtobuy/faq.asp
> Q. What is the maximum amount of RAM supported by SQL
> Server 2000?
> A. SQL Server 2000 Standard Edition supports up to 2
> gigabytes (GB) of RAM. SQL Server 2000 Enterprise Edition
> supports up to 64 GB of RAM.
>