CalmSoul
asked on
T-SQL - how multiple tables with wild card?
Hello All:
I am using SQL server 2008 R2, how can I query multiple table using a wild card for example ?
Select * from TAB_*
I have 500 tables like this
TAB_09082013
TAB_08072012
etc...
Please let me know
I am using SQL server 2008 R2, how can I query multiple table using a wild card for example ?
Select * from TAB_*
I have 500 tables like this
TAB_09082013
TAB_08072012
etc...
Please let me know
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@deepakChauhan - it working but I want merged results as well...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CalmSoul, do you still need help with this question?
Select * From fnReadDataFromTable('TAB_0
Or, just use something like in below without a function call:
DECLARE @tablename AS NVARCHAR(261) = N'TAB_09082013';
EXECUTE(N'SELECT * FROM ' + @tablename);