Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Friday, March 30, 2012

Having problems using Breakpoint in Script Task.

I am still pretty new to SSIS, SQL, and DOT NET. I came from the UNIX world. I have a SSIS package. On the Control Flow one of the Items I have is a Script Task. I was able to successfully set breakpoints in the Script Task and they worked fine.I could step through the script and check values in variables.Life was good.

Now something happened.I set the breakpoint, from the menu I select “start with debugging” and I get the following window:

-- -

Visual Studio Just-In-Time Debugger

An unhandled exception (‘System.Runtime.InteropServices.COMException’) occurred in DTAttach.exe [3380].

Possible Debuggers:

New instance of Microsoft CLR Debugger 2003

New instance of Visual Studio .NET 2003

New instance of Visual Studio 2005

[_] set the currently selected debugger as the default

[_] Manually choose the debugging engines

Do you want to debug using the selected debugger?

--

I have tried selecting Yes, but that doesn’t work.If I delete all breakpoints the package runs fine.I greatly appreciate your help.

You are not alone.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1846879&SiteID=1|||Thanks Phil. I found a work around for my problems and posted it on the thread you provided the link to above.

Friday, March 23, 2012

have SQL Server Mgmt Studio save alter table script when change table?

Is there a way to have SQL Server Management Studio save the script for
everything necessary to alter a table when changing the design of a table?
The older Visual Studio interfaces would allow this - maybe I can discover w
here
to turn that on in Visual Studio 2005?
--
Thanks in advance, Les CaudleHello Les,
If I understand the issue correctly, you'd like to save the script for
alterring a table when you change the design of the table in Managment
Studio.
You could use the following method to see if it meets your requirement:
1. Right click a table->Design to open the table in design view.
2. Do the change you want for the table.
3. Right click the blank area of the design view->Genegrate Change Script.
Also, If you have any feedback or wishes on SQL Server, I encourage you
submit via the link below and our product team would like to hear your
voice:
http://lab.msdn.microsoft.com/produ...ck/default.aspx
Please let's know if you have any further qusetions. Thanks.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
========================================
==========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications
<http://msdn.microsoft.com/subscript...ps/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscript...rt/default.aspx>.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hello Les,
I'm still interested in this issue. If you have any comments or questions,
please feel free to let's know. We look forward to hearing from you.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

have SQL Server Mgmt Studio save alter table script when change table?

Is there a way to have SQL Server Management Studio save the script for
everything necessary to alter a table when changing the design of a table?
The older Visual Studio interfaces would allow this - maybe I can discover where
to turn that on in Visual Studio 2005?
Thanks in advance, Les Caudle
Hello Les,
If I understand the issue correctly, you'd like to save the script for
alterring a table when you change the design of the table in Managment
Studio.
You could use the following method to see if it meets your requirement:
1. Right click a table->Design to open the table in design view.
2. Do the change you want for the table.
3. Right click the blank area of the design view->Genegrate Change Script.
Also, If you have any feedback or wishes on SQL Server, I encourage you
submit via the link below and our product team would like to hear your
voice:
http://lab.msdn.microsoft.com/productfeedback/default.aspx
Please let's know if you have any further qusetions. Thanks.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
|||Hello Les,
I'm still interested in this issue. If you have any comments or questions,
please feel free to let's know. We look forward to hearing from you.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
sql

have SQL Server Mgmt Studio save alter table script when change table?

Is there a way to have SQL Server Management Studio save the script for
everything necessary to alter a table when changing the design of a table?
The older Visual Studio interfaces would allow this - maybe I can discover where
to turn that on in Visual Studio 2005?
--
Thanks in advance, Les CaudleHello Les,
If I understand the issue correctly, you'd like to save the script for
alterring a table when you change the design of the table in Managment
Studio.
You could use the following method to see if it meets your requirement:
1. Right click a table->Design to open the table in design view.
2. Do the change you want for the table.
3. Right click the blank area of the design view->Genegrate Change Script.
Also, If you have any feedback or wishes on SQL Server, I encourage you
submit via the link below and our product team would like to hear your
voice:
http://lab.msdn.microsoft.com/productfeedback/default.aspx
Please let's know if you have any further qusetions. Thanks.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hello Les,
I'm still interested in this issue. If you have any comments or questions,
please feel free to let's know. We look forward to hearing from you.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Monday, February 27, 2012

Handling variables

I have a script task that has a ReadWriteVariable = FilePath. I am doing the following below to calculate the FilePath variable. Instead of the output being C:\Rapagator\Downloaded\RETS_Search_ResidentialProperty_20060403094343.txt, it just shows RETS_Search_ResidentialProperty_20060403094343.txt. Any ideas how to resolve this problem?

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper

Public Class ScriptMain
Inherits UserComponent
Public GetFilePath As String = ""

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
GetFilePath = "C:\Rapagator\Downloaded" + Row.FileName
End Sub
Public Overrides Sub PostExecute()
Variables.FilePath = GetFilePath
MyBase.PostExecute()
End Sub

End Class

How do you know the variable value is only the filename part you state? You cannot debug inside the Script Component, so perhaps add a MessageBox or log an event to write out the values you have just to be sure. Perhaps set a breakpoint as well and add the variable to the watch window. You do know that the Variables window only shows design-time values during runtime, even when completed or stopped on a breakpoint. Use the watch window to get real values. This does seem rather strange, are you only expecting one row to flow through this component; otherwise you will only store the last row's value in the variable. Is that what you want?


Does the filename start with a "\" ? If not the path looks invalid - C:\Rapagator\DownloadedMYFILE. Top tip, use System.IO.Path.Combine(x, y) as that will sort out path qualifiers for you.