Open
Description
I've encountered an error when trying to use FakeTable on a table where a user-defined table type of the same name and schema exist.
"Either the parameter @OBJName is ambiguous or the claimed @objtype ((null)) is wrong."
The issue seems to be in SP tSQLt.Private_RenameObjectToUniqueName, which runs sp_rename without specifying the @objtype parameter (and so defaults @objtype to NULL). This then gives rise to the ambiguity error, as it has not been told whether to look at the OBJECT or the USERDATATYPE.
I believe setting @objtype to OBJECT in this call would resolve the problem.