Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Error when changing datatype varchar to int/float

Author  Topic 

learntsql

524 Posts

Posted - 2010-09-08 : 02:29:12
Hi All,
I have defined columns datatype as varchar(50) but when i am trying to change to int/float its unable to change.
I have all int data and some null values.
Are NULL values causing issue?
TIA.

Kristen
Test

22859 Posts

Posted - 2010-09-08 : 02:46:48
"Are NULL values causing issue?"

No.

SELECT TOP 100 *
FROM YourTable
WHERE YourColumn LIKE '%[^0-9]%'

will find non integer values in a varchar column
Go to Top of Page
   

- Advertisement -