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 2000 Forums
 Transact-SQL (2000)
 issue in MY Sql Server 2000

Author  Topic 

deepakl_2000
Starting Member

8 Posts

Posted - 2009-11-12 : 07:56:08

@ParamName varchar(80)
PRINT @ParamName
PRINT CONVERT(NUMERIC(18,0),@ParamName)


EET 20-50
Error converting data type varchar to numeric.


how to resolve this issue???Please need help



When the Going gets Tougher,The Tougher gets Going.

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-11-12 : 08:40:04
What value is @ParamName when it fails?

If it is not numeric, then you will get this message every time.
Go to Top of Page

deepakl_2000
Starting Member

8 Posts

Posted - 2009-11-14 : 05:10:43
Hey RickD,

Please find my below answers for your queries.

1. The DataType of @ParamName is varchar(80)
2. Value of @ParamName = EET 20-50

yes is not numeric but how do i convert it to numeric...???



When the Going gets Tougher,The Tougher gets Going.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-14 : 09:16:31
How should 'EET 20-50' become numeric?
That makes no sense!
How should in this case your wanted result look like?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-11-16 : 05:05:59
Look up substring if you want part of the value to become numeric, otherwise, how the hell is that even close to being numeric?!?
Go to Top of Page

deepakl_2000
Starting Member

8 Posts

Posted - 2009-11-16 : 11:01:38
Hi RickD,
Yes i can understand your point,how do i do a substring on this and convert into numeric??

I will be highly obliged if you can advice on this issue.

Thanks and Regards,
Deepak Lal

When the Going gets Tougher,The Tougher gets Going.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-16 : 11:10:40
My questions posted earlier:
How should 'EET 20-50' become numeric?
How should in this case your wanted result look like?

Without an answer to these questions - how should we give any help?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-11-17 : 06:55:45
^^^^^Yeah, that^^^^^
Go to Top of Page

deepakl_2000
Starting Member

8 Posts

Posted - 2009-11-17 : 09:22:01


How should in this case your wanted result look like?
Result should be --->EET 20-50 ( datatype numeric )

How should 'EET 20-50' become numeric? --i dont know how to convert it to numeric so i have posted in the forum....



When the Going gets Tougher,The Tougher gets Going.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-17 : 10:35:38
quote:
Result should be --->EET 20-50 ( datatype numeric )

So the answer is: That is not possible.

Understanding Data Type Differences:
http://msdn.microsoft.com/en-us/library/ms378715.aspx


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -