Skip to content
Advertisement

Get table name without schema

There is a string that could be a table name with ANY schema, not necessarily dbo. How do I get the table name only from the string without knowing the schema? E.g. from ‘dbo.MyTable’ I would need to extract ‘MyTable’.

Advertisement

Answer

PARSENAME can be used for this:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement