Hi all,
I am trying to write one DTS package that can be used for multiple databases. I have about 13 Databases with names called *_SGEP where * is a three letter combination. They all have the same Table TblSafety with the same column names.
What I am trying to do is get an extract to an excel spreadsheet from the databases (where the table name is passed in as a global variable), but I don't want to make a package for each database. Thus, in the Transform data task I am trying to do something like the following:
Is there a way to get the ? to match the table name that I pass in(the global variable)? Right now it just throws an error when it tries to parse the SQL (Syntax Error). Thanks for your help in advance.
Keith
I am trying to write one DTS package that can be used for multiple databases. I have about 13 Databases with names called *_SGEP where * is a three letter combination. They all have the same Table TblSafety with the same column names.
What I am trying to do is get an extract to an excel spreadsheet from the databases (where the table name is passed in as a global variable), but I don't want to make a package for each database. Thus, in the Transform data task I am trying to do something like the following:
Code:
Select *
FROM ?.dbo.TblSafety
ORDER BY SPSCaseNo
Is there a way to get the ? to match the table name that I pass in(the global variable)? Right now it just throws an error when it tries to parse the SQL (Syntax Error). Thanks for your help in advance.
Keith