troubleshooting Question

Explicit conversion from data type bigint to date is not allowed.

Avatar of dbaSQL
dbaSQLFlag for United States of America asked on
Microsoft SQL ServerMicrosoft SQL Server 2005Microsoft SQL Server 2008
18 Comments2 Solutions18887 ViewsLast Modified:
ColumnA is BIGINT, contains values like this:  20040927, 19990729, 19990722
ColumnB is DATE, it is NULL.

The table is loaded from a csv, I just need to update columnB from columnA, after the file is loaded.  


I'm just trying a basic CAST in the update, and I am receiving the error in my title line.

UPDATE tablename
SET ColumnB = CAST(ColumnA AS DATE)
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 18 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 18 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros