?
Solved

Integration Services forcing conversion from datetime to timestamp

Posted on 2006-03-24
6
Medium Priority
?
1,268 Views
Last Modified: 2012-06-27
I'm working on an Integration Services package in SQL Server 2005 and I have created a destination table in a SQL Server 2005 database.  DateColumn1 in this table has a datatype in SQL Server of  datetime.  The source uses a date with a DT_Date data type in Integration Services.  When I execute the package I get the following error:

Validation error. TransformTask: SQL Server Destination [699]: The column "DateColumn1" can't be inserted because the conversion between types DT_DATE and DT_DBTIMESTAMP is not supported.

I can right click on the destination table and select Advanced Editor to try to change the External Columns datatype from "database timestamp [DT_DBTIMESTAMP]" to something like DT_DATE or DT_DATETIME, but it changes itself back to timestamp.

I get this same error with other packages every time I try to drop date data into SQL Server 2005 from Integration Services.  Anyone know a solution?  Thanks!
0
Comment
Question by:Patrick_McD
  • 3
  • 2
6 Comments
 
LVL 10

Expert Comment

by:pai_prasad
ID: 16283726
can u post the scripts for Create table
for both source and destn tables..

0
 

Author Comment

by:Patrick_McD
ID: 16283818
Yes, they both contain fields with datetime columns:

--Source Table (in SQL Server 2005):
USE [SpiralIS]
GO
/****** Object:  Table [SDRT-Spiral].[SDRTImport]    Script Date: 03/24/2006 13:13:43 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [SDRT-Spiral].[SDRTImport](
      [DateImportColumn1] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF

--Destination Table (in SQL Server 2005):

USE [SpiralIS]
GO
/****** Object:  Table [SDRT-Spiral].[SDRTInitialScrub]    Script Date: 03/24/2006 13:10:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [SDRT-Spiral].[SDRTInitialScrub](
      [DateColumn1] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
0
 
LVL 10

Assisted Solution

by:pai_prasad
pai_prasad earned 1000 total points
ID: 16283923
i didnt get any problems while xfering data from SDRTImport to SDRTInitialScrub
using SSIS !
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Patrick_McD
ID: 16284436
Everytime I create a table in SQL Server 2005 with a column with a datetime data type, and look at it in SSIS under the Advanced Editor, it shows up as a datetime data type.  I've created several new tables and they all do that.
0
 
LVL 70

Accepted Solution

by:
Scott Pletcher earned 1000 total points
ID: 16284525
>> Everytime I create a table in SQL Server 2005 with a column with a datetime data type, and look at it in SSIS under the Advanced Editor, it shows up as a datetime data type.  I've created several new tables and they all do that. <<

That's what it should do, isn't it?


As to the original problem, SQL obviously "thinks" the destination column is a TIMESTAMP instead of a DATETIME.  Just to be sure, you're not using replication in any way, are you?
0
 

Author Comment

by:Patrick_McD
ID: 16284994
Sorry, I wrote my comment wrong.  I meant to say that it shows up as a timestamp.

I decided to try another approach.  I changed both the source and destination in SSIS to timestamp, while leaving the actual SQL table as a datetime.  When I ran the package this time, I didn't get any errors and the data in the table was in fact a datetime.  So, it's weird, but this workaround seems to function.

Thanks for your help!
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

830 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