Hello
I want to achieve something like this:
But of course, the string, ehm, the nvarchar @dbName does not have the property INFORMATION_SCHEMA on it, so, is it possible to cast the dbName into a database-object, so the INFORMATION_SCHEMA lives...?
I want to achieve something like this:
Code:
DECLARE @dbName nvarchar(100)
SET @dbName = 'TestDatabase'
SELECT * FROM
@dbName.INFORMATION_SCHEMA.TABLES