SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Other Forums
 SQL Server 6.5 \ SQL Server 7.0
 Updating int type in sql 6.5
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tourmaline
Starting Member

Malaysia
1 Posts

Posted - 10/15/2009 :  06:15:19  Show Profile  Reply with Quote
Need some advice,

i need to update this particular column,CIT_CTRY_CD which is in smallint type.i need to convert it into varchar type so that i can execute the update statement in my application.

tried this:

update parent set CIT_CTRY_CD=convert(varchar,'2000') where APL_NO='010210111999022711171126'

but got this error msg when executed in SQL SVR 6.5:

Disallowed implicit conversion from datatype 'varchar' to datatype 'smallint' Table: 'PARENT', Column: 'CIT_CTRY_CD'
Use the CONVERT function to run this query.



It works fine if tested in SQL SVR 2000

Thanks

webfred
Flowing Fount of Yak Knowledge

Germany
8765 Posts

Posted - 10/15/2009 :  06:27:00  Show Profile  Visit webfred's Homepage  Reply with Quote
Sorry but I cannot see why 2000 should be converted to varchar when storing in a smallint column.
That is senseless.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000