Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Monday, March 26, 2012

Multiple Instance of DTS

I have a DTS package I created that is dadabase driven to process source data from multiple sources.

Can I run several instances of this package in parallel for each source or would I need to create a copy for each source ?

JavaWaba

javawaba wrote:

I have a DTS package I created that is dadabase driven to process source data from multiple sources.

Can I run several instances of this package in parallel for each source or would I need to create a copy for each source ?

JavaWaba

This isn't a DTS forum. I recommend you direct your question to the DTS newsgroup microsoft.public.sqlserver.dts

Wednesday, March 21, 2012

Multiple Detail Sections

I have created a report that is using a table with multiple groupings. My
main result set from a stored procedure populates the detail section of the
table. I have a secondary result set that I would like to populate based on a
value from the first result set. For example:
Detail 1 Customer 1
Detail 2 Order 1
Order 2
Order 3
Detail 2 is populated based on the customer id.
How can I accomplish this using the report authoring tool?
Any help would be appreciated.Assuming you are not trying to do a table with groupings, this can be
accomplished with nested "List" items (a list inside of a list) which allow
a free form layout. You just bind each list to the correct dataset for your
detail. See the Sample Reports for an example.
"Scott2624" <Scott2624@.discussions.microsoft.com> wrote in message
news:8411C050-B2FE-48B1-8E26-755220D4FD06@.microsoft.com...
>I have created a report that is using a table with multiple groupings. My
> main result set from a stored procedure populates the detail section of
> the
> table. I have a secondary result set that I would like to populate based
> on a
> value from the first result set. For example:
> Detail 1 Customer 1
> Detail 2 Order 1
> Order 2
> Order 3
> Detail 2 is populated based on the customer id.
> How can I accomplish this using the report authoring tool?
> Any help would be appreciated.
>

Monday, March 19, 2012

multiple datasets

I have a report that I have created with multiple subreports and datasets. There should be a better solution so I am asking the question here.

The report should display like this:

Object Object Title Budget Curr-Spent Ytd-Spent Ytd-Encum Post-Ytd Balance % Remaining 4100 EMPLOYEES $380.00 $250.93 $343.67 $0.00 $0.00 $61.33 15.94% 4102 EMPLOYEES - TEMPORARY $149.00 $110.75 $139.70 $0.00 $0.00 $47.30 30.16% 4201 EMPLOYEE BENEFITS $138.00 $73.16 $12.60 $0.00 $0.00 $32.40 25.28%

Each column represents another dataset.

Each column right now is a subreport so I can use the object as a parameter to the subreports dataset. Each column needs to have the object as a parameter.

Is there a way I can pass a field from the first dataset as a parameter for the next dataset without using subreports?

Why can't you create a SQL query which puts every thing together in one dataset and use that dataset in a table. Looks like you are using related information anyways so why not do everything in SQL and then use table for it.

Thanks,

-Rohit

|||

I will need to run each query with the object as a parameter. I guess I can do this with a table variable or a cursor in the sql but there has got to be a better way.

Here is the main dataset

SELECT DISTINCT sum_object AS object, object_desc

FROMfin_detail WITH (NOLOCK)

JOIN bud_objectWITH (NOLOCK)

ON FIN_DETAIL.SUM_OBJECT = bud_object.OBJECT_CODE

WHERE pca = @.pca

AND budget_year = @.budgetyear

AND sum_object <> '4100'

UNION

SELECT DISTINCT sub_obj AS object, object_desc

FROM fin_detailWITH (NOLOCK)

JOIN bud_objectWITH (NOLOCK)

ON FIN_DETAIL.SUB_OBJ = bud_object.OBJECT_CODE

WHERE pca = @.pca

AND budget_year = @.budgetyear

AND exp_sum_object= ‘4100’

Here is the dataset I need to call for each main dataset

IF substring(@.object,1,2)='41'

BEGIN

--starts with 41

Select isnull(sum(amount),0) * -1 as budget

From fin_detail WITH (NOLOCK)

Where pca = @.pca

And budget_year = @.budgetyear

And sum_object = '4100'

And sub_obj = @.object

And gl_Account = '5071'

And budget_year=trans_year

END

ELSE

BEGIN

--not 41

Select isnull(sum(amount),0) * -1 as budget

From fin_detail WITH (NOLOCK)

Where pca = @.pca

And budget_year = @.budgetyear

And sum_object = @.object

And gl_Account = '5071'

And budget_year=trans_year

END

Basically, I need to get all the sum_object in the first query if the sum_object <> 4100 and the sub_object if the sum_object = 4100.

Then I need to call the second dataset to sum the amounts with the @.object from the first dataset as the parameter.

The only way I figured out how to do this was so use subreports instead of a loop in sql.

BTW, this second dataset is one of 5 that I need to call for each object in the first query.

|||

I figured out how to do what I needed from reading this article http://www.code-magazine.com/articleprint.aspx?quickid=0701061&page=2

I created this function

Function GetBudget(ByVal myobject As String, ByVal pca As String, ByVal budgetyear As String) As Integer
Dim oConn As New System.Data.SqlClient.SqlConnection
oConn.ConnectionString =

oConn.Open()
Dim oCmd As New System.Data.SqlClient.SqlCommand
oCmd.Connection = oConn


oCmd.CommandText =

IF substring(@.object,1,2)='41'

BEGIN

--starts with 41

Select isnull(sum(amount),0) * -1 as budget

From fin_detail WITH (NOLOCK)

Where pca = @.pca

And budget_year = @.budgetyear

And sum_object = '4100'

