Saving Values Of A Variable

Dec 13, 2006

Hi all,

As there is no support of check points at data flow component level, we are trying to implement this on our own. In the process of implementing we have to save values of certain user defined variables in to an xml file. To do this, we added a data flow task in the event handler OnTaskFailure. Now we want to save values of the variables in to an xml file in the data flow. Can you please suggest me how can we save values of variables in an event handler?

Cheers,

Gopi

View 1 Replies


ADVERTISEMENT

SQL For Saving A Value In A Variable

Jun 15, 2008

 Hello Im having a little problem getting some values from a database.....
What I need is to get the value of the keyfield of the last entry introduced, I know how to to do the SQL statement for this, the problem is that i dont know how to save this value in a variable. I need to save this value in a variable in the session object or in a hidden field, and then use this variable in another different page. That's way i need to save this ID value, later in the other page I introduce data in a different table and one of the fields has to be this ID value which I have as a foreign key in the table so I need to use the same value in all the rows i introduce(Id value).
If you know how to accomplish this let me know, many thanks, Sergio

View 6 Replies View Related

Saving Value Returned By Select In Variable

Jul 16, 2007

What is the syntax for saving a single value returned by a Select statement in a variable? I have tried the following, but its telling me I "Must declare the variable '@TempCount'." which is already declared!


SET @SQL = 'Select @TempCount = count(*) FROM ' + @TblName + ' WHERE ' + .......
exec(@SQL)

View 1 Replies View Related

Saving Values

Aug 10, 2007

Hi All
2 post in a row first time in ages so i must be getting better but i get stuck on crappy little things like this hopefully
I have data in the following format
4.1399999999999997
4.2400000000000002
5.4800000000000004
5.1799999999999997
6.7699999999999996
i want to select the data as such
4.13
4.24
5.48
5.17
6.76
I keep chasing my tale on this one around and around any one got a simple idea i am missing, you would not believe how much time i have spent on this.
Cheers
Phil

View 15 Replies View Related

Transact SQL :: Insert Values From Variable Into Table Variable

Nov 4, 2015

CREATE TABLE #T(branchnumber VARCHAR(4000))

insert into #t(branchnumber) values (005)
insert into #t(branchnumber) values (090)
insert into #t(branchnumber) values (115)
insert into #t(branchnumber) values (210)
insert into #t(branchnumber) values (216)

[code]....

I have a parameter which should take multiple values into it and pass that to the code that i use. For, this i created a parameter and temporarily for testing i am passing some values into it.Using a dynamic SQL i am converting multiple values into multiple records as rows into another variable (called @QUERY). My question is, how to insert the values from variable into a table (table variable or temp table or CTE).OR Is there any way to parse the multiple values into a table. like if we pass multiple values into a parameter. those should go into a table as rows.

View 6 Replies View Related

Custom Task Not Updating Property Values Or Saving.

May 2, 2008

Hi Folks,

I have a task I wrote which does not always update the property value (as seen in the properties pane)
Basically, change something on the form, then update the task host property with:
this.taskHostValue.Properties["Duration"].SetValue(this.taskHostValue, Convert.ToInt32(spnDuration.Value));

Stepping through this, it does exactly what it is supposed to. Having a look at the property value, it confirms it has changed.
Reopening the UI and resetting all the controls returns the expected results.

The package however does not realise it has changed. There is no * next to the package name in the top tabs.
As long as the package thinks it is unchanged, SaveXML does not get called either so the tasks do not persist.

Changing the value on the properties pane works fine though.

The frustrating thing is this is slightly random. Slight in the sense that sometimes it works but most of the time it does not.


The sample code I used was the MS download IncrementTask (Which works BTW) so I can't see it as being a VS / SSIS bug but rather something I am / am not doing. 3 tasks I have written all behave the same. I have to "nudge" them before savign the package.

Any ideas what the problem might be?



TIA


Cheers,
Crispin

View 3 Replies View Related

Problem In Saving Page Contents I.e; Textbox And Dropdownlist Values Please Help

Feb 29, 2008

Hi all,please have a look of code i am unable to perform save operation onthe asp.net web page.I ahve written a stored procedure. the same code works if all aretextboxes, but some of textbox replaced with dropdownlist box thenthis save operation doesn't occurs. please let me know where is themistake in coding .vb.net code :- Protected Sub btnSave_Click(ByVal sender As Object, ByVal e AsEventArgs)        Dim employmentID As Integer =Request.QueryString("employmentID")        Dim resourceID As Integer = Request.QueryString("resourceID")        Dim projectID As Integer = Request.QueryString("ProjectID")        Dim dbconsave As SqlConnection        dbconsave = New SqlConnection(HRISDBConnectionString)        Dim dbcomsave As New SqlCommand("sp_save_NewHireEmailnotify",dbconsave)        dbcomsave.CommandType = CommandType.StoredProcedure        dbcomsave.Parameters.Add(New SqlParameter("employmentID",SqlDbType.Int))        dbcomsave.Parameters("employmentID").Value = employmentID        dbcomsave.Parameters.Add(New SqlParameter("resourceID",SqlDbType.Int))        dbcomsave.Parameters("resourceID").Value = resourceID        dbcomsave.Parameters.Add(New SqlParameter("ProjectID",SqlDbType.Int))        dbcomsave.Parameters("ProjectID").Value = projectID        dbconsave.Open()        dbcomsave.Parameters.Add("@PreferredFirstName",SqlDbType.VarChar)        dbcomsave.Parameters.Item("@PreferredFirstName").Value =txtPreferredFirstName.Text.ToString()        dbcomsave.Parameters.Add("@PreferredLastName",SqlDbType.VarChar)        dbcomsave.Parameters.Item("@PreferredLastName").Value =txtPreferredLastName.Text.ToString()        dbcomsave.Parameters.Add("@CellPhone", SqlDbType.VarChar)        dbcomsave.Parameters.Item("@CellPhone").Value =txtCellPhone.Text.ToString()        dbcomsave.Parameters.Add("@HomePhone", SqlDbType.VarChar)        dbcomsave.Parameters.Item("@HomePhone").Value =txtHomePhone.Text.ToString()        dbcomsave.Parameters.Add("@HomeAddressLine1",SqlDbType.VarChar)        dbcomsave.Parameters.Item("@HomeAddressLine1").Value =txtHomeAddressLine1.Text.ToString()        dbcomsave.Parameters.Add("@HomeAddressLine2",SqlDbType.VarChar)        dbcomsave.Parameters.Item("@HomeAddressLine2").Value =txtHomeAddressLine2.Text.ToString()        dbcomsave.Parameters.Add("@HomeAddressState",SqlDbType.VarChar)        dbcomsave.Parameters.Item("@HomeAddressState").Value =txtHomeAddressState.Text.ToString()        dbcomsave.Parameters.Add("@HomeAddressCity",SqlDbType.VarChar)        dbcomsave.Parameters.Item("@HomeAddressCity").Value =txtHomeAddressCity.Text.ToString()        dbcomsave.Parameters.Add("@HomeAddressZIP", SqlDbType.VarChar)        dbcomsave.Parameters.Item("@HomeAddressZIP").Value =txtHomeAddressZIP.Text.ToString()        dbcomsave.Parameters.Add("@HomeAddressCountry",SqlDbType.VarChar)        dbcomsave.Parameters.Item("@HomeAddressCountry").Value =txtHomeAddressCountry.Text.ToString()        dbcomsave.Parameters.Add("@ArrangementType",SqlDbType.VarChar)        dbcomsave.Parameters.Item("@ArrangementType").Value =ddlArrangementType.SelectedItem.ToString()        dbcomsave.Parameters.Add("@PracticeGroup", SqlDbType.VarChar)        dbcomsave.Parameters.Item("@PracticeGroup").Value =ddlPracticeGroup.SelectedItem.ToString()        dbcomsave.Parameters.AddWithValue("@EquipmentNeeds",txtEquipmentNeeds.Text.ToString())        Try            dbcomsave.ExecuteNonQuery()            lblMessage.Text = "Record saved successfully"        Catch ex As Exception        End Try        dbconsave.Close()    End Sub==============================================================================.aspx code :-<table>                                 <tr>                                    <td >                                        <asp:LabelID="lblPreferredFirstName" runat="server" Text="Name(Preferred FirstLast) :" ForeColor="Blue"></asp:Label>                                    </td>                                    <td                                        <asp:TextBoxID="txtPreferredFirstName" runat="server" Text="" BorderStyle="None"></asp:TextBox>&nbsp;&nbsp;                                        <asp:TextBoxID="txtPreferredLastName" runat="server" Text="" BorderStyle="none" ></asp:TextBox>                                    </td>                                </tr>                <tr>                                    <td >                                        <asp:Label ID="lblCellPhone"runat="server" Text="CellPhone :" ForeColor="Blue"></asp:Label>                                    </td>                                    <td >                                        <asp:TextBox ID="txtCellPhone"runat="server" Text="" ></asp:TextBox>                                    </td>                                </tr>                <tr>                                    <td >                                        <asp:Label ID="lblHomePhone"runat="server" Text="HomePhone :" ForeColor="Blue"></asp:Label>                                    </td>                                    <td >                                        <asp:TextBox ID="txtHomePhone"runat="server" Text="" ></asp:TextBox>                                    </td>                                </tr>                <tr>                                    <td >                                        <asp:LabelID="lblHomeAddressLine1" runat="server" Text="HomeAddressLine1 :"ForeColor="Blue"></asp:Label>                                    </td>                                    <td >                                        <asp:TextBoxID="txtHomeAddressLine1" runat="server" Text="" ></asp:TextBox>                                    </td>                                </tr>                                <tr>                                    <td >                                        <asp:LabelID="lblHomeAddressLine2" runat="server" Text="HomeAddressLine2 :"ForeColor="Blue"></asp:Label>                                    </td>                                    <td >                                        <asp:TextBoxID="txtHomeAddressLine2" runat="server" Text="" ></asp:TextBox>                                    </td>                                </tr>                                <tr>                                    <td >                                        <asp:LabelID="lblHomeAddressState" runat="server" Text="HomeAddressState :"ForeColor="Blue"></asp:Label>                                    </td>                                    <td >                                        <asp:TextBoxID="txtHomeAddressState" runat="server" Text="" ></asp:TextBox>                                    </td>                                </tr>                                <tr>                                    <td >                                        <asp:LabelID="lblHomeAddressCity" runat="server" Text="HomeAddressCity :"ForeColor="Blue"></asp:Label>                                    </td>                                    <td >                                        <asp:TextBoxID="txtHomeAddressCity" runat="server" Text="" ></asp:TextBox>                                    </td>                                </tr>                                <tr>                                    <td >                                        <asp:LabelID="lblHomeAddressZIP" runat="server" Text="HomeAddressZIP :"ForeColor="Blue"></asp:Label>                                    </td>                                    <td >                                        <asp:TextBoxID="txtHomeAddressZIP" runat="server" Text="" ></asp:TextBox>                                    </td>                                </tr>                                <tr>                                    <td >                                        <asp:LabelID="lblHomeAddressCountry" runat="server" Text="HomeAddressCountry :"ForeColor="Blue"></asp:Label>                                    </td>                                    <td >                                        <asp:TextBoxID="txtHomeAddressCountry" runat="server" Text="" ></asp:TextBox>                                    </td>                                </tr>                <tr>                                    <td >                                        <asp:Label ID="lblArrangement"runat="server" Text="Arrangement :" ForeColor="Blue"></asp:Label>                                    </td>                                    <td >                                        <asp:DropDownListID="ddlArrangementType" runat="server" Width="160px"DataSourceID="ObjectDataSourceArrangementType"DataTextField="ArrangementType" DataValueField="ArrangementType"OnDataBound="ddlArrangementType_DataBound">                                        </asp:DropDownList>                                        <%--<asp:TextBoxID="txtArrangement" runat="server" Text="" ></asp:TextBox>--%>                                    </td>                                </tr>                 <tr>                                    <td >                                        <asp:LabelID="lblPracticeGroup" runat="server" Text="Practice Group :"ForeColor="Blue"></asp:Label>                                    </td>                                    <td >                                        <asp:DropDownListID="ddlPracticeGroup" runat="server" Width="160px"DataSourceID="ObjectDataSourcePracticeGroup"DataTextField="PracticeGroup" DataValueField="PracticeGroup"OnDataBound="ddlPracticeGroup_DataBound">                                        </asp:DropDownList>                                        <%--<asp:TextBoxID="txtPracticeGroup" runat="server" Text="" ></asp:TextBox> --%>                                    </td>                                </tr></table>please help me to solve the issue.Thanks in advance 

View 3 Replies View Related

Variable Insert To SQL Server Insert Satement Setting Values For The @variable INSIDE Sql

Apr 29, 2007

ok, I am on Day 2 of being brain dead.I have a database with a table with 2 varchar(25) columns I have a btton click event that gets the value of the userName,  and a text box.I NEED to insert a new row in a sql database, with the 2 variables.Ive used a sqldatasource object, and tried to midify the insert parameters, tried to set it at the button click event, and NOTHING is working. Anyone have a good source for sql 101/ASP.Net/Braindead where I can find this out, or better yet, give me an example.  this is what I got <%@ Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">     protected void runit_Click(object sender, EventArgs e)    {       //SqlDataSource ID = "InsertExtraInfo".Insert();      //SqlDataSource1.Insert();    }      protected void Button1_Click1(object sender, EventArgs e)    {        SqlDataSource newsql;                newsql.InsertParameters.Add("@name", "Dan");        newsql.InsertParameters.Add("@color", "rose");        String t_c = "purple";        string tempname = Page.User.Identity.Name;        Label1.Text = tempname;        Label2.Text = t_c;        newsql.Insert();    }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server">    <title>mini update</title></head><body>    <form id="form1" runat="server">        &nbsp;name<asp:TextBox ID="name" runat="server" OnTextChanged="TextBox2_TextChanged"></asp:TextBox><br />        color        <asp:TextBox ID="color" runat="server"></asp:TextBox><br />        <br />        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="Button" />        &nbsp;<br />        set lable =&gt;<asp:Label ID="Label1" runat="server" Text="Label" Width="135px" Visible="False"></asp:Label><br />        Lable 2 =&gt;        <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label><br />        Usernmae=&gt;<asp:LoginName ID="LoginName1" runat="server" />        <br />        <br />        <br />        <br />        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"            ConnectionString="<%$ ConnectionStrings:newstring %>" DeleteCommand="DELETE FROM [favcolor] WHERE [name] = @original_name AND [color] = @original_color"            InsertCommand="INSERT INTO [favcolor] ([name], [color]) VALUES (@name, @color)"            OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [name], [color] FROM [favcolor]"            UpdateCommand="UPDATE [favcolor] SET [color] = @color WHERE [name] = @original_name AND [color] = @original_color">            <DeleteParameters>                <asp:Parameter Name="original_name" Type="String" />                <asp:Parameter Name="original_color" Type="String" />            </DeleteParameters>            <UpdateParameters>                <asp:Parameter Name="color" Type="String" />                <asp:Parameter Name="original_name" Type="String" />                <asp:Parameter Name="original_color" Type="String" />            </UpdateParameters>            <InsertParameters>        <asp:InsertParameter("@name", "Dan", Type="String" />        <asp:InsertParameter("@color", "rose") Type="String"/>                                       </InsertParameters>        </asp:SqlDataSource>        &nbsp;        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"            AutoGenerateColumns="False" DataKeyNames="name" DataSourceID="SqlDataSource1">            <Columns>                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />                                <asp:BoundField DataField="color" HeaderText="color" SortExpression="color" />                <asp:BoundField DataField="name" HeaderText="name" ReadOnly="True" SortExpression="name" />            </Columns>        </asp:GridView>           </form></body></html>  

View 1 Replies View Related

Automating A Query And The Saving Saving Of Subsequent Results

Dec 13, 2007

Hi Guys,

I am trying to automate a basic task using SQL Server 2005 Express.

Currently I have a query script that I run and then save the results as a CSV file. I need to do this on a daily basis and so I am looking to find out how best to go about this. There are a multitude of third party tools that claim to be able to do this - can anyone recommend this or enlighten me of the best way to set up this automation.

All ideas gratefully received!

View 1 Replies View Related

Variable Between Two Values

Apr 12, 2008



I need to valorate a variable like this:
If VAR1 is Between 1 and 10 entonces vari2= x
else

var2=Y

how can valora if var1 is "between two values"?

View 3 Replies View Related

Log Variable Values

Aug 28, 2007

Is it possible to save variable values to the log file? I have a for each loop that loops through customer orders and I would like to know the order number when the package fails.

View 1 Replies View Related

Display Of Variable Values

Sep 23, 2004

Hello Experts:

I want to access the values coming from the table but my code is just printing the varibale name.

e.g. It is printing right now

@lev0
@lev1
@lev2
@lev3
@lev4

but infact in variable @lev1, the actual value from table is [prodcut]. the value in varibale @lev1 is [category].

Can you pl. help me?

--- My code

Declare

@lev0 varchar(50),
@lev1 varchar(50),
@lev2 varchar(50),
@lev3 varchar(50),
@lev4 varchar(50),
@stmnt varchar(2000),
@counter int,
@st varchar(50)

Select @lev0=Dimnsion, @Lev1= Lev1, @Lev2= Lev2, @Lev3= Lev3, @lev4= lev4 from dbo.Lookup where dimnsion = '[Product]'
Set @counter = 0

while @counter < 5
begin
set @st = '@lev'+cast(@counter as varchar(50))
print @st
set @counter= @counter+1

end

-------

Thanks

View 1 Replies View Related

Variable Values Containing Dashes

Nov 8, 2006

Ok. Here is a weird problem.

I have a package which contains a variable with the value of a UNC sharename. The hostname in the share contains dashes.

I am trying to create a SQL Agent entry to execute said package. Because the package is now in production I want to pass in a new value for the sharename variable. I use the SQL @@SERVERNAME variable to build the package command. (Notice the BlotterUploadFolder variable at the end.)

SELECT @command = N'/FILE "\' + @@SERVERNAME + 'PackagesMiddleOfficeReconcilliationImportManualBlotter_AccountTransfers.dtsx" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING EW /CONNECTION MiddleOfficeDb;"Data Source=' + @@SERVERNAME + ';Initial Catalog=MiddleOffice;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;" /SET package.variables[BlotterUploadFolder].Value;\' + @@SERVERNAME + 'ManualBlottersUploads'

If I print the @command variable right after setting it, I get what I expect.

/FILE "\PRD-NY-DB-01PackagesMiddleOfficeReconcilliationImportManualBlotter_AccountTransfers.dtsx" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING EW /CONNECTION MiddleOfficeDb;"Data Source=PRD-NY-DB-01;Initial Catalog=MiddleOffice;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;" /SET package.variables[BlotterUploadFolder].Value;\PRD-NY-DB-01ManualBlottersUploads

If I cut-paste this into cmd window and execute it with DTExec.exe the package works fine. But when I run the schedule task it causes an error. When I go into the Job Properties dialog to look at the step, I see the value (in the "Set values" table) set to \PRD instead of \PRD-NY-DB-01.

If I modify the SELECT command above to put double-quotes around the value, the value is correct in the Job Properties dialog but causes an error when I exec it with DTExec.

/FILE "\PRD-NY-DB-01PackagesMiddleOfficeReconcilliationImportManualBlotter_AccountTransfers.dtsx" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING EW /CONNECTION MiddleOfficeDb;"Data Source=PRD-NY-DB-01;Initial Catalog=MiddleOffice;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;" /SET package.variables[BlotterUploadFolder].Value;"\PRD-NY-DB-01ManualBlottersUploads"

causes the error

Option "-NY" is not valid.

Hopefully somebody has an idea of what is going on.

Thanks.

- Jason

View 3 Replies View Related

Populate Variable Values

Nov 16, 2006

Hi

How can I populate values for package variables inside a data flow task? I could do this inside a script task in control tab, but how inside a data flow task?

Thanks

Ramani



View 1 Replies View Related

How Do You Pass Values From VB To A DTS Global Variable?

Jun 24, 2002

I am trying to pass a value from a VB Custom Task to
a DTS. The DTS doesn't get the value and I do not understand
why. Snipet follows:

oPKG.GlobalVariables.Item("gsAnyTypeData").Value = "Hello World"
oPKG.GlobalVariables.AddGlobalVariable ("gsAnyTypeData"), "Hello World"
oPKG.LoadFromSQLServer ".", , , 256, , , , DTSpackage_to_execute
oPKG.Execute

I've tried declaring the global variable in the called DTS and
I've tried without it. Neither contain the value when the DTS is
executed.

Thanks for your time and help,
Martin

View 3 Replies View Related

Collecting Values Into A Variable In A Loop

Mar 13, 2006

Dear All,

I’m trying to collect values from a query into a single variable within a loop, like so:

WHILE condition is true
BEGIN

SET @intLoop = @intLoop + 1

@myString = @myString + ‘, ‘ + (SELECT companyName FROM @tblTheseComp WHERE id = @intLoop

END

For some reason though the @myString does not collect up the values, but will equal NULL at the end of the loop.

If however I simple do

WHILE condition is true
BEGIN

SET @intLoop = @intLoop + 1

@myString = (SELECT companyName FROM @tblTheseComp WHERE id = @intLoop
END


Then I get the last value from the query as expected.

Can anyone explain why this might be?

Thanks in advance!

View 7 Replies View Related

Can Store A List Of Values In A Variable?

Apr 16, 2014

I'm looking for a way to store a list of values in a variable. The query user will need to input a list of file numbers, and my query will need to perform a couple operations on that same list of values, which is why it seems a variable would be most appropriate.

I can't obtain the list of values from the database as they will have to be entered by the user. I'm imagining storing these in a table variable.... User just copies/pastes the list of values somewhere into the query code and executes as usual.

View 7 Replies View Related

Insert Values Of All The Fields Into Variable?

Aug 7, 2014

I need to create a stored procedures, this procedure will receive two parameters:

@TableName

@KeyField

I need to storage into a variable the values of ALL THE FIELDS separeted by |

For example if my table is Customers

CustomerID CustomerName City

111 Adventure Boston

222 Pubs NY

And I execute EXEC mysp 'Customers',111

I need a return value like this

@ReturnValue = 111|Adventure|Boston

I create something like this

CREATE PROCEDURE my sp
@table varchar
@key numeric
AS
@field varchar(40),
@object int
Select @object = object_id from systables where name =@table

--The instructions to create a cursor

WHILE (@@FETCH_STATUS = 0 )
Select @object = name from sys.columns where object_id = @object

--The instructions to close and deallocate the cursor

I have alredy to save the value using the EXEC command but is not working; something like

@String = Select @object from @table where CustomerID = @keyValue

View 1 Replies View Related

Show Variable Values At Runtime

Nov 14, 2007

Is there a quick and easy way, other than scripting a MsgBox(), to show the value of a package variable while the package is running?

View 3 Replies View Related

Select Several Values Into A Single Variable

May 11, 2006

Can somebody please tell me whether the following syntax is supportedor whether it's a "feature" that will someday stop working. It works inboth SQL Server 2000 and 2005 at the moment.declare @var varchar(1000)set @var = ''select @var = @var + colx from some_table where col1 = some_valuecolx is a varchar or at least is cast to one as part of the selectstatement. If the where clause would normally return more than one row,all returned values for colx are concatenated into @var.I've not seen this syntax before but that doesn't make it wrong ;-)Malc.

View 8 Replies View Related

Displaying Variable Values After Execution

Mar 13, 2007

Hello,

I have just developed my first full package and it has been, ahem, an adventure- but I can see the power of SSIS.  I am splitting 1M rows in to up to 11 parts (therefore up to 11M rows) for several files and it takes a matter of seconds!

I have used some variables in the package and would like to see the results of these at the end of execution.  They are purely for interest at the moment.

I think I can output them to a flat file, but is it possible to output them to the Immediate window at the end of execution?

I can not figure out how to have a watch on them either- is this possible?  Ideally I would like a counter on screen next to my loop containers.

All of the web pages I have seen regarding debugging seem to assume that VB is being used to create the package.

Thanks,

Alan.

View 2 Replies View Related

Writing Variable Values In Console

Feb 21, 2008

is there a possibility to print the value of a variable in the debug console? it seems that Console.WriteLine in a script task doesn't work. or is there a better way in order to debug the value of a variable at a certain point?

View 7 Replies View Related

How Do I Watch Variable Values During Debugging ?

Jan 12, 2006

Is there a way i can see the value of the variables during debugging ?

View 10 Replies View Related

How To Assign Values To A Variable From A Xls Sheet?

Sep 28, 2006

I've got this query inside a Sql Task against a Excel connection and I'd like to insert that value into a user variable called "Proyecto". How do I such thing?

select Proyecto from [Carga$]

TIA,

View 1 Replies View Related

How To Pass Variable Values Between Tasks

Feb 16, 2007

Hi Everybody,

I have to generate a seq num and increment it by 1,i used execute sql task and wrote a proc using a variable(out) now this out variable has that value.Now i need to add a extra column to all the records coming in this current batch with the value in the variable.

I know that i can use derived column transformation ,but its not working,giving the following error.

the errors thrown are:

[OLE DB Destination [16]] Error: An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft OLE DB Provider for Oracle" Hresult: 0x80004005 Description: "Unspecified error". An OLE DB record is available. Source: "Microsoft OLE DB Provider for Oracle" Hresult: 0x80004005 Description: "ORA-01779: cannot modify a column which maps to a non key-preserved table ".
[OLE DB Destination [16]] Error: The "input "OLE DB Destination Input" (29)" failed because error code 0xC020907B occurred, and the error row disposition on "input "OLE DB Destination Input" (29)" specifies failure on error. An error occurred on the specified object of the specified component.
[DTS.Pipeline] Error: The ProcessInput method on component "OLE DB Destination" (16) failed with error code 0xC0209029. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.
[DTS.Pipeline] Error: Thread "WorkThread0" has exited with error code 0xC0209029.
[OLE DB Source [1]] Error: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.
[DTS.Pipeline] Error: The PrimeOutput method on component "OLE DB Source" (1) returned error code 0xC02020C4. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.
[DTS.Pipeline] Error: Thread "SourceThread0" has exited with error code 0xC0047038.

i have created a variable with scope as package,used that in execute sql task.then using precedence constrains added a data flow task to it.

In the data flow task between the source and destination i placed a derived column transformation.

the execute sql task is running fine,dataflow task is failing.In dataflow task also source and destination is failing but derived column transformation is working.

Am i doing correct.Pls advice.



Regards

Swan



View 3 Replies View Related

Updating/getting Values From Datagrid In C# With Variable Parameters

Oct 24, 2006

HiI am new to the world of aspx, .net and C#.In aspx .net 2.0. I am trying to work out how to get a datagrid to perform an update. Using Visual Developer I have successfully added the control and specifed a select statement to return data via my SQLData Source. This works fine. However having specifed the control as editable I would like to perform an update through the datagrid and SQLDatasource. I see in the properties for the SQLDatasource object I can specify my update statement.However I do not understand how to get that update statement to have variable values and how newly entered values from the grid can be placed into these variables when the update takes place. Can someone please point me in the right direction? I have not found the MS doc very illuminating thus far and have not found any examples.Many ThanksT

View 1 Replies View Related

How Do I Move Sql Variable Values To Local Variables

Nov 2, 2006

Can someone show how to do this?I have a  SqlDataSource1,  and i have a SELECT * FROM Table1How would i get@ProdName@ProdNumber                        Into the following local variablesString  ProductNameInt       ProductNumber              I’m using C# and ASP 2.0 VWDThanks for Help1 

View 2 Replies View Related

How Can I Have A Variable Number Of Parameter Values In A Dataset?

Apr 20, 2007

I have a strongly typed dataset, and I need to be able to do a search on multiple values of a parameter.  The problem is I don't know how many.  I have a textbox that the user can enter search words in.  The select string is built from the string of words that are entered, like this:For iCount = 0 To UBound(sArray)    strSQL = strSQL & "Description LIKE '%" & sArray(iCount) & "%' OR "Next Can I do this is a dataset method?  How?  If I can't, what are my options?Diane 

View 6 Replies View Related

Problem With Setting Variable Values In A Loop

Sep 11, 2007

In a stored procedure that I'm fixing, there is a problem with assigning variable values inside a loop. The proc is using dynamic SQL and if statements to build all these statements, but I'm having to add a new variable value to it that is throwing it out of whack.

This is the current structure:

SET @MktNbr = 10

WHILE @MktNbr < 90

BEGIN

DECLARE@sqlstmt varchar(1000)

SET @Market = '0' + CONVERT(char(2),@MktNbr)

SET @sqlstmt = 'SELECT (columns)
INTO dbo.table' + @Market + '
FROM #table
WHERE marketcode = ''' + @Market + '''
IF @MktNbr = 50
BEGIN
SET @MktNbr = 51
END
ELSE
IF @MktNbr = 51
BEGIN
SET @MktNbr = 52
END
ELSE
IF @MktNbr = 52
BEGIN
SET @MktNbr = 55
END
ELSE
IF @MktNbr = 55
BEGIN
SET @MktNbr = 60
END
ELSE
BEGIN
SET @MktNbr = @MktNbr + 10
END
EXEC (@sqlstmt)


END


I'm probably having a blonde moment, but I'm trying to replace the if statements with this:

SET @MktNbr =
CASE
WHEN @MktNbr = 10 THEN 20
WHEN @MktNbr = 20 THEN 30
WHEN @MktNbr = 30 THEN 40
WHEN @MktNbr = 40 THEN 50
WHEN @MktNbr = 50 THEN 51
WHEN @MktNbr = 51 THEN 52
WHEN @MktNbr = 52 THEN 55
WHEN @MktNbr = 55 THEN 60
WHEN @MktNbr = 60 THEN 70
WHEN @MktNbr = 70 THEN 80
WHEN @MktNbr = 80 THEN 81
ELSE @MktNbr END

Clearly it's wrong because the proc bombs every time with a duplicate table error.

It has been suggested to me that I should hold these market values in an external table. This sounds reasonable but I'm ashamed to admit that I don't know how I'd implement that. Can someone maybe give me a nudge in the right direction?

View 14 Replies View Related

T-SQL (SS2K8) :: Check Variable Values Dynamically

Nov 9, 2014

I have created dynamic sql to declare variables based on columns from the table and i set values to those variable now here is the issue . i want to check the variable values how do i do that dynamically

drop table test
create table test
(
id varchar(10) not null,
col1 varchar(10) ,
col2 varchar(10)

[Code] .....

Now my next step is verify if the variable is blank or not how do i do that ?

How do i verify all of the columns one after the other .

I am after the statement like this dynamically

-- IF NOT (@col1 = '') THEN set @SQL = @SQL + '[col1] = ' + @col1 + ' '
--IF NOT (@col2 = '') THEN set @SQL = @SQL + '[col2] = ' + @col2 + ' '

I need to check if the columns are blank or not dynamically as i do not want to hard code the column names there.

View 4 Replies View Related

Viewing Variable Values That Are Passed In To SSIS

Apr 16, 2008

Since SSIS is developed in Visual Studio is there a way to view the variable values as they are passed into SSIS? In Visual Studio I know if you hover over the variable a popup appears with the value in the variable.

I am having an issue with a variable value that is supplied through an "Execute SQL Task" it is a Directory path that is entered in through the application and used to determine where to pick up files to transfer. I have entered in the path using Fully Qualified(D:ImportExportCentralPrinting) and UNC (\SQLDEVELOPImportExportCentralPrinting) through both methods SSIS is telling me no files are available in the directory path. When I know for fact they do exists.

I would really love to see the variable values that are being used can anyone out there help?
Thank you all,
Mike

Michael Alawneh, DBA

View 3 Replies View Related

Storing Variable Values Whilst Using Cursors

Feb 21, 2007

Hi below is the code I am using.------------------------------------SET NOCOUNT ONDECLARE @emailid varchar(50), @rastype varchar(50),@message varchar(80)declare @allrastypes varchar(200)DECLARE email_cursor CURSOR FORSELECT distinct EmailFROM dbo.tblMaintCustomerORDER BY EmailOPEN email_cursorFETCH NEXT FROM email_cursorINTO @emailidWHILE @@FETCH_STATUS = 0BEGINPRINT ' 'SELECT @message = 'Email Address ' +@emailidPRINT @message-- Declare an inner cursor based-- on vendor_id from the outer cursor.DECLARE rastype_cursor CURSOR FORSELECT distinct [RasType]FROM dbo.tblMaintCase x, dbo.tblMaintCustomer yWHERE x.caseid = y.caseid ANDy.Email = @emailidand RasType is not nullOPEN rastype_cursorFETCH NEXT FROM rastype_cursor INTO @rastypeselect @allrastypes = @allrastypes + ',' + @rastypeIF @@FETCH_STATUS <0PRINT ' <<None>>'WHILE @@FETCH_STATUS = 0BEGINSELECT @message = @rastypePRINT @messageselect @allrastypes = @allrastypes + ',' + @rastypeFETCH NEXT FROM rastype_cursor INTO @rastypeENDCLOSE rastype_cursorDEALLOCATE rastype_cursorinsert into dbo.tblTest values(@emailid,@allrastypes)select @allrastypes = ''FETCH NEXT FROM email_cursorINTO @emailidENDCLOSE email_cursorDEALLOCATE email_cursor--------------------------------------I basically want the value of @allrastypes to accumulate each time itloops through, which is is not doing.The result I get is :Email Address Join Bytes!G5R(for here i want @allrastypes to be 'G5R,')Email Address Join Bytes!G1G3G5O(for here i want @allrastypes to be 'G1,G3,G5O')Can someone helpThanksArchana

View 1 Replies View Related

Assigning Variable Values Via Loop Using Different Datatypes

Apr 10, 2008

Hi all,

I need some help regarding a conversion in a Script Task.

I am reading my variable values from a database with a sql task, the table has two columns, variable and variableValue.
Looping through the recordset and setting the different variables works well, with two links:
http://blogs.conchango.com/jamiethomson/archive/2005/02/09/SSIS_3A00_-Writing-to-a-variable-from-a-script-task.aspx
http://sqlblog.com/blogs/andy_leonard/archive/2007/10/14/ssis-design-pattern-read-a-dataset-from-variable-in-a-script-task.aspx

setting the variable value only works well if the package variable is defined as string, because the db field is a varchar, trying to assign an integer for example brings up an error.

Therefor I tried something like CType:
Dts.Variables("MyVar").Value = CType(MyRecordsetField,String), where the target datatype should be depending on the variable datatype instead of being assigned as a constant.

Could someone give me a hint to handle this?

Thanks in advice!

Cheers
Markus

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved