Monday, March 26, 2012
Passing error description to failure task in DTS
I have a bunch of packages that implement the same "on error" task as an Execute Package Task (in other words, my error handling task is its own seperate package). In each package that implements that error task, I set a global variable with the task name whose failure I'm trapping. Then in the error handling task I read the value of the global variable to fill an email notification.
If I knew how to trap the actual error, either in a global variable or with script, I'd stick that in a global variable and do the same thing, so maybe if someone knows how to do that...
Friday, March 9, 2012
Pass variable value to DataReader Source
Dear All,
I have created a DTS Package in Integration Services 2005.
Within the DTS Package declared a variable named xxx and passed a value 1234.
In the control flow i dropped a Data flow task and in the Property Expression Editor of DataFlow Task i defined
Property = [DataReader Source].[sqlCommand]
Expression = Variable name.
Now in the DataFlow Task Canvas dropped DataReaderSource.
How can i pass variable value to the SQLCommand ="Select * from table where name = Variable value.
regards
Sufian
This post explains how to do that...
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2009522&SiteID=1
|||sorry , i have a diffrent problem.
I need to know how can i pass the variable value to the query supplied in the SQLCommand custom properties in datareader source on execution.
the variable datatype is Int32 and i am getting error when i set the expression property in the expression builder (Cannot convert System.Int32 to System.String).
Regards
Sufian
|||
mohd sufian wrote:
the variable datatype is Int32 and i am getting error when i set the expression property in the expression builder (Cannot convert System.Int32 to System.String).
You can't concatenate a string with an integer. You'll have to cast the integer as a string and THEN concatenate.
The cast operator is:
(DT_STR, <length>, <code_page>) variable_value
Code page will probably be 1252.
-Jamie
Wednesday, March 7, 2012
pass thru queries to Oracle
servers. I don't want to use DTS. While it's easy enough to use OPENQUERY
to pass thru a query that returns a dataset, I can't seem to pass thru a
query that doesn't return a dataset eg a create table query or a drop table
query. If I try, I get an error saying that the query returns no columns.
Is it possible to pass thru a query that returns no columns using a linked
server?
For example, the following query:
select *
from OPENQUERY(ORA8I,'CREATE TABLE MYTABLE AS SELECT * FROM EMP')
returns the error:
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'CREATE TABLE MYTABLE AS SELECT * FROM EMP'. The
OLE DB provider 'MSDAORA' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to process
object, since the object has no columnsProviderName='MSDAORA', Query=CREATE
TABLE MYTABLE AS SELECT * FROM EMP'].....OR ....
use::
SELECT * INTO #EMP from ORA1..CAT1.EMP
to get the same effect!!
"arch" wrote:
> I'm trying to pass a query from sql server 2000 to Oracle using linked
> servers. I don't want to use DTS. While it's easy enough to use OPENQUER
Y
> to pass thru a query that returns a dataset, I can't seem to pass thru a
> query that doesn't return a dataset eg a create table query or a drop tabl
e
> query. If I try, I get an error saying that the query returns no columns.
> Is it possible to pass thru a query that returns no columns using a linked
> server?
> For example, the following query:
> select *
> from OPENQUERY(ORA8I,'CREATE TABLE MYTABLE AS SELECT * FROM EMP')
> returns the error:
> Server: Msg 7357, Level 16, State 2, Line 1
> Could not process object 'CREATE TABLE MYTABLE AS SELECT * FROM EMP'. The
> OLE DB provider 'MSDAORA' indicates that the object has no columns.
> OLE DB error trace [Non-interface error: OLE DB provider unable to proces
s
> object, since the object has no columnsProviderName='MSDAORA', Query=CREAT
E
> TABLE MYTABLE AS SELECT * FROM EMP'].
>
>|||arch,
Are you simply attempting to create a temp table on the SQL side dependant
on data from the Oracle side?
If so, then the reference to Oracle needs to be on the SELECT object.
We use linked servers from SQL to Oracle as a matter of day-to-day business
and I use something along the following lines (where ORA1 is the linked
server name as listed in the Security tabl of EntMgr):::
CREATE TABLE #EMP (x,y,z)
INSERT INTO #EMP
SELECT X,Y,Z
FROM ORA1..CAT1.EMP a
This, of course, indicates you know the schema or at least the columns you
want (remember you should reduce loads by not selecting redundant data), and
their respective datatypes.
Hope this assists,
Tony
"arch" wrote:
> I'm trying to pass a query from sql server 2000 to Oracle using linked
> servers. I don't want to use DTS. While it's easy enough to use OPENQUER
Y
> to pass thru a query that returns a dataset, I can't seem to pass thru a
> query that doesn't return a dataset eg a create table query or a drop tabl
e
> query. If I try, I get an error saying that the query returns no columns.
> Is it possible to pass thru a query that returns no columns using a linked
> server?
> For example, the following query:
> select *
> from OPENQUERY(ORA8I,'CREATE TABLE MYTABLE AS SELECT * FROM EMP')
> returns the error:
> Server: Msg 7357, Level 16, State 2, Line 1
> Could not process object 'CREATE TABLE MYTABLE AS SELECT * FROM EMP'. The
> OLE DB provider 'MSDAORA' indicates that the object has no columns.
> OLE DB error trace [Non-interface error: OLE DB provider unable to proces
s
> object, since the object has no columnsProviderName='MSDAORA', Query=CREAT
E
> TABLE MYTABLE AS SELECT * FROM EMP'].
>
>|||That's very useful stuff. But what I wanted to do was to create a table in
the oracle database. In microsoft access, it is very easy to execute a pass
thru query to Oracle, including action queries such as creating and dropping
objects. I can't seem to do that using SQL Server unless I use DTS. Is it
possible to do?
"Tony Scott" <TonyScott@.discussions.microsoft.com> wrote in message
news:90D78160-8F51-4BC2-8F06-D2226A10F95A@.microsoft.com...
> arch,
> Are you simply attempting to create a temp table on the SQL side dependant
> on data from the Oracle side?
> If so, then the reference to Oracle needs to be on the SELECT object.
> We use linked servers from SQL to Oracle as a matter of day-to-day
> business
> and I use something along the following lines (where ORA1 is the linked
> server name as listed in the Security tabl of EntMgr):::
> CREATE TABLE #EMP (x,y,z)
> INSERT INTO #EMP
> SELECT X,Y,Z
> FROM ORA1..CAT1.EMP a
> This, of course, indicates you know the schema or at least the columns you
> want (remember you should reduce loads by not selecting redundant data),
> and
> their respective datatypes.
> Hope this assists,
> Tony
> "arch" wrote:
>