Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Best practices for changing an nvchar(255) field to datetime

$
0
0

This is an existing database with 30k records, copied the table to a test table to try conversions. Ran the command:  

ALTER TABLE [Tablename] ALTER COLUMN [columnname] Datetime null
give mes the error: Conversion failed when converting date and/or time from character string.
Is there an easy to find out which records are not going to be able to convert? I know for a fact some of the records can. But with 30,000, just eyeballing for bad ones isn't practical. 

Viewing all articles
Browse latest Browse all 4871

Trending Articles



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