Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Inserting DATE value using SSIS

$
0
0

I'm using an Excute SQL Task in order to insert a value into my table. One of the columns are a date type. The sql source type is a variable called insertCommand.

Here is my insertCommand expression: "insert into myTable VALUES (" + @[User::nameOfFile] + "," + GETDATE() + ")"

I get the error: The data types "DT_WSTR" and "DT_DBTIMESTAMP" are incompatible for binary operator "+". 

Now I understand that the error is coming from using GETDATE() and I know that I can cast it to DT_WSTR but this column's data type is DATE not NVARCHAR. How can I insert it as a date?


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>