Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

The version of SQL Server in use does not support datatype 'datetimeoffset'

Posted on 2010-09-03
5
763 Views
Last Modified: 2012-05-10
Hi,

I got the following error in an insert query. I use Visual Studio 2008 and Sql Server 2008 Express edition
Actually the database was in a Sql Server 2005 database. I created a backup and restored it into MSSQL 2008 db. Changed the compatibility to Sql Server 2008.
One more note. I can insert datetimeoffset values with running the stored procedure manually.

Error
The version of SQL Server in use does not support datatype 'datetimeoffset'



CREATE PROCEDURE [dbo].[SpValueInsert]
(
	@ID_ResultCode bigint,
	@TheTime datetimeoffset,
	@Value decimal(18, 3)
)
AS

SET NOCOUNT OFF;
INSERT INTO [dbo].[Values] ([ID_ResultCode], [TheTime], [Value]) VALUES (@ID_ResultCode, @TheTime, @Value)

Open in new window

0
Comment
Question by:emresamisuzer
  • 2
  • 2
5 Comments
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 33594752
Please do include BEGIN....END statement in the SP.
0
 

Author Comment

by:emresamisuzer
ID: 33595077
Nothing changed.

I created a new dataset and I was able to insert with it. But I have lots of definitions in my current dataset and I don't want to re-create all of them again.
0
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 33609791
DataAdapter's ExecuteNonQuery() method has to be used to execute the insert statement. I don't know why do you fill the dataset. Could you send me the code snippets you are working on so that I could get clear picture?
 
 
 
0
 

Accepted Solution

by:
emresamisuzer earned 0 total points
ID: 33611282
I used dataset and tableadapters. Somehow existing tableadapters causes problems. Anyway, I created all the dataset again. And it solved my problem.

Thanks.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 33612497
>>Anyway, I created all the dataset again. And it solved my problem.<<
Excellent.  Now please close the question.

0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question