Showing posts with label control. Show all posts
Showing posts with label control. Show all posts

Sunday, March 25, 2012

A/Synchronous execution of SSIS ETL packages

Hi

I'd like to know if there's a way to control the execution of ETL packages, such that:
Different packages, or at least packages that don't access the same table or database run asynchronously with respect to each other; e.g., two different packages run at the same time
and
If a package is called for execution more than once by different requests, force them to run synchronously, or one after the other.If this is possible, what resources would it require? Is this possible under, say, a dual or quad processor machine?

Thanks.

Well, there is nothing to stop you running 2 packages concurrently (i.e. at the same time). They run as seperate processes so cannot interfere with each other in the process space. Of course, if they are competing for the same external connections then you may run into problems.

Not so sure about ensuring that executions of a package are queued up tho as you require. You may have to implement a process on top of your packages to check to see if a package is already executing before attempting to execute it.

I don't think the spec of the machine is the issue here but it may help to know what resources a package utilises: http://blogs.conchango.com/jamiethomson/archive/2005/05/29/1486.aspx

-Jamie

|||

I'm not sure about the big picture, and how these package are run, but here are two ideas to consider:

1) using master package with execute package tasks and appropriate precedence constraints

2) creating Agent Job for each package - the Agent runs maximum one instance of a job at a time, thus if you always go via Agent, you'll have at most one instance of same package running.

|||

You would need to maintain some kind of shared state in order for packages in seperate processes to 'know' if a singleton object was being consumed by eachother and prevent contention. You can typically use a semaphore to stagger execution of any Windows dependant processes; in the SSIS context you could use a semaphore from within a script task. Have a look in the .Net framework for synchronization primitives support.

|||MSMQ task does this smashingly. :)

Thursday, March 22, 2012

A way to control the # of Transport connections

Is there a configuration parameter that allows me to control the number of Transport connections used by service broker? Right now it seems that it just uses one.

There is no such configuration parameter. The only reason to use more than one TCP connection would be if there were multiple NICs having routes to the destination. But since Service Broker does not really bottleneck on the NIC, there was no reaon to add support for multiple TCP connections. However, we may add this support for other reasons.

Rushi

|||

Ok so what should I do if it feels like I am being constrained at around 100 - 150 messages per second through this transport piece? I have done a couple of tests and at one point it seemed if I enqueued more than 100 messages/sec then they would back up into the sys.transmission_queue on the source side. I realize that is by design, but I have been led to believe that I should get something closer to 1,000 messages/sec of throughput between the 2 instances?

Any thoughts?

sql

A URL expression problem with a Jump to command

I have a report that uses the table control, the last column has id's for
dealcompanies in it(Fields!res_dealCompanyid.Value). When the user clicks on
any of the other Columns in a row I would like to be able to grab the id from
the last column in the row and insert it into the expression for the Jump to
url feature.
this url works fin
="javascript:void(window.open('http://sandbox:82/EE2/DealCompany.aspx?id={535d58cc-a1b3-da11-9864-001320020c86}','_blank'))"
this one gives me an Error on pag
="javascript:void(window.open('http://sandbox:82/EE2/DealCompany.aspx?id={'&Fields!res_dealCompanyid.Value&'}','_blank'))"
How can I find out what is wrong
MikeI got this to work, my problem was that the dealCompanyid value was not a
string so I had to do a Fields!res_dealcompanyid.Value.tostring() then it
worked fine.
Parameters!CRMServer.Value just holds a Server info
="javascript:void(window.open('http://" & Parameters!CRMServer.Value &
"/EE2/DealCompany.aspx?id=" & Fields!res_dealcompanyid.Value.tostring() & "',
'_blank'))"
"Hotwheels" wrote:
> I have a report that uses the table control, the last column has id's for
> dealcompanies in it(Fields!res_dealCompanyid.Value). When the user clicks on
> any of the other Columns in a row I would like to be able to grab the id from
> the last column in the row and insert it into the expression for the Jump to
> url feature.
> this url works fine
> ="javascript:void(window.open('http://sandbox:82/EE2/DealCompany.aspx?id={535d58cc-a1b3-da11-9864-001320020c86}','_blank'))"
> this one gives me an Error on page
> ="javascript:void(window.open('http://sandbox:82/EE2/DealCompany.aspx?id={'&Fields!res_dealCompanyid.Value&'}','_blank'))"
> How can I find out what is wrong
> Mike
>

Tuesday, March 6, 2012

A report VIEWER control ! How about the report DESIGNER control ?

Hi all, our team is really excited about the new ReportViewer control.
Heck, it even supports custom data sources, which fits in nicely with our
overall application design.
The only thing that seems to be missing then is a control that allows our
users to design (or at least modify) reports themselves. In our mind,
the biggest advantage to working with a report engine and report files
is the ability to provide your users with customizable reports.
Moreover, we know this functionality exists since we (programmers)
use the report designer in VS2005. So it would be up to Microsoft to
package it into a control and ship it.
I'm sure somebody else has already asked about this by now but repeated
google queries have turned up nothing relevant.
Thanks for any light anyone can shed on this.
Sven
PS: I hope my cross-posting does notTake a look at the information about Report Builder in Reporting
Services 2005. That is intended to give end users the ability to
design their own reports.
But it's not a control though. Of course, until recently the Report
Viewer control didn't exist either. :)
Andrew Watt
MVP - InfoPath
On Wed, 12 Oct 2005 12:19:45 +0200, "Sven Devriese"
<desfen@.newsgroup.nospam> wrote:
>Hi all, our team is really excited about the new ReportViewer control.
>Heck, it even supports custom data sources, which fits in nicely with our
>overall application design.
>The only thing that seems to be missing then is a control that allows our
>users to design (or at least modify) reports themselves. In our mind,
>the biggest advantage to working with a report engine and report files
>is the ability to provide your users with customizable reports.
>Moreover, we know this functionality exists since we (programmers)
>use the report designer in VS2005. So it would be up to Microsoft to
>package it into a control and ship it.
>I'm sure somebody else has already asked about this by now but repeated
>google queries have turned up nothing relevant.
>Thanks for any light anyone can shed on this.
>Sven
>PS: I hope my cross-posting does not
>|||It is not as simple as that. The report designer is built to work with
Visual Studio and takes advantage of common functionality (for instance, all
the query design windows). As a matter of fact, the designer in 2005 now
ships with a special version of VS 2005. Plus you also have vb.net etc etc.
For that reason I don't expect to ever see this as a redistributable.
However, as Andrew mentioned, there is now Report Builder as well for end
users.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Sven Devriese" <desfen@.newsgroup.nospam> wrote in message
news:usVb5ZxzFHA.612@.TK2MSFTNGP10.phx.gbl...
> Hi all, our team is really excited about the new ReportViewer control.
> Heck, it even supports custom data sources, which fits in nicely with our
> overall application design.
> The only thing that seems to be missing then is a control that allows our
> users to design (or at least modify) reports themselves. In our mind,
> the biggest advantage to working with a report engine and report files
> is the ability to provide your users with customizable reports.
> Moreover, we know this functionality exists since we (programmers)
> use the report designer in VS2005. So it would be up to Microsoft to
> package it into a control and ship it.
> I'm sure somebody else has already asked about this by now but repeated
> google queries have turned up nothing relevant.
> Thanks for any light anyone can shed on this.
> Sven
> PS: I hope my cross-posting does not
>|||Keep in mind that Report Builder generated RDL files cannot be used directly
with the report viewer controls in Local Mode. They can however be easily
used with the controls in Server Mode.
RDL is a documented and open standard, e.g. for the 2003/10 RDL of RS 2000
please check http://www.microsoft.com/sql/reporting/techinfo/rdlspec.mspx,
the 2005/01 RDL is very similar. You could write your own designer component
that generates RDL. In fact, there are ISVs who have implemented e.g.
web-based report authoring tools. Please check:
http://www.microsoft.com/sql/reporting/partners/default.mspx
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Andrew Watt [MVP - InfoPath]" <SVGDeveloper@.aol.com> wrote in message
news:g8upk1tmjfb3vasb96s71r36aadm4lohks@.4ax.com...
> Take a look at the information about Report Builder in Reporting
> Services 2005. That is intended to give end users the ability to
> design their own reports.
> But it's not a control though. Of course, until recently the Report
> Viewer control didn't exist either. :)
> Andrew Watt
> MVP - InfoPath
> On Wed, 12 Oct 2005 12:19:45 +0200, "Sven Devriese"
> <desfen@.newsgroup.nospam> wrote:
>>Hi all, our team is really excited about the new ReportViewer control.
>>Heck, it even supports custom data sources, which fits in nicely with our
>>overall application design.
>>The only thing that seems to be missing then is a control that allows our
>>users to design (or at least modify) reports themselves. In our mind,
>>the biggest advantage to working with a report engine and report files
>>is the ability to provide your users with customizable reports.
>>Moreover, we know this functionality exists since we (programmers)
>>use the report designer in VS2005. So it would be up to Microsoft to
>>package it into a control and ship it.
>>I'm sure somebody else has already asked about this by now but repeated
>>google queries have turned up nothing relevant.
>>Thanks for any light anyone can shed on this.
>>Sven
>>PS: I hope my cross-posting does not
>

Monday, February 13, 2012

a little trouble understanding about primary keys

Hi,

I have a couple of questions regarding primary keys, and whether I really need one or not.

Right now, I am using a GridView control to display all the data in my Access database, but am using a SqlDataSource control to do it. Everything works fine, and I am also using the GridView to Edit/Delete records, and I am using a DetailsView control to insert new records into the database.

The questions I have are these:

1) What I have right now in the database is a value called ID, which is just an autonumber, which has the order of the database, but I would like to change it so that the database sorts by the date awarded, which is a field in the database called "mdate", and make it so that when an admin enters a new date, it sorts automatically by date. Because of that, I am not really sure if I need to have the ID value at all.

I dont understand if it will be of any use, if I want all the values to show up by date, starting from 2006 back. If anyone can explain, or tell me if I am thinking correctly?

2) Also, right now in the database, the clients who started the database inserted the values in the "mdate" field as "Awarded mm/dd/year" instead of just "mm/dd/year".

How could I write a function to go through each record in the "mdate" column, delete the word "Awarded " and then convert it into a datetime object, so I could sort it by date? Is it possible, or would I have to do it manually?

Here is the code I have now:

<%@.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

<div>

<asp:DetailsViewID="DetailsView1"runat="server"AllowPaging="True"DataSourceID="myDataSource1"

Height="50px"Width="300px"OnPageIndexChanging="DetailsView1_PageIndexChanging"Font-Names="Arial"Font-Size="Smaller">

<Fields>

<asp:CommandFieldShowDeleteButton="True"ShowEditButton="True"ShowInsertButton="True"/>

</Fields>

</asp:DetailsView>

<br/>

</div>

<asp:GridViewID="GridView1"runat="server"AutoGenerateColumns="false"Font-Names="Verdana"AutoGenerateEditButton="True"AutoGenerateDeleteButton="true"DataSourceID="myDataSource1"DataKeyNames="ID">

<Columns>

<asp:BoundFieldHeaderText="ID"DataField="ID"ReadOnly="true"Visible="false"/>

<asp:BoundFieldHeaderText="Name"DataField="name"/>

<asp:BoundFieldHeaderText="Department Retired From"DataField="dept"/>

<asp:BoundFieldHeaderText="Current State Of Residence"DataField="state"/>

<asp:BoundFieldHeaderText="Purpose Of Award"DataField="award"/>

<asp:BoundFieldHeaderText="Date Awarded"DataField="mdate"/>

</Columns>

<RowStyleFont-Size="Smaller"Height="50px"HorizontalAlign="Center"/>

</asp:GridView>

<asp:SqlDataSourceID="myDataSource1"runat="server"SelectCommand="SELECT * from [finawards]"ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|finawards_new.mdb"ProviderName="System.Data.OleDb"UpdateCommand="UPDATE [finawards] SET [name] = @.name, [dept] = @.dept, [state] = @.state, [award] = @.award, [mdate] = @.mdate WHERE [ID] = @.ID"DeleteCommand="DELETE FROM finawards WHERE [ID] = @.ID"InsertCommand="INSERT INTO finawards (name, dept, state, award, mdate) VALUES (@.name, @.dept, @.state, @.award, @.mdate)"></asp:SqlDataSource>

</form>

</body>

</html>

Thanks,

sls29 wrote:

1) What I have right now in the database is a value called ID, which is just an autonumber, which has the order of the database, but I would like to change it so that the database sorts by the date awarded, which is a field in the database called "mdate", and make it so that when an admin enters a new date, it sorts automatically by date. Because of that, I am not really sure if I need to have the ID value at all.

Modify your SELECT statement to add an ORDER BY with ASC or DESC clause at the end.

SelectCommand="SELECT * from [finawards] ORDER BY mdate"

Yes. It is a good idea to have a Primary Key. You may not be using it now but every table must have a PK.

sls29 wrote:

How could I write a function to go through each record in the "mdate" column, delete the word "Awarded " and then convert it into a datetime object, so I could sort it by date? Is it possible, or would I have to do it manually?

You could use a REPLACE function to remove all the "Awarded" values. something like this:

SELECT REPLACE(Field1, "Awarded", "") FROM Table1;

After you do that you can manually change the datatype of the column

|||

Close, you want:

UPDATE Table1 SET Field1=REPLACE(Field1,"Awarded ","")

that'll get rid of the pesky text.

Yes, every table should have a primary key. If you want to pull back by mdate, fine, put an index on it too. But without a primary key column like the id field, what if two awards are given out to the same person/people/thing on the same day? How would/could you distinguish between the records if all the columns are exactly the same? That's what the ID field is doing for you. In addition, if you have records that refer back to the award (by ID), then if at a later time you decide to change the mdate or some other field in the table, then your other tables will still be able to find the corresponding record because the ID never changes (for that record).

|||

Thank you for the help.

So, basically, I can sort the GridView display anyway I want, but will still need the ID value there, just for unique identification purposes? I do not have to have the ID effect the ordering of how the GridView will display...

About how to get rid of the "Awarded" text. So, basically, I should be able to run a command:

UPDATE finawards SET mdate=REPLACE(mdate, "Awarded ", "");

Right in Access, and then change the column type to a date/time object?

Thanks again, I really appreciate it. I am trying to learn and get practice with ASP.NET 2.0, and it is nice to have a place to ask questions, and get some advice!

|||

1). Personally,I try my best not to use date as primary key as it can be duplicated. If the reason just want to get the data sorted in the database, I believe you can always sort the data in your query. So, I'd use the ID for PK.

2). Try this

// this will set the mdate to the 10 characters of the mdate from the right, I assume the last 10 characters in the mdate field is all date format.

Update [Table_Name] Set mdate = Right(mdate,10);

run the query, and change the column type to datetime manually in the design view.

good luck

|||

Thanks again for all the help. I changed all the values of my "mdate" field to take away the "Awarded " test, and then converted that field to be of type "datetime" and changed the format string to "Short Date" so it would only show the date in the form mm/dd/year.

But, for some reason, when it displays the mdate field in the GridView it shows up as "mm/dd/year 12:00am".

Is there a reason it is showing a time as well, even though there is no time in the database? Is there something I have to add to my code so that it only shows up in short date form?

Right now, I have the same code except for theORDER BY mdate addition to my SelectCommand.

I was not sure where to add the formatting restrictions. When I try to insert data also, it also gives me a type mismatch error. I am assuming that is because I put in only a date, and not a time?

Thanks in advance for any advice.

|||

I was able to get only the date to display in the GridView by adding this to my boundfield for the mdate field.

DataFormatString = "{0:mm/dd/yyyy}" HtmlEncode="False"3

The problem I am having now is that when I try to insert a new record, I get a "Data type mismatch criteria" error.

I was reading that the problem is because even if it is in the right format, Access will not allow a DateTime object to be inserted as a string. How can I convert the value that is entered into the "mdate" textbox created by the DetailsView control to a ShortDate object so that I can insert it into the database?

Thanks again.

|||

I tried a couple of new things to fix my problem, but with no luck.

First, I tried adding the InsertParameters collection to my SqlDataSource and set the Type of my "mdate" as DateTime, but that did not work.

<InsertParameters>
<asp:Parameter Name="ID" Type="String" />
<asp:Parameter Name="name" Type="String" />
<asp:Parameter Name="dept" Type="String" />
<asp:Parameter Name="state" Type="String" />
<asp:Parameter Name="award" Type="String" />
<asp:Parameter Name="mdate" Type="DateTime" />
</InsertParameters>

