Click here to Skip to main content
15,901,373 members
Home / Discussions / Database
   

Database

 
AnswerRe: Clarification on SQL Server Function? Pin
Shameel12-Mar-13 20:26
professionalShameel12-Mar-13 20:26 
GeneralMessage Closed Pin
12-Mar-13 22:54
H JJ12-Mar-13 22:54 
GeneralRe: Clarification on SQL Server Function? Pin
Shameel12-Mar-13 23:01
professionalShameel12-Mar-13 23:01 
AnswerRe: Clarification on SQL Server Function? Pin
Mycroft Holmes12-Mar-13 20:44
professionalMycroft Holmes12-Mar-13 20:44 
GeneralMessage Closed Pin
12-Mar-13 22:55
H JJ12-Mar-13 22:55 
GeneralRe: Clarification on SQL Server Function? Pin
Mycroft Holmes13-Mar-13 21:20
professionalMycroft Holmes13-Mar-13 21:20 
AnswerRe: Clarification on SQL Server Function? Pin
uspatel13-Mar-13 2:00
professionaluspatel13-Mar-13 2:00 
QuestionArithmetic overflow error converting expression to data type nvarchar. Pin
Vimalsoft(Pty) Ltd12-Mar-13 10:19
professionalVimalsoft(Pty) Ltd12-Mar-13 10:19 
Good Day

i have been hit by this error this night.

I have a UDF defined like this


SQL
 CREATE FUNCTION [dbo].[funcFormatPercentages_Extended]
(

 -- Add the parameters for the function here

 @parPercentageToBeFormatted nvarchar(20)

) 
RETURNS nvarchar(20)

AS

BEGIN 
	 RETURN CAST(CAST(convert(float,@parPercentageToBeFormatted)* 100 AS decimal(4, 1)) AS nvarchar(5)) + N'%'  
END  


so i will call the UDF with the value like this


select [dbo].[funcFormatPercentages_Extended_numeric]('-43.4703076923077')


OR

SQL
select [dbo].[funcFormatPercentages_Extended_numeric]('36.403813624481')


i get an Error

Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type nvarchar.


I tried to change the datatypes and Precision around , but still the error.

Thanks
Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com

AnswerRe: Arithmetic overflow error converting expression to data type nvarchar. Pin
Mycroft Holmes12-Mar-13 12:35
professionalMycroft Holmes12-Mar-13 12:35 
AnswerRe: Arithmetic overflow error converting expression to data type nvarchar. Pin
Richard Deeming13-Mar-13 2:18
mveRichard Deeming13-Mar-13 2:18 
Questionput a condition in join query Pin
demoninside912-Mar-13 1:38
demoninside912-Mar-13 1:38 
AnswerRe: put a condition in join query Pin
Jörgen Andersson12-Mar-13 2:19
professionalJörgen Andersson12-Mar-13 2:19 
GeneralRe: put a condition in join query Pin
demoninside912-Mar-13 18:47
demoninside912-Mar-13 18:47 
GeneralRe: put a condition in join query Pin
Mycroft Holmes12-Mar-13 20:40
professionalMycroft Holmes12-Mar-13 20:40 
GeneralRe: put a condition in join query Pin
demoninside912-Mar-13 20:49
demoninside912-Mar-13 20:49 
GeneralRe: put a condition in join query Pin
Mycroft Holmes12-Mar-13 22:23
professionalMycroft Holmes12-Mar-13 22:23 
GeneralRe: put a condition in join query Pin
demoninside912-Mar-13 22:39
demoninside912-Mar-13 22:39 
QuestionHow to Recover the Data if the Delete Query is Fire?? Pin
Anubhava Dimri11-Mar-13 22:11
Anubhava Dimri11-Mar-13 22:11 
AnswerRe: How to Recover the Data if the Delete Query is Fire?? Pin
Mycroft Holmes11-Mar-13 22:40
professionalMycroft Holmes11-Mar-13 22:40 
GeneralRe: How to Recover the Data if the Delete Query is Fire?? Pin
Anubhava Dimri11-Mar-13 23:44
Anubhava Dimri11-Mar-13 23:44 
Questiondatabase design for a self food ordering system? Pin
suryakanthithommy11-Mar-13 6:40
suryakanthithommy11-Mar-13 6:40 
AnswerRe: database design for a self food ordering system? Pin
Sandeep Mewara11-Mar-13 7:04
mveSandeep Mewara11-Mar-13 7:04 
Questionwhy i am unable to retrieve holiday name Pin
Member 870181310-Mar-13 22:35
Member 870181310-Mar-13 22:35 
AnswerRe: why i am unable to retrieve holiday name Pin
Mycroft Holmes10-Mar-13 23:20
professionalMycroft Holmes10-Mar-13 23:20 
GeneralRe: why i am unable to retrieve holiday name Pin
Member 870181311-Mar-13 4:31
Member 870181311-Mar-13 4:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.