And sub_obj = @.object

And gl_Account = '5071'

And budget_year=trans_year

END

ELSE

BEGIN

--not 41

Select isnull(sum(amount),0) * -1 as budget

From fin_detail WITH (NOLOCK)

Where pca = @.pca

And budget_year = @.budgetyear

And sum_object = @.object

And gl_Account = '5071'

And budget_year=trans_year

END

oCmd.Parameters.AddWithValue("@.sumobject", myobject)
oCmd.Parameters.AddWithValue("@.pca", pca)
oCmd.Parameters.AddWithValue("@.budgetyear", budgetyear)

Dim Budget As Integer = oCmd.ExecuteScalar()
oConn.Close()
Return Budget
End Function

I then called called the code in my textbox like this

=Code.GetBudget(Fields!object.Value,Parameters!pca.Value,Parameters!BudgetYear.Value).

For every row this function is called and returns my budget value because the Fields collection contains the object record from my main report dataset.

I did have problems placing the query on multiple lines even with the normal VB string concatination techniques so I put it all on one line in the XML.

This is the first time that I saw an example of querying a database from custom code in SSRS.

Multiple Datasets

I have created several reports that use multiple datasets. I have
found two errors and I need help.
First, is there a way to define the order in which the datasets are
executed? In some of my reports, the first dataset populates a table
that the remaining datasets query from. However, when I run the
report, it is obvious that it executes some of the datasets that query
from the table BEFORE it runs the dataset that actually populates the
table.
Second, it seems like when my users run a report with multiple datasets
from the front-end, it only runs the one of the datasets and uses the
cashed results for the remaining datasets. For example, I have a
report that counts calls and mail received per a certain account. The
account is a parameter that the user selects. If they run the report
for Account A, then dataset 1 returns a value of 500, dataset B returns
a value of 250 and dataset C returns a value of 100. Then, when the
user runs the report for Account B, dataset 1 returns a value of 999
(which is the correct result), but dataset 2 returns a value of 500
(the result for Account A, not Account B) and dataset 3 returns a value
of 100 (the result for Account A, not Account B). The only way to get
the report to execute all three datasets, is by running the report
once, then hitting the refresh button. Anyone else have this problem?
I would appreciate any responses.
Thanks!You can not count on order of execution. RS is not setup to have
dependencies between datasets like you are trying to do. If that is what you
want then you should create subreports and use them instead. Everything
should work exactly as you want if you do that.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Ronni" <rlnjones@.yahoo.com> wrote in message
news:1106243121.671668.240810@.c13g2000cwb.googlegroups.com...
> I have created several reports that use multiple datasets. I have
> found two errors and I need help.
> First, is there a way to define the order in which the datasets are
> executed? In some of my reports, the first dataset populates a table
> that the remaining datasets query from. However, when I run the
> report, it is obvious that it executes some of the datasets that query
> from the table BEFORE it runs the dataset that actually populates the
> table.
> Second, it seems like when my users run a report with multiple datasets
> from the front-end, it only runs the one of the datasets and uses the
> cashed results for the remaining datasets. For example, I have a
> report that counts calls and mail received per a certain account. The
> account is a parameter that the user selects. If they run the report
> for Account A, then dataset 1 returns a value of 500, dataset B returns
> a value of 250 and dataset C returns a value of 100. Then, when the
> user runs the report for Account B, dataset 1 returns a value of 999
> (which is the correct result), but dataset 2 returns a value of 500
> (the result for Account A, not Account B) and dataset 3 returns a value
> of 100 (the result for Account A, not Account B). The only way to get
> the report to execute all three datasets, is by running the report
> once, then hitting the refresh button. Anyone else have this problem?
> I would appreciate any responses.
> Thanks!
>

Monday, March 12, 2012

multiple database and central libraries

I have a question about MS sql 2000 and hope someone can give me a hand though this may not be the most suitable place to post.

I have created multiple databases storing multi-country data. Tables and store proc in each db are exactly the same except they are placed and run in different dbs in runtime.

My question is:
Is it possible to centralize all the store proc and function into a central db (or a dummy db) for easy maintenance but it allows us to point to the desired database environment in runtime even I run the store proc in central database.

I find the "Use database" command but it does allow us to use it in store proc. Any advice or suggestions?

Thanks in advance
bryanAs long as the account that is running the stored proc has access to the other DBs then you can do it. So a stored proc in db1 can retrieve data from db2.


SELECT * from db2.tblStuff

I would use views so look into those.|||I would look for the System Stored Procedure called SP_Auto start it is in the Master Database, I must warn you there 930 plus System stored procs so it will take time to find it. It makes Stored Proc maintaince easy because it puts all your stored procs in the SQL Server Procedure Cache any time the Operating System starts just like SQL Server Service Auto start. The SQL Server Procedure Cache uses the least used Algorithm to remove less used Stored Procs but SP_Auto start puts them back. Hope this helps.

Kind regards,
Gift Peddie|||Hi,

What I am looking for is something about multiple databases but using a central place to store store only one set of shared store procs and they can be called in their individual db when necessary.

I can't find the exact name of "sp_auto" in master db. Could you give me more hints about that. Or anyone with other suggestions?

Thank you very much
bryan|||exec sp_procoption @.ProcName='Your proc',@.OptionName='startup',
@.OptionValue='true'

Sorry I seem to be making a lot of mistakes lately, the code above is what I mean the SP-Procoption is used to start all procedures and very critical procedures like those used for Cluster Service during start up of the OS. Hope this helps.

Kind regards,
Gift Peddie