MSSQL SERVER 2008 New Features for Developers

by UnquaLe 26. November 2007 15:58

Mssql Server 2008 is close to release. It is currently releasing as CTP and still growing with new features. I went to a seminer @ Microsoft from .NET community and i ve seen some cool stuffs so  I want to preview some of them with you.

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

http://blogs.msdn.com/manisblog/archive/2007/08/28/sql-server-2008-hierarchyid-part-ii.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..

Tags: ,

Development

Comments

11/26/2007 4:03:21 PM #

trackback

Trackback from DotNetKicks.com

MSSQL SERVER 2008 New Features for Developers

DotNetKicks.com | Reply

11/26/2007 11:27:31 PM #

pingback

Pingback from code-inside.de

Wöchentliche Rundablage: ASP.NET MVC, Visual Studio 2008, LINQ, SQL Server 2008,WCF, Surface, Silverlight… | Code-Inside Blog

code-inside.de | Reply

12/24/2009 2:08:01 PM #

business opportunities

Admiring the time and effort you put into your blog and detailed information you offer!

business opportunities United Kingdom | Reply

12/26/2009 10:53:38 AM #

play in free poker websites

Thanks for the update of your journey!!But In SQL Server Reporting Services is a comprehensive, server-based solution that enables the creation, management, and delivery of both traditional, paper-oriented reports and interactive, Web-based reports.

play in free poker websites United States | Reply

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen