Skip to content

Specify @objname in tSQLt.Private_RenameObjectToUniqueName #50

Open
@FDBJRussell

Description

@FDBJRussell

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions