Showing posts with label debugging. Show all posts
Showing posts with label debugging. Show all posts

Monday, March 26, 2012

No Debugging and logging when a single script task is executed

Hi,

I cannot execute a script task in the VBA code window.

I cannot debug or log if I run a single script task from the right click Execute Task .

Every time I have to run the entire package in order to be able to debug.

What am I missing?

appreciate a help.

Gulden

try disabling all the other tasks and/or containers except the script task. then, execute the package.

|||Thank You.. I guess it is the only way..|||

Gulden wrote:

Thank You.. I guess it is the only way..

If memory serves correctly, yes, it IS the only way.

We hope this will change in the future. It certainly SHOULD be changed!

-Jamie

Monday, February 20, 2012

Newbie: Now getting return value, but need help debugging OLE DB Command Transformation

Good morning, all,

OK, I have read a ton of posting on this issue, but either they don't give enough information or they are for packages which use the Execute SQL command, whereas I am using the OLE DB Command Data Flow Transformation.

I have an Excel spreadsheet that we are receiving from agencies with rows of client data which I have to load into an application that is ready to go live. I also have a stored procedure spClientsInsertRcd, which was written for the application. In the normal flow of the application, the stored procedure is called from a Coldfusion page, which does some processing prior to calling it. So, I have written a 'wrapper' stored procedure, spImportAgencyData, which does the processing and then calls the spClientInsertRcd.

My dataflow has the following components:

An Excel Source, containing my test data, consisting of just one row of data,

which points to a

Derived Column Transformation, which reformats the SSN and adds a user variable, named returnValue with an Expression value of @.[User::returnvariable] set to a four-byte signed integer, which (i think) I need to get the value out of the stored procedure.

which points to a

Data Conversion Transformation, which takes care of all the datatype conversions

which points to a

OLE DB Command, which contains the following as the SQL Command:

exec ?= spImportAgencyData ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?

In the OLE DB Command, I have mapped returnValue, my user variable to @.RETURN_VALUE.

Right now, I am in initial testing. The dataflow shows that it is succeeding, but my one data record for testing is not getting inserted. I need to get the value of returnValue to figure out what is happening.

How do I get the value of the returnValue? I have tried putting a recordset destination after the OLE DB command, but that just gives me the data that went into the OLE DB Command.

Thanks,
Kathryn

OK,

I have made a few changes to the package and I can get a return value. The problem is that the data, which is currently only one row in an Excel worksheet, is not getting loaded.

The OLE DB Command's SQL Command is now:

exec spImportAgencyData ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? output

with the final parameter being an output parameter. On the Column Mappings tab, I have mapped the output parameter @.returnValue which is in the Available Destination Columns to the returnValue variable (in the Available Input Columns) I created earlier in the Derived Column Transformation.

I have added a recordset Destination after the OLE DB Command and I only have the returnValue column in it.

The returnValue is always being returned as 0, which is either because I am not mapping it correctly or because the data is not getting loaded, I'm not sure which.

I can run the stored procedure from SQL Server Management Studio as

DECLARE @.returnValue int

EXEC [dbo].[spImportAgencyData]

@.URN = NULL,

@.FirstName = N'Kathryn',

@........

@.returnValue = @.returnValue OUTPUT

SELECT @.returnValue as N'@.returnValue'

and the correct new ClientID is returned, so the stored procedure is working. I have put a Data Viewer right before the OLE DB Command and run the stored procedure with the exact data coming from the Excel spreadsheet, just to double check and it runs and returns the new Client ID.

Does anyone have any tips on debugging this problem?

Thanks,
Kathryn

|||I had a similar issue (return a value from a stored procedure with 2 Varchar parameters), and eventually this is how I configured the Execute SQL Task:

General:

Connection Type: OLE DB
SQL Statemenet: EXEC ? = AUDIT.LoggingStoredProcedure ?, ?
Bypass Prepare: True

Parameter Mapping:

[Variable Name] | [Direction] | [Data Type] | [Parameter Name]
User::ReturnValue | Return Value | Long | 0
User::Parameter1 | Input | VARCHAR | 1
USer::Parameter2 | Input | VARCHAR | 2


Newbie: Now getting return value, but need help debugging OLE DB Command Transformation

Good morning, all,

OK, I have read a ton of posting on this issue, but either they don't give enough information or they are for packages which use the Execute SQL command, whereas I am using the OLE DB Command Data Flow Transformation.

I have an Excel spreadsheet that we are receiving from agencies with rows of client data which I have to load into an application that is ready to go live. I also have a stored procedure spClientsInsertRcd, which was written for the application. In the normal flow of the application, the stored procedure is called from a Coldfusion page, which does some processing prior to calling it. So, I have written a 'wrapper' stored procedure, spImportAgencyData, which does the processing and then calls the spClientInsertRcd.

My dataflow has the following components:

An Excel Source, containing my test data, consisting of just one row of data,

which points to a

Derived Column Transformation, which reformats the SSN and adds a user variable, named returnValue with an Expression value of @.[User::returnvariable] set to a four-byte signed integer, which (i think) I need to get the value out of the stored procedure.

which points to a

Data Conversion Transformation, which takes care of all the datatype conversions

which points to a

OLE DB Command, which contains the following as the SQL Command:

exec ?= spImportAgencyData ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?

In the OLE DB Command, I have mapped returnValue, my user variable to @.RETURN_VALUE.

Right now, I am in initial testing. The dataflow shows that it is succeeding, but my one data record for testing is not getting inserted. I need to get the value of returnValue to figure out what is happening.

How do I get the value of the returnValue? I have tried putting a recordset destination after the OLE DB command, but that just gives me the data that went into the OLE DB Command.

Thanks,
Kathryn

OK,

I have made a few changes to the package and I can get a return value. The problem is that the data, which is currently only one row in an Excel worksheet, is not getting loaded.

The OLE DB Command's SQL Command is now:

exec spImportAgencyData ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? output

with the final parameter being an output parameter. On the Column Mappings tab, I have mapped the output parameter @.returnValue which is in the Available Destination Columns to the returnValue variable (in the Available Input Columns) I created earlier in the Derived Column Transformation.

I have added a recordset Destination after the OLE DB Command and I only have the returnValue column in it.

The returnValue is always being returned as 0, which is either because I am not mapping it correctly or because the data is not getting loaded, I'm not sure which.

I can run the stored procedure from SQL Server Management Studio as

DECLARE @.returnValue int

EXEC [dbo].[spImportAgencyData]

@.URN = NULL,

@.FirstName = N'Kathryn',

@........

@.returnValue = @.returnValue OUTPUT

SELECT @.returnValue as N'@.returnValue'

and the correct new ClientID is returned, so the stored procedure is working. I have put a Data Viewer right before the OLE DB Command and run the stored procedure with the exact data coming from the Excel spreadsheet, just to double check and it runs and returns the new Client ID.

Does anyone have any tips on debugging this problem?

Thanks,
Kathryn

|||I had a similar issue (return a value from a stored procedure with 2 Varchar parameters), and eventually this is how I configured the Execute SQL Task:

General:

Connection Type: OLE DB
SQL Statemenet: EXEC ? = AUDIT.LoggingStoredProcedure ?, ?
Bypass Prepare: True

Parameter Mapping:

[Variable Name] | [Direction] | [Data Type] | [Parameter Name]
User::ReturnValue | Return Value | Long | 0
User::Parameter1 | Input | VARCHAR | 1
USer::Parameter2 | Input | VARCHAR | 2


newbie: logging for stored procs

ok when debugging a stored proc, yes i can see print output etc in sql
query analyzer. but when the proc is called in production, i dont see that
output; moreover, im new and wondering what are the typical ways that you
all log stuff from a stored proc, etc.
is something like this common?
http://www.databasejournal.com/feat...cle.php/1467591jimbo-black wrote:
> ok when debugging a stored proc, yes i can see print output etc in sql
> query analyzer. but when the proc is called in production, i dont
> see that output; moreover, im new and wondering what are the typical
> ways that you all log stuff from a stored proc, etc.
> is something like this common?
> http://www.databasejournal.com/feat...cle.php/1467591
Presumably, you have PRINT statements in procedures while they are in
development for debugging purposes and those PRINT statements are
removed for production. If what you need is a parameter-driven method to
execute a procedure with logging, then you can use conditional
statements in the procedure to log to a table as the article explains
(or even issue PRINT statements for interactive testing). In general,
though, it's better to do this type of work in development and keep your
procedure code to a minimum. For batch routines that might need to log
their lengthly processes and progress, a logging table would be the way
to go.
David Gugick
Quest Software
www.imceda.com
www.quest.com

newbie: logging for stored procs

ok when debugging a stored proc, yes i can see print output etc in sql
query analyzer. but when the proc is called in production, i dont see that
output; moreover, im new and wondering what are the typical ways that you
all log stuff from a stored proc, etc.
is something like this common?
http://www.databasejournal.com/features/mssql/article.php/1467591jimbo-black wrote:
> ok when debugging a stored proc, yes i can see print output etc in sql
> query analyzer. but when the proc is called in production, i dont
> see that output; moreover, im new and wondering what are the typical
> ways that you all log stuff from a stored proc, etc.
> is something like this common?
> http://www.databasejournal.com/features/mssql/article.php/1467591
Presumably, you have PRINT statements in procedures while they are in
development for debugging purposes and those PRINT statements are
removed for production. If what you need is a parameter-driven method to
execute a procedure with logging, then you can use conditional
statements in the procedure to log to a table as the article explains
(or even issue PRINT statements for interactive testing). In general,
though, it's better to do this type of work in development and keep your
procedure code to a minimum. For batch routines that might need to log
their lengthly processes and progress, a logging table would be the way
to go.
--
David Gugick
Quest Software
www.imceda.com
www.quest.com

newbie: logging for stored procs

ok when debugging a stored proc, yes i can see print output etc in sql
query analyzer. but when the proc is called in production, i dont see that
output; moreover, im new and wondering what are the typical ways that you
all log stuff from a stored proc, etc.
is something like this common?
http://www.databasejournal.com/featu...le.php/1467591
jimbo-black wrote:
> ok when debugging a stored proc, yes i can see print output etc in sql
> query analyzer. but when the proc is called in production, i dont
> see that output; moreover, im new and wondering what are the typical
> ways that you all log stuff from a stored proc, etc.
> is something like this common?
> http://www.databasejournal.com/featu...le.php/1467591
Presumably, you have PRINT statements in procedures while they are in
development for debugging purposes and those PRINT statements are
removed for production. If what you need is a parameter-driven method to
execute a procedure with logging, then you can use conditional
statements in the procedure to log to a table as the article explains
(or even issue PRINT statements for interactive testing). In general,
though, it's better to do this type of work in development and keep your
procedure code to a minimum. For batch routines that might need to log
their lengthly processes and progress, a logging table would be the way
to go.
David Gugick
Quest Software
www.imceda.com
www.quest.com