Problem description
An error indicating that the object name is invalid is prompted when I query data from a table in an RDS for SQL Server instance.
Cause
Execute the following statement to check the table information:
SELECT a.name schemaName,b.name tableName,b.type_desc FROM sys.schemas a , sys.tables b
WHERE a.schema_id = b.schema_idThe result shows that the schema of the table is not dbo, which is the cause of the error.
Solution
Change the schema of a single table.
Sample command:
ALTER SCHEMA dbo TRANSFER test.kkkChange the schema of multiple tables in a batch.
Sample command:
exec sp_msforeachtable 'alter schema dbo transfer ?'