SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Katmai - date time format
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

blackbox320
Starting Member

India
10 Posts

Posted - 06/15/2007 :  12:10:15  Show Profile  Reply with Quote
In Katmai, is date and time two different datatype or a single datatype as in previous versions?

vishwamukh

rmiao
Flowing Fount of Yak Knowledge

USA
7266 Posts

Posted - 06/15/2007 :  15:13:21  Show Profile  Reply with Quote
Checked katmai books online, same as in current versions.
Go to Top of Page

spirit1
Cybernetic Yak Master

Slovenia
11751 Posts

Posted - 06/15/2007 :  15:50:19  Show Profile  Visit spirit1's Homepage  Reply with Quote
it's supposedly to be separated in RTM but i seriously doubt it.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22755 Posts

Posted - 06/16/2007 :  00:17:01  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
So, still we can expect "How do I show only date without Time?" questions

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

chiragkhabaria
Flowing Fount of Yak Knowledge

India
1907 Posts

Posted - 06/16/2007 :  08:47:01  Show Profile  Visit chiragkhabaria's Homepage  Send chiragkhabaria a Yahoo! Message  Reply with Quote
quote:
Originally posted by madhivanan

So, still we can expect "How do I show only date without Time?" questions

Madhivanan

Failing to plan is Planning to fail



you not so lucky for now..

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

chiragkhabaria
Flowing Fount of Yak Knowledge

India
1907 Posts

Posted - 06/16/2007 :  08:53:17  Show Profile  Visit chiragkhabaria's Homepage  Send chiragkhabaria a Yahoo! Message  Reply with Quote
didnt tried out.. but google.. gave me this link..

http://msmvps.com/blogs/robfarley/archive/2007/06/11/date-and-time-data-types-in-sql-server-2008.aspx

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22755 Posts

Posted - 06/16/2007 :  09:12:43  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
quote:
Originally posted by chiragkhabaria

didnt tried out.. but google.. gave me this link..

http://msmvps.com/blogs/robfarley/archive/2007/06/11/date-and-time-data-types-in-sql-server-2008.aspx

Chirag

http://chirikworld.blogspot.com/

That seems cool

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

blackbox320
Starting Member

India
10 Posts

Posted - 06/17/2007 :  15:58:29  Show Profile  Reply with Quote
Thanks for your replies. May be someday it happens!

vishwamukh
Go to Top of Page

spirit1
Cybernetic Yak Master

Slovenia
11751 Posts

Posted - 06/18/2007 :  03:04:56  Show Profile  Visit spirit1's Homepage  Reply with Quote
well chirik as rob says in the end they're not available in June CTP of Katmai

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

rob_farley
Yak Posting Veteran

Australia
64 Posts

Posted - 07/03/2007 :  05:36:55  Show Profile  Visit rob_farley's Homepage  Click to see rob_farley's MSN Messenger address  Send rob_farley a Yahoo! Message  Reply with Quote
Yeah, that's right.

There will still be good cause for taking care when casting datetime fields to date, as:

cast(myfield as date) = @thedate

is unlikely to be handled as nicely by indexes as:

myfield >= @thedate and myfield < dateadd(day,1,@thedate)

I'm pleased my post helped settle your argument though. Sorry for not noticing before now.

Rob

Rob Farley
President - Adelaide SQL Server User Group
http://msmvps.com/blogs/robfarley
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30242 Posts

Posted - 08/01/2007 :  19:47:39  Show Profile  Visit SwePeso's Homepage  Reply with Quote
July CTP test code
DECLARE	@a time
SET @a = current_timestamp

select @a

01:46:25.4500000



E 12°55'05.25"
N 56°04'39.16"

Edited by - SwePeso on 08/01/2007 19:49:55
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30242 Posts

