Tuesday, March 27, 2012
Customize ReportViewer Animation
I am developing an application that queries a database for a large
amount of data. The SQL server is not local so the time to query the
data can take some time.
Once I have the data locally, I send it to the ReportViewer to display.
The ReportViewer then shows the "Processing" animation, and displays
the results quickly so the animation is shown for a breif period. The
problem is that it takes a long time to query for the data, but the
ReportViewer animation is only shown for the time it processes the
DataSet.
I was wondering if anyone had experience customizing the ReportViewer
control to prematurely start the ReportViewer "Processing..."
animation. I would like to start the animation before I query the
database for the data so the user is aware that something is happening
during the data query.
I would rather implement my own "Processing..." form, or progress bar,
but if there is no way to control the ReportViewer control animation
that is my backup solution.
Thank you,
bigcoopsDoes anyone have any suggestions?
Thanks.
bigcoops@.hotmail.com wrote:
> Hello All,
> I am developing an application that queries a database for a large
> amount of data. The SQL server is not local so the time to query the
> data can take some time.
> Once I have the data locally, I send it to the ReportViewer to display.
> The ReportViewer then shows the "Processing" animation, and displays
> the results quickly so the animation is shown for a breif period. The
> problem is that it takes a long time to query for the data, but the
> ReportViewer animation is only shown for the time it processes the
> DataSet.
> I was wondering if anyone had experience customizing the ReportViewer
> control to prematurely start the ReportViewer "Processing..."
> animation. I would like to start the animation before I query the
> database for the data so the user is aware that something is happening
> during the data query.
> I would rather implement my own "Processing..." form, or progress bar,
> but if there is no way to control the ReportViewer control animation
> that is my backup solution.
> Thank you,
> bigcoops
Sunday, March 11, 2012
Custom Query Designer
Hi,
I am trying to build queries dynamically through a custom interface very much the way Query Designer does. Looking at few of the posts and replies in the forums it seems that SMO does not facilitate building queries but just offers you the metadata of the relational objects.
Are there any other DLL's/API's available which anyone is aware of which faciliates this ?
Thanks
Sam
You could use ADO.NET and build the strings and execute that way.Tim|||In short, no. There are 3rd party commercial query builder components out there though.
Thursday, March 8, 2012
Custom Functions Available To Linked Databases
tricky and not wanting to rewrite all of my queries for oracle to sql server
(yes I have to do the same application from two different servers one with
direct access to oracle and the other as a linked db in sql server) I wrote a
few of the more basic functions that I use that are oracle specific so that I
would not need to change my code much between servers. Stuff like TO_DATE,
TO_CHAR, NVL, and INITCAP anyway when connected with sql query analyzer the
queries work like a champ when called from the web server they crap out and
say that the function doesn't exist (after trying to process which before I
wrote them didn't happen only said not recognized) anyway I guess the point
of all this rambling is to ask if there is a way to make the custom functions
available to ADO on the webserver when calling that server.
They are available if you are using Openquery - it's just a
pass through query to Oracle. If you are using 4 part naming
to access the linked server from your Web server, your
Oracle specific functions won't work - those need to be just
done in T-SQL. Check books online under Openquery function.
-Sue
On Mon, 8 Nov 2004 14:49:09 -0800, "Jason Burr"
<JasonBurr@.discussions.microsoft.com> wrote:
>I have a linked table in SQL Server to an Oracle database. Thinking I was
>tricky and not wanting to rewrite all of my queries for oracle to sql server
>(yes I have to do the same application from two different servers one with
>direct access to oracle and the other as a linked db in sql server) I wrote a
>few of the more basic functions that I use that are oracle specific so that I
>would not need to change my code much between servers. Stuff like TO_DATE,
>TO_CHAR, NVL, and INITCAP anyway when connected with sql query analyzer the
>queries work like a champ when called from the web server they crap out and
>say that the function doesn't exist (after trying to process which before I
>wrote them didn't happen only said not recognized) anyway I guess the point
>of all this rambling is to ask if there is a way to make the custom functions
>available to ADO on the webserver when calling that server.
|||Sue,
You maam are a godess.
Anyway while that was a much better and easier solution to implement and
does exactly what I need I did have another question.
My original question was how to make a sql server function globaly available
(My orignal approach was writing those oracle functions as sql server
functions) They worked however I wanted to make them available to all db's so
I wouldn't have to do something like dbo.db.function(params) So is there a
way to make a function available system wide (as you may have guessed I am
not a big sql server guy)
Thanks again,
Jason
"Sue Hoegemeier" wrote:
> They are available if you are using Openquery - it's just a
> pass through query to Oracle. If you are using 4 part naming
> to access the linked server from your Web server, your
> Oracle specific functions won't work - those need to be just
> done in T-SQL. Check books online under Openquery function.
> -Sue
> On Mon, 8 Nov 2004 14:49:09 -0800, "Jason Burr"
> <JasonBurr@.discussions.microsoft.com> wrote:
>
>
|||Jason,
Not any supported way with functions - there are some hacks
but it's unsupported and not recommended.
Qualifying objects is not a bad thing. Scalar UDFs require
calling with a two part name anyway with owner.function.
If wanting them to be global is related to setting up your
security or having them in a central location, you could
create another database for such objects. You'd still call
them by qualifying with database.owner.function.
-Sue
On Tue, 9 Nov 2004 07:20:02 -0800, "Jason Burr"
<JasonBurr@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Sue,
>You maam are a godess.
>Anyway while that was a much better and easier solution to implement and
>does exactly what I need I did have another question.
>My original question was how to make a sql server function globaly available
>(My orignal approach was writing those oracle functions as sql server
>functions) They worked however I wanted to make them available to all db's so
>I wouldn't have to do something like dbo.db.function(params) So is there a
>way to make a function available system wide (as you may have guessed I am
>not a big sql server guy)
>Thanks again,
>Jason
>"Sue Hoegemeier" wrote:
|||Thanks again Sue. I was worried that was the case. Thanks for confirming.
"Sue Hoegemeier" wrote:
> Jason,
> Not any supported way with functions - there are some hacks
> but it's unsupported and not recommended.
> Qualifying objects is not a bad thing. Scalar UDFs require
> calling with a two part name anyway with owner.function.
> If wanting them to be global is related to setting up your
> security or having them in a central location, you could
> create another database for such objects. You'd still call
> them by qualifying with database.owner.function.
> -Sue
> On Tue, 9 Nov 2004 07:20:02 -0800, "Jason Burr"
> <JasonBurr@.discussions.microsoft.com> wrote:
>
>
Custom Functions Available To Linked Databases
tricky and not wanting to rewrite all of my queries for oracle to sql server
(yes I have to do the same application from two different servers one with
direct access to oracle and the other as a linked db in sql server) I wrote
a
few of the more basic functions that I use that are oracle specific so that
I
would not need to change my code much between servers. Stuff like TO_DATE,
TO_CHAR, NVL, and INITCAP anyway when connected with sql query analyzer the
queries work like a champ when called from the web server they crap out and
say that the function doesn't exist (after trying to process which before I
wrote them didn't happen only said not recognized) anyway I guess the point
of all this rambling is to ask if there is a way to make the custom function
s
available to ADO on the webserver when calling that server.They are available if you are using Openquery - it's just a
pass through query to Oracle. If you are using 4 part naming
to access the linked server from your Web server, your
Oracle specific functions won't work - those need to be just
done in T-SQL. Check books online under Openquery function.
-Sue
On Mon, 8 Nov 2004 14:49:09 -0800, "Jason Burr"
<JasonBurr@.discussions.microsoft.com> wrote:
>I have a linked table in SQL Server to an Oracle database. Thinking I was
>tricky and not wanting to rewrite all of my queries for oracle to sql serve
r
>(yes I have to do the same application from two different servers one with
>direct access to oracle and the other as a linked db in sql server) I wrote
a
>few of the more basic functions that I use that are oracle specific so that
I
>would not need to change my code much between servers. Stuff like TO_DATE,
>TO_CHAR, NVL, and INITCAP anyway when connected with sql query analyzer the
>queries work like a champ when called from the web server they crap out and
>say that the function doesn't exist (after trying to process which before I
>wrote them didn't happen only said not recognized) anyway I guess the point
>of all this rambling is to ask if there is a way to make the custom functio
ns
>available to ADO on the webserver when calling that server.|||Sue,
You maam are a godess.
Anyway while that was a much better and easier solution to implement and
does exactly what I need I did have another question.
My original question was how to make a sql server function globaly available
(My orignal approach was writing those oracle functions as sql server
functions) They worked however I wanted to make them available to all db's s
o
I wouldn't have to do something like dbo.db.function(params) So is there a
way to make a function available system wide (as you may have guessed I am
not a big sql server guy)
Thanks again,
Jason
"Sue Hoegemeier" wrote:
> They are available if you are using Openquery - it's just a
> pass through query to Oracle. If you are using 4 part naming
> to access the linked server from your Web server, your
> Oracle specific functions won't work - those need to be just
> done in T-SQL. Check books online under Openquery function.
> -Sue
> On Mon, 8 Nov 2004 14:49:09 -0800, "Jason Burr"
> <JasonBurr@.discussions.microsoft.com> wrote:
>
>|||Jason,
Not any supported way with functions - there are some hacks
but it's unsupported and not recommended.
Qualifying objects is not a bad thing. Scalar UDFs require
calling with a two part name anyway with owner.function.
If wanting them to be global is related to setting up your
security or having them in a central location, you could
create another database for such objects. You'd still call
them by qualifying with database.owner.function.
-Sue
On Tue, 9 Nov 2004 07:20:02 -0800, "Jason Burr"
<JasonBurr@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Sue,
>You maam are a godess.
>Anyway while that was a much better and easier solution to implement and
>does exactly what I need I did have another question.
>My original question was how to make a sql server function globaly availabl
e
>(My orignal approach was writing those oracle functions as sql server
>functions) They worked however I wanted to make them available to all db's
so
>I wouldn't have to do something like dbo.db.function(params) So is there a
>way to make a function available system wide (as you may have guessed I am
>not a big sql server guy)
>Thanks again,
>Jason
>"Sue Hoegemeier" wrote:
>|||Thanks again Sue. I was worried that was the case. Thanks for confirming.
"Sue Hoegemeier" wrote:
> Jason,
> Not any supported way with functions - there are some hacks
> but it's unsupported and not recommended.
> Qualifying objects is not a bad thing. Scalar UDFs require
> calling with a two part name anyway with owner.function.
> If wanting them to be global is related to setting up your
> security or having them in a central location, you could
> create another database for such objects. You'd still call
> them by qualifying with database.owner.function.
> -Sue
> On Tue, 9 Nov 2004 07:20:02 -0800, "Jason Burr"
> <JasonBurr@.discussions.microsoft.com> wrote:
>
>
Custom Functions Available To Linked Databases
tricky and not wanting to rewrite all of my queries for oracle to sql server
(yes I have to do the same application from two different servers one with
direct access to oracle and the other as a linked db in sql server) I wrote a
few of the more basic functions that I use that are oracle specific so that I
would not need to change my code much between servers. Stuff like TO_DATE,
TO_CHAR, NVL, and INITCAP anyway when connected with sql query analyzer the
queries work like a champ when called from the web server they crap out and
say that the function doesn't exist (after trying to process which before I
wrote them didn't happen only said not recognized) anyway I guess the point
of all this rambling is to ask if there is a way to make the custom functions
available to ADO on the webserver when calling that server.They are available if you are using Openquery - it's just a
pass through query to Oracle. If you are using 4 part naming
to access the linked server from your Web server, your
Oracle specific functions won't work - those need to be just
done in T-SQL. Check books online under Openquery function.
-Sue
On Mon, 8 Nov 2004 14:49:09 -0800, "Jason Burr"
<JasonBurr@.discussions.microsoft.com> wrote:
>I have a linked table in SQL Server to an Oracle database. Thinking I was
>tricky and not wanting to rewrite all of my queries for oracle to sql server
>(yes I have to do the same application from two different servers one with
>direct access to oracle and the other as a linked db in sql server) I wrote a
>few of the more basic functions that I use that are oracle specific so that I
>would not need to change my code much between servers. Stuff like TO_DATE,
>TO_CHAR, NVL, and INITCAP anyway when connected with sql query analyzer the
>queries work like a champ when called from the web server they crap out and
>say that the function doesn't exist (after trying to process which before I
>wrote them didn't happen only said not recognized) anyway I guess the point
>of all this rambling is to ask if there is a way to make the custom functions
>available to ADO on the webserver when calling that server.|||Sue,
You maam are a godess.
Anyway while that was a much better and easier solution to implement and
does exactly what I need I did have another question.
My original question was how to make a sql server function globaly available
(My orignal approach was writing those oracle functions as sql server
functions) They worked however I wanted to make them available to all db's so
I wouldn't have to do something like dbo.db.function(params) So is there a
way to make a function available system wide (as you may have guessed I am
not a big sql server guy)
Thanks again,
Jason
"Sue Hoegemeier" wrote:
> They are available if you are using Openquery - it's just a
> pass through query to Oracle. If you are using 4 part naming
> to access the linked server from your Web server, your
> Oracle specific functions won't work - those need to be just
> done in T-SQL. Check books online under Openquery function.
> -Sue
> On Mon, 8 Nov 2004 14:49:09 -0800, "Jason Burr"
> <JasonBurr@.discussions.microsoft.com> wrote:
> >I have a linked table in SQL Server to an Oracle database. Thinking I was
> >tricky and not wanting to rewrite all of my queries for oracle to sql server
> >(yes I have to do the same application from two different servers one with
> >direct access to oracle and the other as a linked db in sql server) I wrote a
> >few of the more basic functions that I use that are oracle specific so that I
> >would not need to change my code much between servers. Stuff like TO_DATE,
> >TO_CHAR, NVL, and INITCAP anyway when connected with sql query analyzer the
> >queries work like a champ when called from the web server they crap out and
> >say that the function doesn't exist (after trying to process which before I
> >wrote them didn't happen only said not recognized) anyway I guess the point
> >of all this rambling is to ask if there is a way to make the custom functions
> >available to ADO on the webserver when calling that server.
>|||Jason,
Not any supported way with functions - there are some hacks
but it's unsupported and not recommended.
Qualifying objects is not a bad thing. Scalar UDFs require
calling with a two part name anyway with owner.function.
If wanting them to be global is related to setting up your
security or having them in a central location, you could
create another database for such objects. You'd still call
them by qualifying with database.owner.function.
-Sue
On Tue, 9 Nov 2004 07:20:02 -0800, "Jason Burr"
<JasonBurr@.discussions.microsoft.com> wrote:
>Sue,
>You maam are a godess.
>Anyway while that was a much better and easier solution to implement and
>does exactly what I need I did have another question.
>My original question was how to make a sql server function globaly available
>(My orignal approach was writing those oracle functions as sql server
>functions) They worked however I wanted to make them available to all db's so
>I wouldn't have to do something like dbo.db.function(params) So is there a
>way to make a function available system wide (as you may have guessed I am
>not a big sql server guy)
>Thanks again,
>Jason
>"Sue Hoegemeier" wrote:
>> They are available if you are using Openquery - it's just a
>> pass through query to Oracle. If you are using 4 part naming
>> to access the linked server from your Web server, your
>> Oracle specific functions won't work - those need to be just
>> done in T-SQL. Check books online under Openquery function.
>> -Sue
>> On Mon, 8 Nov 2004 14:49:09 -0800, "Jason Burr"
>> <JasonBurr@.discussions.microsoft.com> wrote:
>> >I have a linked table in SQL Server to an Oracle database. Thinking I was
>> >tricky and not wanting to rewrite all of my queries for oracle to sql server
>> >(yes I have to do the same application from two different servers one with
>> >direct access to oracle and the other as a linked db in sql server) I wrote a
>> >few of the more basic functions that I use that are oracle specific so that I
>> >would not need to change my code much between servers. Stuff like TO_DATE,
>> >TO_CHAR, NVL, and INITCAP anyway when connected with sql query analyzer the
>> >queries work like a champ when called from the web server they crap out and
>> >say that the function doesn't exist (after trying to process which before I
>> >wrote them didn't happen only said not recognized) anyway I guess the point
>> >of all this rambling is to ask if there is a way to make the custom functions
>> >available to ADO on the webserver when calling that server.
>>|||Thanks again Sue. I was worried that was the case. Thanks for confirming.
"Sue Hoegemeier" wrote:
> Jason,
> Not any supported way with functions - there are some hacks
> but it's unsupported and not recommended.
> Qualifying objects is not a bad thing. Scalar UDFs require
> calling with a two part name anyway with owner.function.
> If wanting them to be global is related to setting up your
> security or having them in a central location, you could
> create another database for such objects. You'd still call
> them by qualifying with database.owner.function.
> -Sue
> On Tue, 9 Nov 2004 07:20:02 -0800, "Jason Burr"
> <JasonBurr@.discussions.microsoft.com> wrote:
> >Sue,
> >
> >You maam are a godess.
> >
> >Anyway while that was a much better and easier solution to implement and
> >does exactly what I need I did have another question.
> >
> >My original question was how to make a sql server function globaly available
> >(My orignal approach was writing those oracle functions as sql server
> >functions) They worked however I wanted to make them available to all db's so
> >I wouldn't have to do something like dbo.db.function(params) So is there a
> >way to make a function available system wide (as you may have guessed I am
> >not a big sql server guy)
> >
> >Thanks again,
> >
> >Jason
> >
> >"Sue Hoegemeier" wrote:
> >
> >> They are available if you are using Openquery - it's just a
> >> pass through query to Oracle. If you are using 4 part naming
> >> to access the linked server from your Web server, your
> >> Oracle specific functions won't work - those need to be just
> >> done in T-SQL. Check books online under Openquery function.
> >>
> >> -Sue
> >>
> >> On Mon, 8 Nov 2004 14:49:09 -0800, "Jason Burr"
> >> <JasonBurr@.discussions.microsoft.com> wrote:
> >>
> >> >I have a linked table in SQL Server to an Oracle database. Thinking I was
> >> >tricky and not wanting to rewrite all of my queries for oracle to sql server
> >> >(yes I have to do the same application from two different servers one with
> >> >direct access to oracle and the other as a linked db in sql server) I wrote a
> >> >few of the more basic functions that I use that are oracle specific so that I
> >> >would not need to change my code much between servers. Stuff like TO_DATE,
> >> >TO_CHAR, NVL, and INITCAP anyway when connected with sql query analyzer the
> >> >queries work like a champ when called from the web server they crap out and
> >> >say that the function doesn't exist (after trying to process which before I
> >> >wrote them didn't happen only said not recognized) anyway I guess the point
> >> >of all this rambling is to ask if there is a way to make the custom functions
> >> >available to ADO on the webserver when calling that server.
> >>
> >>
>
Wednesday, March 7, 2012
Custom Data Mining Functions
I would like to write a custom mining function, which takes a string, queries the database, and returns an answer based upon those queries. So the basic function is then:
[MiningFunction("Performs Foo")]
public string Foo(string param)
{
// process parameters
// query database
// calculate answer from query results
// return query results
}
And is executed from the client using:
SELECT Foo("X Y Z") FROM FooModel
This arrangement is so that resource-intensive calculations are performed server-side.
My question is: what is the preferrable method for executing the database query from within the custom mining function?
Custom mining functions are not actually designed for this kind of operations. They are intended for predictive features that are related to the mining model and typically this kind of operations do not need external access (such as a database query). I assume that your function's calculation part will use some information from the mining model and apply it to the database query results.
I think you should use a stored procedure. Inside the stored procedure, you should use the server side object model (add a reference to Microsoft.AnalysisServices.AdomdServer). With the server side object model, you can perform the following operations:
- use AdomdCommand to execute calls such as CALL SystemOpenQuery(DataSource, Query), which is the recommended way of querying a relational database from analysis services
- also use AdomdCommand to execute calls such as SELECT .... FROM YourModel PREDICTION JOIN OPENQUERY(DataSource, Query)
This would allow you to get the information from the data base together with scoring for each, scoring computed as a prediction from your model ). Your code could use the results and perform aggregations or more complex computations on the result.
If, in the code of your stored procedure, you need to get extra information from your model, you can traverse the content of the mining model using the object model.
The article at http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/4264.aspx contains such a stored procedure, which requires both data and model content information, so I think it may be a good example. The data is coming directly from the model, with a drillthrough query. You can replace that query with a CALL SystemOpenQuery or prediction against an OPENQUERY statement.
Hope this helps
|||Yes, this is helpful. I'm looking at the material you referenced to see if it completely answers my question. Unfortunately, I don't seem able to progress pass the logon screen at sqlserverdatamining at the moment, so I can't get the .cs example...|||Do you have an account on sqlserverdatamining.com? Do you have problems logging in with your account? Or creating a new account
Tuesday, February 14, 2012
Cursors vs. Queries
Cursor query.
If I am correct (and please tell me if I'm wrong) its
about 20 times faster than putting the same statement in a
cursor.
However cursors are more controllable, and better for
error checking and error recovery.
My rule of thumb.
If you can get a way with using a query then use it,
however you will need cursors to do anything complex.
J
quote:
>--Original Message--
>Can someone give me an example of when I would use a
cursor instead of a query
quote:> however you will need cursors to do anything complex.
>.
>
Could you give an example of a problem that is too complex for a query
solution?
David Portas
--
Please reply only to the newsgroup
--
Cursors vs. Queries
ryIf you can use a query to get what you want you should never use a cursor.
Cursors are best for maintenance type tasks where you need to loop thru say
a collection of tables and do something such as reindexing. As for data use
they should be used as a last resort only. Sometimes it is just not
practical or even feasible to issue strictly set based commands and get what
you want so a cursor might be necessary. For instance if you have to do
some work on each row that can only be done thru calling a stored
procedure(s) you might create a cursor and loop thru calling it for each
row. Otherwise try to use standard set based commands.
Andrew J. Kelly SQL MVP
"Vincent Jones" <vncntj@.hotmail.com> wrote in message
news:ba2a2d30.0401140615.581598f2@.posting.google.com...
quote:
> Can someone give me an example of when I would use a cursor instead of a
query|||In a properly designed database the occassions when a cursor is a good and
efficient solution to a problem are rare.
Sometimes cursors are useful for certain administrative functions or for
processes such as Andrew described.
Very occassionally you find a data manipulation problem which doesn't have a
feasible set-based solution. If you think you've encountered one of those
situations then post your problem here and see if someone else can suggest
an alternative.
In reality, many examples of cursor code are written by programmers who
aren't familiar with SQL and are more comfortable with row-by-row sequential
processing than with set-based SELECT statements. So for data manipulation
problems my general rule would be: If you think you need a cursor - think
again. If you're sure you need a cursor - get a second opinion.
David Portas
--
Please reply only to the newsgroup
--
Cursors vs. Queries
Cursors are best for maintenance type tasks where you need to loop thru say
a collection of tables and do something such as reindexing. As for data use
they should be used as a last resort only. Sometimes it is just not
practical or even feasible to issue strictly set based commands and get what
you want so a cursor might be necessary. For instance if you have to do
some work on each row that can only be done thru calling a stored
procedure(s) you might create a cursor and loop thru calling it for each
row. Otherwise try to use standard set based commands.
--
Andrew J. Kelly SQL MVP
"Vincent Jones" <vncntj@.hotmail.com> wrote in message
news:ba2a2d30.0401140615.581598f2@.posting.google.com...
> Can someone give me an example of when I would use a cursor instead of a
query|||One query statement is much faster than the equivalent
Cursor query.
If I am correct (and please tell me if I'm wrong) its
about 20 times faster than putting the same statement in a
cursor.
However cursors are more controllable, and better for
error checking and error recovery.
My rule of thumb.
If you can get a way with using a query then use it,
however you will need cursors to do anything complex.
J
>--Original Message--
>Can someone give me an example of when I would use a
cursor instead of a query
>.
>|||In a properly designed database the occassions when a cursor is a good and
efficient solution to a problem are rare.
Sometimes cursors are useful for certain administrative functions or for
processes such as Andrew described.
Very occassionally you find a data manipulation problem which doesn't have a
feasible set-based solution. If you think you've encountered one of those
situations then post your problem here and see if someone else can suggest
an alternative.
In reality, many examples of cursor code are written by programmers who
aren't familiar with SQL and are more comfortable with row-by-row sequential
processing than with set-based SELECT statements. So for data manipulation
problems my general rule would be: If you think you need a cursor - think
again. If you're sure you need a cursor - get a second opinion.
--
David Portas
--
Please reply only to the newsgroup
--|||> however you will need cursors to do anything complex.
Could you give an example of a problem that is too complex for a query
solution?
--
David Portas
--
Please reply only to the newsgroup
--