MSSQL SERVER 2008 New Features for Developers

Data Types
MSSQL Server 2k8 contains some new datatypes. These are DATE, TIME and some CLR based types.
DATE type stores only date without time. And TIME type stores only time withouth date. J It was alittle hard work to use date functions for time actions. I think these types can help us.
There is an another type for date. DATETIME2, is similir to standart DATETIME  but allows for greater precision. The range of the type is Jan 1 year 1 to 12/31/9999. So it wont be a problem to store DateTime.MinValue with this type. Also the clock is 24 hour cycle so 8 pm can be stored as the military time 20:00.
SELECT CAST('2007-10-20 20:30:05.1234567' as DATETIME2)
Results:  2007-10-20 20:30:05.1234567
SELECT CAST('2007-10-20 20:30:05.1234567' as DATETIME2(4))
Results:  2007-10-20 20:30:05.1235
 
Values that need to be time zone aware can now be stored in Mssql Server 2k8 with the DATETIMEOFFSET.
SELECT CAST('2007-10-20 20:30:05.1234567 +5:0' as DATETIMEOFFSET)
Results:  2007-10-20 20:30:05.1234567 +05:00
Demos :
CAST('2007-10-20 20:30:05.1234567 +5:0' as DATE) = 2007-10-20
CAST('2007-10-20 20:30:05.1234567 +5:0' as TIME(7)) = 20:30:05.1234567
CAST('2007-10-20 20:30:05.123' as SMALLDATETIME) = 2007-10-20 20:30:00
CAST('2007-10-20 20:30:05.123' as DATETIME) = 2007-10-20 20:30:05.123
CAST('2007-10-20 20:30:05.1234567 +5:0' as DATETIME2(7)) = 2007-10-20 20:30:05.1234567
CAST('2007-10-20 20:30:05.1234567 +5:0' as DATETIMEOFFSET(7)) = 2007-10-20 20:30:05.1234567 +05:00
FILESTREAM Data type
We always think where to store our BLOB files, in the FileSystem or in to the DB. It is hard desicion between them. You can store your files in to the db with filesystem support. For more details i think you should read this post : http://blogs.msdn.com/manisblog/archive/2007/10/21/filestream-data-type-sql-server-2008.aspx
 
HIERARCHYID
When do we need to have parent – child relationship we create a foreignKey to the table itself. So HierarchyID type will make it easy and it has some helpful funtions. Details on here : http://blogs.msdn.com/manisblog/archive/2007/08/17/sql-server-2008-hierarchyid.aspx
 
GEOGRAPHY
Spatial data types means businesses and products can now handle complex location data and apply it against other business or technical specific data without requiring expense GIS systems.
Now we are able to insert many records to be inserted using VALUES clause of the INSERT statement.
INSERT INTO SalesFeed (CustomerID, Product, SaleAmount) VALUES (1,'PoolTable', 1000), (2,'BigScreen', 955), (3,'Computer', 590), (4,'BigScreen', 880), (5,'Computer', 700)
There is a new Linq2Sql provider for sql server 2008.
There are some comprassion features, some more new T-SQL enchantments. I wantted to list these features that i like and I want to notice that Microsoft will stop supporting ms sql server 2000 in April 08’.
I hope it helps..
原文地址:http://www.dogaoztuzun.com/post/MSSQL-SERVER-2008-New-Features-for-Developers.aspx
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值