Home Forums SQL Server 2016 SQL Server 2016 - Development and T-SQL Dynamic Database Selection RE: Dynamic Database Selection
Lynn Pettis
SSC Guru
Points: 442467
More actions
February 8, 2018 at 4:51 pm
#1979136
You should look at using a stored procedure instead of a function as you are going to need to use dynamic SQL to accomplish this task. You can't use dynamic SQL in a function.