MSSQL SERVER 2008 New Features for Developers
2008-06-23 14:46
453 查看
Data TypesMSSQL 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.1235Values 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:00Demos :CAST('2007-10-20 20:30:05.1234567 +5:0' as DATE) = 2007-10-20CAST('2007-10-20 20:30:05.1234567 +5:0' as TIME(7)) = 20:30:05.1234567CAST('2007-10-20 20:30:05.123' as SMALLDATETIME) = 2007-10-20 20:30:00CAST('2007-10-20 20:30:05.123' as DATETIME) = 2007-10-20 20:30:05.123CAST('2007-10-20 20:30:05.1234567 +5:0' as DATETIME2(7)) = 2007-10-20 20:30:05.1234567CAST('2007-10-20 20:30:05.1234567 +5:0' as DATETIMEOFFSET(7)) = 2007-10-20 20:30:05.1234567 +05:00FILESTREAM Data typeWe 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.aspxHIERARCHYIDWhen 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.aspxhttp://blogs.msdn.com/manisblog/archive/2007/08/28/sql-server-2008-hierarchyid-part-ii.aspxGEOGRAPHYSpatial 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
相关文章推荐
- Dynamics 365(online) V9.0 new features for developers(一:客户端 API 增强功能)
- Dynamics 365(online) V9.0 new features for developers(四:自动编号)
- Dynamics 365(online) V9.0 new features for developers(二:JavaScript Web 资源依赖性)
- Oracle Database 11g: New Features for DBAs and Developers
- Dynamics 365(online) V9.0 new features for developers(三:Web 资源本地化)
- 50 New Resources and Tools for Developers and Designers
- Android Nougat new Features for developer
- Oracle Database 11g: New Features for Administrators 1Z0_050
- Ocp: Oracle 10g New Features For Administrators : Study Guide
- 立即注册Oracle虚拟开发者日:Oracle WebLogic Server & Java EE (Virtual Developer Day: A New Breed of Events for Java developers )
- New Features of Visual Studio 2008 and Microsoft .NET Framework 3.5
- Windows Vista for Developers – A New Series
- Complete list of new features for MySQL 5.7
- New Features in Visual c++ 2008
- new features and insights for pedestrian detection
- What"s New for MFC Developers?(翻译)
- Oracle Database 11g: The Top Features for DBAs and Developers
- Virtual Developer Day: A New Breed of Events for Java developers
- New ios books for developers
- New replication features in SQL Server 2008 and what they mean to you