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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 UDF Function
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

United Kingdom
152 Posts

Posted - 07/19/2013 :  09:00:31  Show Profile  Reply with Quote
Hi All,

I try to pass a parameter to a function 'dbo.[getConditions]'

select [dbo].[getConditions] ('GALTACS55785') as MedicalCondition, I got the below result

No heart related procedures declared/ Cholesterol

However i try to pass a value from a table like below

SELECT MSpolicy.ScreeningID , dbo.[getConditions](MSPolicy.ScreeningID ) as MedicalCondition

I got the below error

Msg 9400, Level 16, State 1, Line 2
XML parsing: line 1, character 8000, unexpected end of input

How to pass a value from a table to UDF function.

[MSPolicy table has field 'ScreeningID' eg ('GALTACS55785'),i need to pass this Screeningid to the function to get the corresponding condition for all the ID's]

Expected output
ScreeningID MedicalCondition
GALTACS55785 No heart related procedures declared/ Cholesterol
FGTTAC567983 Asthma/Sugar

Any help will be highly appreciated



Patron Saint of Lost Yaks

30421 Posts

Posted - 07/19/2013 :  11:00:04  Show Profile  Visit SwePeso's Homepage  Reply with Quote
You are most probably not handling the XML input correctly. It seems you are parsing the data as string.

N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
  Previous Topic Topic Next 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.03 seconds. Powered By: Snitz Forums 2000