Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Friday, March 30, 2012

raise message from Update Trigger from External App

Hello,
I can raise this message from an Update Trigger in Query Analyzer when I
update the recordID field of my table:
RAISERROR ('this is a test message from SubDetail Update 7', 16, 10)
Is it possible to raise this message from an external app? How is this
achieved? Actually, I am sure this is possible because I remember doing it.
I just can't remember what I did because I did not document it.
Thanks,
RichWhat is this "external app"? An application that you write yourself? A TSQL
error (which is what you
raise using RAISERROR) is returned to the client application. The client app
lications is connected
to the database using an API, like ADO.NET. And, sure, you can have your dat
abase application
connect to SQL Server and issue a RAISERROR command, and have that error mes
sage be returned to the
same app, but that sounds a bit ... meaningless. If you give us more informa
tion, we can probably
give some suggestion.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Rich" <Rich@.discussions.microsoft.com> wrote in message
news:54A80BEF-6285-4F6A-8B60-F06007C1BDEF@.microsoft.com...
> Hello,
> I can raise this message from an Update Trigger in Query Analyzer when I
> update the recordID field of my table:
> RAISERROR ('this is a test message from SubDetail Update 7', 16, 10)
> Is it possible to raise this message from an external app? How is this
> achieved? Actually, I am sure this is possible because I remember doing i
t.
> I just can't remember what I did because I did not document it.
> Thanks,
> Rich|||The external app in this case is an Access ADP. I had to modify a trigger a
few months ago, and I added a raiseerror message at the end to see my result
s
in QA - not error results - just checking what parameter was being used. I
accidentally left the raiseerror message in the trigger, and then I got a
call from an End User stating that this message was coming up all of a sudde
n
when she made updates to the table.
I found the table and reactivated the raiseerror message and I get it when I
updaet a field. The only thing I noticed is that the field I update in this
table (the master table) is not a key field. In the Detail table when I
update the RecordID field this action does not raise the message like in the
Master table. I guess my question is if this is something fundamental that
I
am missing or is it something that I need to dig around to see what is going
on?
"Tibor Karaszi" wrote:

> What is this "external app"? An application that you write yourself? A TSQ
L error (which is what you
> raise using RAISERROR) is returned to the client application. The client a
pplications is connected
> to the database using an API, like ADO.NET. And, sure, you can have your d
atabase application
> connect to SQL Server and issue a RAISERROR command, and have that error m
essage be returned to the
> same app, but that sounds a bit ... meaningless. If you give us more infor
mation, we can probably
> give some suggestion.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Rich" <Rich@.discussions.microsoft.com> wrote in message
> news:54A80BEF-6285-4F6A-8B60-F06007C1BDEF@.microsoft.com...
>|||Well, I was able to raise that message if I physically update the RecordID -
meaning I go to the live table in the Access ADP which is the same thing tha
t
was going on with the Master table - where the End user was physically
writing to the table through a form. But if I update the table
programmatically from the ADP, then the message does not come up.
While I am at it, I want to alter/replace my raiseerror message. I used the
sp_addmessage sp. Since my message already exists as 50001, I don't want to
add another message. I want to alter this one. But I get an error message
in QA saying that I need to use REPLACE to alter the message for ID 50001.
I
don't know the syntax for this. I have tried variations such as:
USE master
EXEC sp_addmessage 50001, 16,
select replace('This is a test custome message', 'custome', 'custom')
and placing REplace in other locations with no success. Any suggestions how
to do this correctly would be greatly appreciated.
"Rich" wrote:
> The external app in this case is an Access ADP. I had to modify a trigger
a
> few months ago, and I added a raiseerror message at the end to see my resu
lts
> in QA - not error results - just checking what parameter was being used.
I
> accidentally left the raiseerror message in the trigger, and then I got a
> call from an End User stating that this message was coming up all of a sud
den
> when she made updates to the table.
> I found the table and reactivated the raiseerror message and I get it when
I
> updaet a field. The only thing I noticed is that the field I update in th
is
> table (the master table) is not a key field. In the Detail table when I
> update the RecordID field this action does not raise the message like in t
he
> Master table. I guess my question is if this is something fundamental tha
t I
> am missing or is it something that I need to dig around to see what is goi
ng
> on?
> "Tibor Karaszi" wrote:
>|||You more or less lost me on the logic part, but from a technical viewpoint:
If you see the error when executing a statement which will result in the tri
gger being called using
TSQL but not when using ADP, then probably ADP is masking that error and you
should check with an
Access group to see how you can rectify this behavior in Access. Use Profile
r to catch the TSQL
command being submitted from Access just to make sure of what is happening o
n the server level.
Here is how you replace a message text:
EXEC sp_addmessage 50001, 16,
N'Old message text'
GO
EXEC sp_addmessage 50001, 16,
N'NEW message text', @.replace = 'replace'
GO
RAISERROR(50001, -1, 1)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Rich" <Rich@.discussions.microsoft.com> wrote in message
news:4B003260-9016-4FE1-B324-F48A24007CD7@.microsoft.com...
> Well, I was able to raise that message if I physically update the RecordID
-
> meaning I go to the live table in the Access ADP which is the same thing t
hat
> was going on with the Master table - where the End user was physically
> writing to the table through a form. But if I update the table
> programmatically from the ADP, then the message does not come up.
> While I am at it, I want to alter/replace my raiseerror message. I used t
he
> sp_addmessage sp. Since my message already exists as 50001, I don't want
to
> add another message. I want to alter this one. But I get an error messag
e
> in QA saying that I need to use REPLACE to alter the message for ID 50001.
I
> don't know the syntax for this. I have tried variations such as:
> USE master
> EXEC sp_addmessage 50001, 16,
> select replace('This is a test custome message', 'custome', 'custom')
> and placing REplace in other locations with no success. Any suggestions h
ow
> to do this correctly would be greatly appreciated.
>
> "Rich" wrote:
>|||Thank you for explaining how to replace a custome message.
"Tibor Karaszi" wrote:

> You more or less lost me on the logic part, but from a technical viewpoint
:
> If you see the error when executing a statement which will result in the t
rigger being called using
> TSQL but not when using ADP, then probably ADP is masking that error and y
ou should check with an
> Access group to see how you can rectify this behavior in Access. Use Profi
ler to catch the TSQL
> command being submitted from Access just to make sure of what is happening
on the server level.
> Here is how you replace a message text:
> EXEC sp_addmessage 50001, 16,
> N'Old message text'
> GO
> EXEC sp_addmessage 50001, 16,
> N'NEW message text', @.replace = 'replace'
> GO
> RAISERROR(50001, -1, 1)
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Rich" <Rich@.discussions.microsoft.com> wrote in message
> news:4B003260-9016-4FE1-B324-F48A24007CD7@.microsoft.com...
>

Friday, March 9, 2012

Quick search algorithm in database

Hi,

I need in my app. a good search option in datafields of dataset.

Maybe someone can help me find an algorithm?

WHat do you mean by a lagorythm for searching in datafields ?

Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||Create a DataView on top of one of the DataTables in your DataSet, and set the Filter property of the view. Would that help?

Thanks,

Marcel van der Holst
[MSFT]

Wednesday, March 7, 2012

Quick Question

hello I am trying to use the reportviewer control in a custom web app.
Currently using a frame based design where I have a treeview of all the
reports available and a click on the individual report should open the
reportviewer control in another frame.
Currently facing issues passing the exact URL.
here is how my base URL
newNode.NavigateUrl = "http://server-name/reportserver?" & cirep.Path &
"
Trying passing target but without much luck. Anyway knows how to do it
?
Thanx.
Q2 I know that using frames is generally not preferred.
is there a better way to achieve what i am trying to accomplish with a
treeview or a menu on the Left side and the reportviewer showing up on
the right side ?
Thx
RaviSince frames really aren't supported by the gui in visual studio, I
generally just put the nav and the data on the same page. Network speeds
what they are, it shouldn't be an issue.
Mike G.
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109019748.507926.276380@.c13g2000cwb.googlegroups.com...
> hello I am trying to use the reportviewer control in a custom web app.
> Currently using a frame based design where I have a treeview of all the
> reports available and a click on the individual report should open the
> reportviewer control in another frame.
> Currently facing issues passing the exact URL.
> here is how my base URL
> newNode.NavigateUrl = "http://server-name/reportserver?" & cirep.Path &
> "
> Trying passing target but without much luck. Anyway knows how to do it
> ?
> Thanx.
> Q2 I know that using frames is generally not preferred.
> is there a better way to achieve what i am trying to accomplish with a
> treeview or a menu on the Left side and the reportviewer showing up on
> the right side ?
> Thx
> Ravi
>|||you mean something like using a table or
using different dataregions or rectangles ?|||I mean just putting the report viewer control in an html table.
Mike G.
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109025325.041436.297720@.g14g2000cwa.googlegroups.com...
> you mean something like using a table or
> using different dataregions or rectangles ?
>|||Hello Mike,
Thanks for the info. This is what I am trying to do.
I want a treeview as the navigation on the left and the reportviewer
next to it.
But the issue i am facing is that when I use a treeview, I set the
values to the treeviewnode.navigateUrl and I click on the link to a
report, it is rendering on the whole page.
But When I use a dropdown menu I could make it render to a certain
region like a cell in a Html table. good thing about the dropdown menu
is that there is OnClick Event which I dont seem to have in the
treeview control I downloaded from the Asp.net web controls.
Any hints on how to go about ?
Thankx very much
Ravi|||(Hmmm. I thought I replied to this yesterday, but I don't see it now.
Sorry if this is a dup response.)
I'm not sure I understand how you are rendering the report. Are you
redirecting to a url, using the render method...? Also, do you know about
the report viewer control?
Mike G.
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109038650.929162.40500@.c13g2000cwb.googlegroups.com...
> Hello Mike,
> Thanks for the info. This is what I am trying to do.
> I want a treeview as the navigation on the left and the reportviewer
> next to it.
> But the issue i am facing is that when I use a treeview, I set the
> values to the treeviewnode.navigateUrl and I click on the link to a
> report, it is rendering on the whole page.
> But When I use a dropdown menu I could make it render to a certain
> region like a cell in a Html table. good thing about the dropdown menu
> is that there is OnClick Event which I dont seem to have in the
> treeview control I downloaded from the Asp.net web controls.
> Any hints on how to go about ?
> Thankx very much
> Ravi
>|||I am using the reportviewer control. It may sound stupid but my exact
problem has been how do I tie the reportviewer control to a node in the
treeview.
I am using the treenode.navigateUrl property to set the url, which is
causing it to render it all over the screen.
I dont have this problem when I use a dropdown menu of reports and a Go
button. I use the Onclick event of the go button to set the properties
to the reportviewer control.
Thx
Ravi|||Ok, so you're passing the url of the report to the treeview control?
Instead, the navigateurl should be to the same page (like a postback) and
set the querystring to be the value of the report you're trying to view
(navigateurl = samepage.aspx?report=" & reportvar). (of course, instead of
a querystring you could use the viewstate object or a session object or
.... ) On the load event of the page, check if there is a value in the
querystring, and if so set the property of the reportviewer.
Was that vague enough?
Mike G.
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109087785.988437.208740@.o13g2000cwo.googlegroups.com...
>I am using the reportviewer control. It may sound stupid but my exact
> problem has been how do I tie the reportviewer control to a node in the
> treeview.
> I am using the treenode.navigateUrl property to set the url, which is
> causing it to render it all over the screen.
> I dont have this problem when I use a dropdown menu of reports and a Go
> button. I use the Onclick event of the go button to set the properties
> to the reportviewer control.
> Thx
> Ravi
>|||Hey Mike,
here is the URL i am passing to the navigateUrl property of the
Treenodes.
This posts the report to the same page. But it doesnt render in the
reportviewer control object I have in a html table in the same page,
which i am trying to achieve.
http://servername/reportserver?/folder/report1&rs:Command=Render&rc:zoom=75&rc:toolbar=true
thx
ravi|||Maybe I don't understand: How are you rendering the report? It sounds like
you are either redirecting the user to the report page or using the render
method of the web service?
Do you know about the asp.net report viewer control?
Mike
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109038650.929162.40500@.c13g2000cwb.googlegroups.com...
> Hello Mike,
> Thanks for the info. This is what I am trying to do.
> I want a treeview as the navigation on the left and the reportviewer
> next to it.
> But the issue i am facing is that when I use a treeview, I set the
> values to the treeviewnode.navigateUrl and I click on the link to a
> report, it is rendering on the whole page.
> But When I use a dropdown menu I could make it render to a certain
> region like a cell in a Html table. good thing about the dropdown menu
> is that there is OnClick Event which I dont seem to have in the
> treeview control I downloaded from the Asp.net web controls.
> Any hints on how to go about ?
> Thankx very much
> Ravi
>|||This is more of an asp.net question than reporting services, but the url
you're passing to the treeview tells it where to navigate. You're telling
it to navigate away from your page and to the report page. Instead, the
link should be closer to:
http://server/path/nameofcurrentpage.aspx?report=report1
you then have to have code on nameofcurrentpage.aspx that retrieves the
value from the querystring and changes the property of the report viewer
control appropriately.
For more info, look for docs on querystrings in asp.net.
Mike G.
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109090642.640699.254080@.l41g2000cwc.googlegroups.com...
> Hey Mike,
> here is the URL i am passing to the navigateUrl property of the
> Treenodes.
> This posts the report to the same page. But it doesnt render in the
> reportviewer control object I have in a html table in the same page,
> which i am trying to achieve.
> http://servername/reportserver?/folder/report1&rs:Command=Render&rc:zoom=75&rc:toolbar=true
> thx
> ravi
>|||You can do what you want using a combination of a modified ReportViewer
control and the rc:ReplacementRoot parameter. You can see where we came up
with this idea here:
http://groups-beta.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/fc71a51d020123ed/a295a0d77da59b6c?q=replacementroot&_done=%2Fgroup%2Fmicrosoft.public.sqlserver.reportingsvcs%2Fsearch%3Fgroup%3Dmicrosoft.public.sqlserver.reportingsvcs%26q%3Dreplacementroot%26qt_g%3D1%26&_doneTitle=Back+to+Search&&d#a295a0d77da59b6c
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109019748.507926.276380@.c13g2000cwb.googlegroups.com...
> hello I am trying to use the reportviewer control in a custom web app.
> Currently using a frame based design where I have a treeview of all the
> reports available and a click on the individual report should open the
> reportviewer control in another frame.
> Currently facing issues passing the exact URL.
> here is how my base URL
> newNode.NavigateUrl = "http://server-name/reportserver?" & cirep.Path &
> "
> Trying passing target but without much luck. Anyway knows how to do it
> ?
> Thanx.
> Q2 I know that using frames is generally not preferred.
> is there a better way to achieve what i am trying to accomplish with a
> treeview or a menu on the Left side and the reportviewer showing up on
> the right side ?
> Thx
> Ravi
>|||Hello jeff,
I have modified the reportviewer code adding your code and created the
new dll.
I also added the rc:ReplacementRoot = MyIframe in the Build URl string
method.
Do I need to do that ?
But when I actually ran the app with the new reportviewer DLL (removed
the old and added new reference to reportviewer, just to be sure) it is
still opening the drillthrough reports in a different Browser window.
And I dont see the rc:replacementroot part in the URL of the
drillthrough.
Am i missing anything ?
Thanks
Ravi|||Sorry it took so long to get back to you. I answered these questions in
another thread.
By the way, there's not a need to start all these new threads for the same
issue! Now others will have a difficult time finding the answer to your
question, since you started so many different threads on this same issue.
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109276158.622182.138890@.f14g2000cwb.googlegroups.com...
> Hello jeff,
> I have modified the reportviewer code adding your code and created the
> new dll.
> I also added the rc:ReplacementRoot = MyIframe in the Build URl string
> method.
> Do I need to do that ?
> But when I actually ran the app with the new reportviewer DLL (removed
> the old and added new reference to reportviewer, just to be sure) it is
> still opening the drillthrough reports in a different Browser window.
> And I dont see the rc:replacementroot part in the URL of the
> drillthrough.
> Am i missing anything ?
> Thanks
> Ravi
>