Then, I tried to modify the ItemInserting function of the DetailsView so that it checks for which value is the "mdate" function, and converts it to a DateTime object, but I am still getting the same error.

protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
{
for (int i = 0; i < e.Values.Count; i++)
{
if (e.Values[i].ToString().Contains("/"))
{
Convert.ToDateTime(e.Values[i].ToString());
}
else
{
e.Values[i] = Server.HtmlEncode(e.Values[i].ToString());
}
}
}

I know the function is a little primitive, but I just figured that if the current value contains a "/", it would have to be the mdate field, since there is no other field that would have that in it.

Is there anything fundamentally wrong? I am totally confused...

|||

Try playing around in the SqlDataSource_Inserting event. There is a lot more control there with what actually gets sent to the database.

Just curious, shouldn't you be using the AccessDataSource control with Access?

|||

Thanks for the tip, I will look at that event also. The reason I am using the SqlDataSource control is because in the quickstarts it had mentioned that you can use the SqlDataSource control with an Access database also, and it would give you the "added functionality" that comes with the SqlDataSource control.

Maybe I can try to change it, and see if that works better.

|||

Well, I tried to change my SqlDataSource_Inserting function to the following:

Convert.ToDateTime(myDataSource1.InsertParameters["mdate"].ToString().Trim());

That did not work, but atleast now I get a different errorSmile [:)]

Now, when I try to insert a new record, I get the error:

"The string was not recognized as a valid DateTime. There is an unknown word at index 0".

Is the above code that I wrote enough for the Inserting function? I thought since the only problem I was having was with mdate, it would convert that value to a DateTime object, and then perform the insert command, but now I am getting this new error...Confused [*-)]

I tried adding the Trim() to my Convert statement thinking that was why I was getting my error, but I am still getting it.

Any ideas? Thanks again...

|||

I finally got this resolved! I ended up getting rid of the DetailsView control altogether, and just included a regular form to insert into the database. Then I used an OleDbCommand and a ExecuteNonQuery method to insert the values.

I was able to insert the date properly also using DateTime.Parse(), and everything is working great now.

Thanks to everyone for their help.

Saturday, February 11, 2012

A Jump to URL expression Question for a table control

I have a report that uses the table control, the last column has id's for
dealcompanies in it. When the user clicks on any of the other Columns
in a row I would like to be able to grab the id from the last column in the
row and insert it into the expression for the Jump to url feature.
http://sandbox:82/EE2/DealCompany.aspx?id={xxxxxxxxxx}
I do I get this id from the last column into the expression.
MikeClick on fields in the properties and select the fields where you have the
hyperlink or Action and use something like this.
="javascript:window.navigate('http://server/pt/pt.aspx?ID= " &
Fields!ID.Value & "');"
Amarnath
"Hotwheels" wrote:
> I have a report that uses the table control, the last column has id's for
> dealcompanies in it. When the user clicks on any of the other Columns
> in a row I would like to be able to grab the id from the last column in the
> row and insert it into the expression for the Jump to url feature.
> http://sandbox:82/EE2/DealCompany.aspx?id={xxxxxxxxxx}
> I do I get this id from the last column into the expression.
> Mike
>|||I got this to work, my problem was that the dealCompanyid value was not a
string so I had to do a Fields!res_dealcompanyid.Value.tostring() then it
worked fine.
Parameters!CRMServer.Value just holds a Server info
="javascript:void(window.open('http://" & Parameters!CRMServer.Value &
"/EE2/DealCompany.aspx?id=" & Fields!res_dealcompanyid.Value.tostring() & "',
'_blank'))"
"Amarnath" wrote:
> Click on fields in the properties and select the fields where you have the
> hyperlink or Action and use something like this.
> ="javascript:window.navigate('http://server/pt/pt.aspx?ID= " &
> Fields!ID.Value & "');"
> Amarnath
>
> "Hotwheels" wrote:
> > I have a report that uses the table control, the last column has id's for
> > dealcompanies in it. When the user clicks on any of the other Columns
> > in a row I would like to be able to grab the id from the last column in the
> > row and insert it into the expression for the Jump to url feature.
> >
> > http://sandbox:82/EE2/DealCompany.aspx?id={xxxxxxxxxx}
> >
> > I do I get this id from the last column into the expression.
> >
> > Mike
> >
> >