Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 TimeSpan .Net type for SQL

Author  Topic 

jamie_pattison
Yak Posting Veteran

65 Posts

Posted - 2010-08-16 : 09:52:19
Does anyone know what the equivalent type for a .Net type of TimeSpan is for SQL? I tried Datetime and SmallDatetime which seemed to have caused some issues.

In short im trying to save a TimeSpan value to my Sql database.

Thanks

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2010-08-16 : 10:00:02
you map it to Time datatype in sql 2008 and onwards

___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.8 out!

SQL Server MVP
Go to Top of Page

jamie_pattison
Yak Posting Veteran

65 Posts

Posted - 2010-08-16 : 10:04:12
I dont see a "Time" datatype under the design view of my database?

Edit: I just noticed why. Im using SQL 2008 management tools but the database was created in SQL 2005....

So any recommendations for 2005?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2010-08-16 : 10:08:34
design view where?
it is in sql server 2008+: http://msdn.microsoft.com/en-us/library/bb677243.aspx

___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.8 out!

SQL Server MVP
Go to Top of Page
   

- Advertisement -