Saturday, February 25, 2012

Quick 6.5 question

Does anyone know the maximum number of rows a SQL 6.5
table can hold..
I've got an old 3rd party app suddenly throwing out lots
of these errors - 'The server could not expand a table
because the table reached the maximum size. '
Thanks in advance.Does the NT event log say, Event ID 2009'
//Ralph
>--Original Message--
>Does anyone know the maximum number of rows a SQL 6.5
>table can hold..
>I've got an old 3rd party app suddenly throwing out lots
>of these errors - 'The server could not expand a table
>because the table reached the maximum size. '
>
>Thanks in advance.
>.
>|||ok,
It doesn't neccessary need to be table in SQL server,
according to articles I found it is when creating a table
in the memory (system).
http://www.eventid.net/display.asp?eventid=2009&source=
The last section of that page you got links and
explanations about the error....
Good Luck.
//Ralph
>--Original Message--
>yes it does..
>
>>--Original Message--
>>Does the NT event log say, Event ID 2009'
>>//Ralph
>>--Original Message--
>>Does anyone know the maximum number of rows a SQL 6.5
>>table can hold..
>>I've got an old 3rd party app suddenly throwing out
lots
>>of these errors - 'The server could not expand a table
>>because the table reached the maximum size. '
>>
>>Thanks in advance.
>>.
>>.
>.
>|||Ralph, thanks - looks like a very useful link...
Cheers, steve
>--Original Message--
>ok,
>It doesn't neccessary need to be table in SQL server,
>according to articles I found it is when creating a table
>in the memory (system).
>http://www.eventid.net/display.asp?eventid=2009&source=
>The last section of that page you got links and
>explanations about the error....
>Good Luck.
>//Ralph
>
>>--Original Message--
>>yes it does..
>>
>>--Original Message--
>>Does the NT event log say, Event ID 2009'
>>//Ralph
>>--Original Message--
>>Does anyone know the maximum number of rows a SQL 6.5
>>table can hold..
>>I've got an old 3rd party app suddenly throwing out
>lots
>>of these errors - 'The server could not expand a table
>>because the table reached the maximum size. '
>>
>>Thanks in advance.
>>.
>>.
>>.
>.
>