When the function is defined like this it will return the correct rows.
ALTER FUNCTION [dbo].[exampleFuncti开发者_Python百科on](
@GUID VARCHAR(20)--NUMERIC(16,0)
,@BrowseName VARCHAR(200)
)
But when I use Numeric(16,0), which is the correct data type for the data that's being passed, I receive 0 rows.
ALTER FUNCTION [dbo].[exampleFunction](
@GUID NUMERIC(16,0)
,@BrowseName VARCHAR(200)
)
The function is returning a BIT. Basically the function finds the GUID then compares the BrowseTreeName.
Anyone know why this is?
Thanks
just a guess based on your parameter name (@GUID), but a GUID is not actually "numeric", see uniqueidentifier (Transact-SQL). A 16 byte GUID value does not map properly to a numeric(16,0).
Why not just define the @GUID parameter as a uniqueidentifier
data type?
精彩评论