Bug? Function type detection seems unreliable
I'm having problems retrieving a recursive table-valued function from SVN so I tried to do it manually in stages which didn't work because SQL Source Control kept attempting to drop the function and then recreate it.
The steps I followed were:
1. Refresh the get latest tab and copy the function from the differences window.
2. Paste that SQL script into SSMS
3. Remove the part of the function that does the recursion (the second half of a UNION so the return type is still the same)
4. Execute the script to create the object
5. Get latest from SQL Version Control
6. Get the following message: "The function [dbo].[fnunititemcosttab] has changed its type. It must be dropped and recreated."
7. The get latest operation then fails as it is trying to create a function that refers to itself but doesn't exist.
After step 6 I can take the script from step 1, change the CREATE to an ALTER and execute the script in SSMS and it works so it was not necessary for SQL Source Control to drop and recreate the function.