Home Forums SQL Server 7,2000 T-SQL Executing dynamic SQL string within a function RE: Executing dynamic SQL string within a function

  • It appears that if you put the name of the database in front of the call to the function, it will use the tables in that database. For example I created a function to list the columns within a table. I wanted to compare the two tables to see if there had been any changes to the column list between two databases.

    select db1.dbo.fn_GetColumnList('Table1'), db2.dbo.fn_GetColumnList('Table1')

    Which shows that I did indeed have two different column lists.