Re: Dynamic Table Name is Source Query

From: Darren Green (darren.green_at_reply-to-newsgroup-sqldts.com)
Date: 03/08/04


Date: Mon, 8 Mar 2004 21:17:25 +0000

In message <FD336A20-0B7D-4B69-BE12-818154F4BDEB@microsoft.com>, Dave
Wong <anonymous@discussions.microsoft.com> writes
>I'm new to SQLServer, I have posted this question before in this forum.
>With my luck, I still can't get the machine to do what it suppose to do
>:-(.

>My task is to download a table from Oracle which the table name is
>contained in another table (cyclic_tbl_ctrl) based on date, which
>cyclic_tbl_ctrl contains 2 fields (ie. table_name: monthly_usage_02
>table_yrmth 200401, so I find the table name by "select table_name from
>cyclic_tbl_ctrl where yrmth = 200401" ). After if find the table_name,
>this "table_name" becomes the table where I get the data from. I have
>lookup books and other source for few days and still out of luck.
>Doesn't anyone nice enough to give me an example on this? Thanks.

Add an Exec SQL Task with the query in to return the table name. Use an
output parameter (Row value) to store this in a global variable.

Then use a dynamic properties task to take the global variable and
assign it to the SourceObjectName property of your DataPump task.

-- 
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com
PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org


Relevant Pages

  • Re: Dynamic Table Name is Source Query
    ... I might be asking too mcuh, I only want to extract part of the table, but how do I embed the table name in a SQL? ... >lookup books and other source for few days and still out of luck. ... Then use a dynamic properties task to take the global variable and ... assign it to the SourceObjectName property of your DataPump task. ...
    (microsoft.public.sqlserver.dts)
  • Re: Dynamic Table Name is Source Query
    ... Global Variables and SQL statements in DTS ... >>lookup books and other source for few days and still out of luck. ... > assign it to the SourceObjectName property of your DataPump task. ...
    (microsoft.public.sqlserver.dts)
  • Re: General Question: Single Quotes in Text Fields
    ... StoredPrcedure in the SQL server, when single quote involved. ... Good Luck ... to morph apostrophes into some other character or just delete them ...
    (microsoft.public.access.modulesdaovba)
  • Provider not found
    ... occur with any ODBC or SQL based database, not just MS SQL Server. ... controls connected to a Sybase database. ... I re-applied the SQL server SP 3 - no luck ... I found these in my i386 folder. ...
    (microsoft.public.sqlserver.odbc)
  • Re: Need help with ASP.NET website administration tool! - Cant connect to the database when clic
    ... I have done as you directed but no luck ... Here is the ConnectionStrings code from the machine.config file ... DEV is our SQL Server 2000 so I tried using both the servers but no ...
    (microsoft.public.dotnet.framework.aspnet.security)

Quantcast