If you pass the name as parameter, you cannot do it without dynamic SQL.
Query schema of a table in one database from a stored proc in another
-
22-06-2023 - |
Question
Is there a way to query the schema of a table from a stored proc in another database without resorting to dynamic sql? The name of the database would be passed in as a parameter.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow