i h开发者_运维问答ave created a function:
CREATE FUNCTION FindDistrictId (@param XML)
RETURNS INT
(...)
which i want to use in a stored procedure like that:
CREATE PROCEDURE UpdateDistinctID
AS
UPDATE Notices SET DistinctId = FindDistrictId(Notices.XmlContent)
WHERE DistinctId = 0
I get 'FIndDistrictId is not a recognized built-in function name' when i try to do that. I thought that maybe i can't do Set field = function()
but then i checked here and i think it should work.. any idea why it's not? The function is created for sure im my db, i checked sys.object
You need to include the schema (owner if this is SQL 2000 or earlier) of the function on the call. By default, that would be dbo
.
UPDATE Notices SET DistinctId = dbo.FindDistrictId(Notices.XmlContent)
WHERE DistinctId = 0
精彩评论