troubleshooting Question

Date conversion TSQL

Avatar of misermice
misermice asked on
Microsoft SQL Server 2005Microsoft SQL Server 2008
6 Comments1 Solution501 ViewsLast Modified:
I have 100k rows of data ina  filed of type varchar(12)
I want that field to be converted or recreated with type datetime and get all teh dates converted.
how do i do that ?

current data looks like this

 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008
 10/1/2008

and filed type is varhcar
SQL Server is not recognizing them as numerics coz when i tried to slect everything that is numeric by

SELECT * FROM THISTABLE WHERE ISNUMERIC(my_data_filed) = 1

It pulled zero rows

When i chnaged it to

SELECT * FROM THISTABLE WHERE ISNUMERIC(my_data_filed)  != 1

It pulled all rows.

Thanks.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
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 1 Answer and 6 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