Posted - 08/01/2007 :  19:51:21  Show Profile  Visit SwePeso's Homepage  Reply with Quote
SELECT 
     CAST('2007-05-08 12:35:29. 1234567 +12:15' AS time(7)) AS 'time' 
    ,CAST('2007-05-08 12:35:29. 1234567 +12:15' AS date) AS 'date' 
    ,CAST('2007-05-08 12:35:29.123' AS smalldatetime) AS 
        'smalldatetime' 
    ,CAST('2007-05-08 12:35:29.123' AS datetime) AS 'datetime' 
    ,CAST('2007-05-08 12:35:29. 1234567 +12:15' AS datetime2(7)) AS 
        'datetime2'
    ,CAST('2007-05-08 12:35:29.1234567 +12:15' AS datetimeoffset(7)) AS 
        'datetimeoffset';


Data type          Output  
time               12:35:29. 1234567
date               2007-05-08
smalldatetime      2007-05-08 12:35:00
datetime           2007-05-08 12:35:29.123
datetime2(7)       2007-05-08 12:35:29.1234567
datetimeoffset(7)  2007-05-08 12:35:29.1234567 +12:15



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

rob_farley
Yak Posting Veteran

Australia
64 Posts

Posted - 08/01/2007 :  19:54:36  Show Profile  Visit rob_farley's Homepage  Click to see rob_farley's MSN Messenger address  Send rob_farley a Yahoo! Message  Reply with Quote
Yes, it's great to see that the July CTP includes these!

Rob


Rob Farley
President - Adelaide SQL Server User Group
http://msmvps.com/blogs/robfarley
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30242 Posts

Posted - 08/01/2007 :  20:15:17  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Data type 	Format 						Range 										Accuracy 	Storage size (bytes) 	User-defined fractional second precision 	Time zone offset 	   
time 		hh:mm:ss[.nnnnnnn]				00:00:00.0000000 through 23:59:59.9999999					100 nanoseconds	3 to 5 			Yes						No	   
date 		YYYY-MM-DD					0001-01-01 through 9999-12-31							1 day		3			No						No	   
smalldatetime 	YYYY-MM-DD hh:mm:ss				1900-01-01 through 2079-06-06							1 minute	4			No						No	   
datetime 	YYYY-MM-DD hh:mm:ss[.nnn]			1753-01-01 through 9999-12-31							0.333 second	8			No						No	   
datetime2 	YYYY-MM-DD hh:mm:ss[.nnnnnnn] 			0001-01-01 00:00:00.0000000 through 9999-12-31 23:59:59.9999999			100 nanoseconds	6 to 8			Yes						No	   
datetimeoffset 	YYYY-MM-DD hh:mm:ss[.nnnnnnn] [+|-]hh:mm	0001-01-01 00:00:00.0000000 through 9999-12-31 23:59:59.9999999 (in UTC)	100 nanoseconds	8 to 10			Yes						Yes


E 12°55'05.25"
N 56°04'39.16"

Edited by - SwePeso on 08/01/2007 20:16:38
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 08/02/2007 :  03:46:25  Show Profile  Reply with Quote
"datetime
datetime2
"

Do they just let the office junior pick these names?

So we have "small" for, errmmmmm .... "small" precision, and "2" for Big precision. Great!

A bit like the change of TEXT to varchar(MAX) in SQL 2005 ...

Kristen
Go to Top of Page

rob_farley
Yak Posting Veteran

Australia
64 Posts

Posted - 08/02/2007 :  04:41:55  Show Profile  Visit rob_farley's Homepage  Click to see rob_farley's MSN Messenger address  Send rob_farley a Yahoo! Message  Reply with Quote
Well, Oracle have char and char2, compared to Microsoft's char and nchar. So I've joked that datetime2 should be ndatetime. I don't tend to explain the Oracle connection, but people who have used Oracle chuckle a little.


Rob Farley
President - Adelaide SQL Server User Group
http://msmvps.com/blogs/robfarley
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 08/02/2007 :  05:41:54  Show Profile  Reply with Quote
"ndatetime"

Priceless
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30242 Posts

Posted - 08/02/2007 :  07:00:56  Show Profile  Visit SwePeso's Homepage  Reply with Quote
tinydatetime or bigdatetime?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 08/02/2007 :  08:26:48  Show Profile  Reply with Quote
Never quite understood why thy choose BIG rather than LONG - but BIG would definitely be better than "2" on the "keep it consistent" stakes

Kristen
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000