Is it true that I need to enable network protocols to communicate with a
named instance of MSDE SP4 locally?
Installing a named instance with DISABLENETWORKPROTOCOLS=0 seems to prevent
osql connecting to it. I don't want remote access - only local access (so
it would be nice not to load the network protocols). Or have I missed
something?
hi Graham,
Graham Morris wrote:
> Is it true that I need to enable network protocols to communicate
> with a named instance of MSDE SP4 locally?
> Installing a named instance with DISABLENETWORKPROTOCOLS=0 seems to
> prevent osql connecting to it. I don't want remote access - only
> local access (so it would be nice not to load the network protocols).
> Or have I missed something?
you do not need to enable network protocols to connect to local named
instances as all local instances are available to reach via shared memory..
what kind of problem are you experiencing? what is the exception you are
reported with?
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||I start with a Windows XP SP2 system in a workgroup, with nothing installed
except Tweakui (I use VirtualPC to start with the same system each time).
I log in with local administrator privileges.
I make sure all the latest updates are installed from Windows Update.
I navigate to the MSDE SP4 directory and enter 'Setup INSTANCENAME=MYINST
BLANKSAPWD=1'
I reboot so that service MSSQL$MYINST autostarts.
On reboot the service manager shows an empty circle (no 'play' nor 'stop'
symbol). The dropdown does not show my server and instance.
I open a command prompt and enter "osql -S .\MYINST -E" and I get:
[DBNETLIB]SQL Server does not exist or access denied.
[DBNETLIB]ConnectionOpen (Connect()).
I now run C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Svrnetcn.exe,
and add 'Named Pipes'.
The osql command now correctly displays the 1> prompt.
I restart the service manager and it know shows the state of the service.
I find that if I install a blank instance I don't need to and network
libraries. What could be happening?
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:3ovjn4F7r0d5U1@.individual.net...
> hi Graham,
> Graham Morris wrote:
> you do not need to enable network protocols to connect to local named
> instances as all local instances are available to reach via shared
> memory..
> what kind of problem are you experiencing? what is the exception you are
> reported with?
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||hi,
Graham Morris wrote:
> I start with a Windows XP SP2 system in a workgroup, with nothing
> installed except Tweakui (I use VirtualPC to start with the same
> system each time).
> I log in with local administrator privileges.
> I make sure all the latest updates are installed from Windows Update.
> I navigate to the MSDE SP4 directory and enter 'Setup
> INSTANCENAME=MYINST BLANKSAPWD=1'
> I reboot so that service MSSQL$MYINST autostarts.
> On reboot the service manager shows an empty circle (no 'play' nor
> 'stop' symbol). The dropdown does not show my server and instance.
disabling network protocols can cause this as the SQL Server Service Manager
can fail to enlist instances of the like, as reported in
http://support.microsoft.com/default...b;EN-US;814132
> I open a command prompt and enter "osql -S .\MYINST -E" and I get:
> [DBNETLIB]SQL Server does not exist or access denied.
> [DBNETLIB]ConnectionOpen (Connect()).
> I now run C:\Program Files\Microsoft SQL
> Server\80\Tools\Binn\Svrnetcn.exe, and add 'Named Pipes'.
> The osql command now correctly displays the 1> prompt.
> I restart the service manager and it know shows the state of the
> service.
> I find that if I install a blank instance I don't need to and network
> libraries. What could be happening?
the reported exception, as indicated in
http://support.microsoft.com/default...6&Product=sql,
is a general MDAC related problem, probably caused by
http://support.microsoft.com/kb/328383/en-us
I'll try installing a virtual machine may self ...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||hi,
Andrea Montanari wrote:
> hi,
> Graham Morris wrote:
>
> I'll try installing a virtual machine may self ...
just tried... with the same scenario you reported... after installation +
reboot I logged in as local WinXP admin, the SQL Server Service Manager is
"empty", but I can log in via osql with no problem at all...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||I think I've solved this: without network protocols the osql -S parameter
doesn't like the syntax ".\MYINST". Put in the full host name (e. g.
MYHOST\MYINST) and it works!
While you're listening though: this is part of a larger problem: I can't
connect to MSDE SP4 on some domain machines (same problem with osql) until I
remove then replace the network libraries with svrnetcn.exe. This sounds as
though it might be a group policy problem, but I've no idea what. Ring any
bells?
Anyway thanks for the help on the first problem.
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:3p0d08F7tp8aU1@.individual.net...
> hi,
> Andrea Montanari wrote:
>
> just tried... with the same scenario you reported... after installation +
> reboot I logged in as local WinXP admin, the SQL Server Service Manager is
> "empty", but I can log in via osql with no problem at all...
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||hi Graham
Graham Morris wrote:
> While you're listening though: this is part of a larger problem: I
> can't connect to MSDE SP4 on some domain machines (same problem with
> osql) until I remove then replace the network libraries with
> svrnetcn.exe. This sounds as though it might be a group policy
> problem, but I've no idea what. Ring any bells?
actually not... never heard of such a constraint.. you can have "problems"
connecting if you are not listed in the granted logins list, or if you have
network troubles, but as long as MDAC stack is quiet consistent on remote
clients I never heard of such a problem... I'll keep investigating
thought...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
2012年2月24日星期五
Disable/Enable Triggers
I have stored procedure that disable triggers from another table then
completes the
body for the stored procedures then enables the triggers.
Is there an easy way to complete this task of disable and enable triggers
with very little overhead.
Thank You,
On Thu, 3 Nov 2005 14:30:03 -0800, Joe K. <Joe
K.@.discussions.microsoft.com> wrote:
>I have stored procedure that disable triggers from another table then
>completes the
>body for the stored procedures then enables the triggers.
>Is there an easy way to complete this task of disable and enable triggers
>with very little overhead.
>Thank You,
Hi Joe,
The good news: look up
ALTER TABLE table
{ ENABLE | DISABLE } TRIGGER { ALL | trigger_name [,..n] }
in Books Online.
The bad news: this is not a per-connection setting. If you disable the
trigger, it won't fire for ANY connection that's accessing the table.
Unless you can be sure that the stored proc is the only active process
at the time, I'd urge you to find another way to achieve what you want.
If you post more information about what business problem you're trying
to solve, we can help you find a better way.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
completes the
body for the stored procedures then enables the triggers.
Is there an easy way to complete this task of disable and enable triggers
with very little overhead.
Thank You,
On Thu, 3 Nov 2005 14:30:03 -0800, Joe K. <Joe
K.@.discussions.microsoft.com> wrote:
>I have stored procedure that disable triggers from another table then
>completes the
>body for the stored procedures then enables the triggers.
>Is there an easy way to complete this task of disable and enable triggers
>with very little overhead.
>Thank You,
Hi Joe,
The good news: look up
ALTER TABLE table
{ ENABLE | DISABLE } TRIGGER { ALL | trigger_name [,..n] }
in Books Online.
The bad news: this is not a per-connection setting. If you disable the
trigger, it won't fire for ANY connection that's accessing the table.
Unless you can be sure that the stored proc is the only active process
at the time, I'd urge you to find another way to achieve what you want.
If you post more information about what business problem you're trying
to solve, we can help you find a better way.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
Disable/Enable Triggers
I have stored procedure that disable triggers from another table then
completes the
body for the stored procedures then enables the triggers.
Is there an easy way to complete this task of disable and enable triggers
with very little overhead.
Thank You,On Thu, 3 Nov 2005 14:30:03 -0800, Joe K. <Joe
K.@.discussions.microsoft.com> wrote:
>I have stored procedure that disable triggers from another table then
>completes the
>body for the stored procedures then enables the triggers.
>Is there an easy way to complete this task of disable and enable triggers
>with very little overhead.
>Thank You,
Hi Joe,
The good news: look up
ALTER TABLE table
{ ENABLE | DISABLE } TRIGGER { ALL | trigger_name [,..n] }
in Books Online.
The bad news: this is not a per-connection setting. If you disable the
trigger, it won't fire for ANY connection that's accessing the table.
Unless you can be sure that the stored proc is the only active process
at the time, I'd urge you to find another way to achieve what you want.
If you post more information about what business problem you're trying
to solve, we can help you find a better way.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
completes the
body for the stored procedures then enables the triggers.
Is there an easy way to complete this task of disable and enable triggers
with very little overhead.
Thank You,On Thu, 3 Nov 2005 14:30:03 -0800, Joe K. <Joe
K.@.discussions.microsoft.com> wrote:
>I have stored procedure that disable triggers from another table then
>completes the
>body for the stored procedures then enables the triggers.
>Is there an easy way to complete this task of disable and enable triggers
>with very little overhead.
>Thank You,
Hi Joe,
The good news: look up
ALTER TABLE table
{ ENABLE | DISABLE } TRIGGER { ALL | trigger_name [,..n] }
in Books Online.
The bad news: this is not a per-connection setting. If you disable the
trigger, it won't fire for ANY connection that's accessing the table.
Unless you can be sure that the stored proc is the only active process
at the time, I'd urge you to find another way to achieve what you want.
If you post more information about what business problem you're trying
to solve, we can help you find a better way.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
Disable/Enable Triggers
I have stored procedure that disable triggers from another table then
completes the
body for the stored procedures then enables the triggers.
Is there an easy way to complete this task of disable and enable triggers
with very little overhead.
Thank You,On Thu, 3 Nov 2005 14:30:03 -0800, Joe K. <Joe
K.@.discussions.microsoft.com> wrote:
>I have stored procedure that disable triggers from another table then
>completes the
>body for the stored procedures then enables the triggers.
>Is there an easy way to complete this task of disable and enable triggers
>with very little overhead.
>Thank You,
Hi Joe,
The good news: look up
ALTER TABLE table
{ ENABLE | DISABLE } TRIGGER { ALL | trigger_name [,..n] }
in Books Online.
The bad news: this is not a per-connection setting. If you disable the
trigger, it won't fire for ANY connection that's accessing the table.
Unless you can be sure that the stored proc is the only active process
at the time, I'd urge you to find another way to achieve what you want.
If you post more information about what business problem you're trying
to solve, we can help you find a better way.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
completes the
body for the stored procedures then enables the triggers.
Is there an easy way to complete this task of disable and enable triggers
with very little overhead.
Thank You,On Thu, 3 Nov 2005 14:30:03 -0800, Joe K. <Joe
K.@.discussions.microsoft.com> wrote:
>I have stored procedure that disable triggers from another table then
>completes the
>body for the stored procedures then enables the triggers.
>Is there an easy way to complete this task of disable and enable triggers
>with very little overhead.
>Thank You,
Hi Joe,
The good news: look up
ALTER TABLE table
{ ENABLE | DISABLE } TRIGGER { ALL | trigger_name [,..n] }
in Books Online.
The bad news: this is not a per-connection setting. If you disable the
trigger, it won't fire for ANY connection that's accessing the table.
Unless you can be sure that the stored proc is the only active process
at the time, I'd urge you to find another way to achieve what you want.
If you post more information about what business problem you're trying
to solve, we can help you find a better way.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
disable/enable all SQL Agent jobs in a non cursor approach
Is there a way to disable/enable all SQL Agent jobs using a set based
operation as opposed to a cursory approach that i can think of right now
If so, can one provide the SQL for itI don't think so, because you should be calling a stored procedure for each
job. (As opposed to updating a table somewhere in MSDB, which you shouldn't
do without fully understanding what else the procedure does.)
What is wrong with a cursor approach for this type of one-off, admin task?
On 2/28/05 2:53 PM, in article eGUAu8cHFHA.904@.tk2msftngp13.phx.gbl,
"Hassan" <fatima_ja@.hotmail.com> wrote:
> Is there a way to disable/enable all SQL Agent jobs using a set based
> operation as opposed to a cursory approach that i can think of right now
> If so, can one provide the SQL for it
>|||Nothing wrong, always heard dreaded things about cursors and was just trying
to see if one could do so in a set based approach ?
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:BE4926C4.181D%ten.xoc@.dnartreb.noraa...
> I don't think so, because you should be calling a stored procedure for
each
> job. (As opposed to updating a table somewhere in MSDB, which you
shouldn't
> do without fully understanding what else the procedure does.)
> What is wrong with a cursor approach for this type of one-off, admin task?
>
>
> On 2/28/05 2:53 PM, in article eGUAu8cHFHA.904@.tk2msftngp13.phx.gbl,
> "Hassan" <fatima_ja@.hotmail.com> wrote:
>
>|||NO! Not when you have to call a stored procedure for each item in the set.
And like I said, for one-off admin tasks that you're not performing
regularly, I wouldn't spend too much time worrying about the performance of
your chosen approach. Just get the task done, and then work on doing
whatever you need to do to not require that task to be necessary in the
future.
On 2/28/05 11:43 PM, in article uDpX3khHFHA.2276@.TK2MSFTNGP15.phx.gbl,
"Hassan" <fatima_ja@.hotmail.com> wrote:
> Nothing wrong, always heard dreaded things about cursors and was just tryi
ng
> to see if one could do so in a set based approach ?
operation as opposed to a cursory approach that i can think of right now
If so, can one provide the SQL for itI don't think so, because you should be calling a stored procedure for each
job. (As opposed to updating a table somewhere in MSDB, which you shouldn't
do without fully understanding what else the procedure does.)
What is wrong with a cursor approach for this type of one-off, admin task?
On 2/28/05 2:53 PM, in article eGUAu8cHFHA.904@.tk2msftngp13.phx.gbl,
"Hassan" <fatima_ja@.hotmail.com> wrote:
> Is there a way to disable/enable all SQL Agent jobs using a set based
> operation as opposed to a cursory approach that i can think of right now
> If so, can one provide the SQL for it
>|||Nothing wrong, always heard dreaded things about cursors and was just trying
to see if one could do so in a set based approach ?
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:BE4926C4.181D%ten.xoc@.dnartreb.noraa...
> I don't think so, because you should be calling a stored procedure for
each
> job. (As opposed to updating a table somewhere in MSDB, which you
shouldn't
> do without fully understanding what else the procedure does.)
> What is wrong with a cursor approach for this type of one-off, admin task?
>
>
> On 2/28/05 2:53 PM, in article eGUAu8cHFHA.904@.tk2msftngp13.phx.gbl,
> "Hassan" <fatima_ja@.hotmail.com> wrote:
>
>|||NO! Not when you have to call a stored procedure for each item in the set.
And like I said, for one-off admin tasks that you're not performing
regularly, I wouldn't spend too much time worrying about the performance of
your chosen approach. Just get the task done, and then work on doing
whatever you need to do to not require that task to be necessary in the
future.
On 2/28/05 11:43 PM, in article uDpX3khHFHA.2276@.TK2MSFTNGP15.phx.gbl,
"Hassan" <fatima_ja@.hotmail.com> wrote:
> Nothing wrong, always heard dreaded things about cursors and was just tryi
ng
> to see if one could do so in a set based approach ?
2012年2月17日星期五
Disable Hyperlink in EXCEL
Can I disable/hide the hyperlink (jump to report) once the report is exported
to Excel but ENABLE in browser ?"May Liu" wrote:
> Can I disable/hide the hyperlink (jump to report) once the report is exported
> to Excel but ENABLE in browser ?
I asked a similar question myself:
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
No reply yet. This seems like a pretty annoying problem, has anyone else
faced it? Anyone have ideas for workarounds (none that I've thought of
have worked yet)?
Tim|||This is not supported natively by the Report Server, but here is an approach
you can try:
Since the Report Server is a web application, you should be able to write
custom code to obtain the report URL from HttpContext.Current. Then, you can
determine which format the report is requested. If this works, you can base
the Jump To action on a expression which calls your custom function and
return "" if the export format is Excel. Please note that
HttpContext.Current is not available when the report is previewed under the
Report Designer so you have to check if it is null.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"timseal" <timseal@.discussions.microsoft.com> wrote in message
news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> "May Liu" wrote:
> > Can I disable/hide the hyperlink (jump to report) once the report is
exported
> > to Excel but ENABLE in browser ?
> I asked a similar question myself:
>
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> No reply yet. This seems like a pretty annoying problem, has anyone else
> faced it? Anyone have ideas for workarounds (none that I've thought of
> have worked yet)?
> Tim|||I write the following code in Custom Code:
Function GetExportFormat() as string
GetExportFormat = System.Web.HttpContext.Current
End Function
Error is shown : HttpContext is not a member of Web.
What's wrong with my code ?
"Teo Lachev [MVP]" wrote:
> This is not supported natively by the Report Server, but here is an approach
> you can try:
> Since the Report Server is a web application, you should be able to write
> custom code to obtain the report URL from HttpContext.Current. Then, you can
> determine which format the report is requested. If this works, you can base
> the Jump To action on a expression which calls your custom function and
> return "" if the export format is Excel. Please note that
> HttpContext.Current is not available when the report is previewed under the
> Report Designer so you have to check if it is null.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "timseal" <timseal@.discussions.microsoft.com> wrote in message
> news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> >
> > "May Liu" wrote:
> >
> > > Can I disable/hide the hyperlink (jump to report) once the report is
> exported
> > > to Excel but ENABLE in browser ?
> >
> > I asked a similar question myself:
> >
> http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> >
> > No reply yet. This seems like a pretty annoying problem, has anyone else
> > faced it? Anyone have ideas for workarounds (none that I've thought of
> > have worked yet)?
> >
> > Tim
>
>|||You need to add System.Web.dll to your project references.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
news:73451CD4-AE35-4F53-BB01-C22A2F6A3DD1@.microsoft.com...
> I write the following code in Custom Code:
> Function GetExportFormat() as string
> GetExportFormat = System.Web.HttpContext.Current
> End Function
> Error is shown : HttpContext is not a member of Web.
> What's wrong with my code ?
> "Teo Lachev [MVP]" wrote:
> > This is not supported natively by the Report Server, but here is an
approach
> > you can try:
> >
> > Since the Report Server is a web application, you should be able to
write
> > custom code to obtain the report URL from HttpContext.Current. Then, you
can
> > determine which format the report is requested. If this works, you can
base
> > the Jump To action on a expression which calls your custom function and
> > return "" if the export format is Excel. Please note that
> > HttpContext.Current is not available when the report is previewed under
the
> > Report Designer so you have to check if it is null.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "timseal" <timseal@.discussions.microsoft.com> wrote in message
> > news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> > >
> > > "May Liu" wrote:
> > >
> > > > Can I disable/hide the hyperlink (jump to report) once the report is
> > exported
> > > > to Excel but ENABLE in browser ?
> > >
> > > I asked a similar question myself:
> > >
> >
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> > >
> > > No reply yet. This seems like a pretty annoying problem, has anyone
else
> > > faced it? Anyone have ideas for workarounds (none that I've thought
of
> > > have worked yet)?
> > >
> > > Tim
> >
> >
> >|||I have added the System.Web.dll in my project reference. Then I add textbox
which value is return value of custome code. The function is as follow:
Function GetHttpContext() as string
If Not System.Web.HttpContext.Current Is Nothing
'GetHttpContext = System.Web.HttpContext.Current.Request.Url.Host()
GetHttpContext = "Not Nothing"
else
GetHttpContext = "Nothing"
End If
End Function
But it returns #Error. I have deployed in Report Manager so that the report
is not run in design mode.
What's wrong with my code ?
"Teo Lachev [MVP]" wrote:
> You need to add System.Web.dll to your project references.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> news:73451CD4-AE35-4F53-BB01-C22A2F6A3DD1@.microsoft.com...
> > I write the following code in Custom Code:
> >
> > Function GetExportFormat() as string
> > GetExportFormat = System.Web.HttpContext.Current
> > End Function
> >
> > Error is shown : HttpContext is not a member of Web.
> > What's wrong with my code ?
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > This is not supported natively by the Report Server, but here is an
> approach
> > > you can try:
> > >
> > > Since the Report Server is a web application, you should be able to
> write
> > > custom code to obtain the report URL from HttpContext.Current. Then, you
> can
> > > determine which format the report is requested. If this works, you can
> base
> > > the Jump To action on a expression which calls your custom function and
> > > return "" if the export format is Excel. Please note that
> > > HttpContext.Current is not available when the report is previewed under
> the
> > > Report Designer so you have to check if it is null.
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ---
> > >
> > > "timseal" <timseal@.discussions.microsoft.com> wrote in message
> > > news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> > > >
> > > > "May Liu" wrote:
> > > >
> > > > > Can I disable/hide the hyperlink (jump to report) once the report is
> > > exported
> > > > > to Excel but ENABLE in browser ?
> > > >
> > > > I asked a similar question myself:
> > > >
> > >
> http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> > > >
> > > > No reply yet. This seems like a pretty annoying problem, has anyone
> else
> > > > faced it? Anyone have ideas for workarounds (none that I've thought
> of
> > > > have worked yet)?
> > > >
> > > > Tim
> > >
> > >
> > >
>
>|||May,
Perhaps you are not using the Code keyword to call your function or security
is not set properly. I did a quick test and the following worked for me:
1. Added the following static function to an external assembly:
public static string GetHttpContext() {
if (System.Web.HttpContext.Current != null)
return System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
else
return "N/A";
}
2. Registered the assembly in the report by browsing to the assembly in the
report References tab.
3. Added a textbox to my report with a value of
="URL: " & AWC.RS.Library.RsLibrary.GetHttpContext()
4. Assign full CAS rights to the assembly in rssrvpolicy.config as follows:
<CodeGroup class="UnionCodeGroup" version="1"
PermissionSetName="FullTrust" Name="AWCLibrary">
<IMembershipCondition class="UrlMembershipCondition" version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\AWC.RS.Library.dll"/>
</CodeGroup>
Some additional notes:
1. You need to use rs:ClearSession=True with each request to avoid session
caching from the browser. By default, IE sends the session identifier with
each request. When the Report Server decides to reuse the session, it
doesn't process the report. Instead, it uses the report cached intermediate
format and it just renders the report in the requested format. In this case,
AbsoluteUri will return the original report URL.
2. For some reason the URL is not displayed in the Excel format. However,
this shouldn't be a problem for you because you are not interested in
displaying the URL but just finding out the requested format.
3. To debug the function, change the assembly build output to C:\Program
Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin and
attach to aspnet_wp.exe (XP or Windows 2000) or w3wp.exe (Windows 2003).
Make sure that Common Language code is selected.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
news:FAF99299-D72A-41A2-B116-A9E6A666F933@.microsoft.com...
> I have added the System.Web.dll in my project reference. Then I add
textbox
> which value is return value of custome code. The function is as follow:
> Function GetHttpContext() as string
> If Not System.Web.HttpContext.Current Is Nothing
> 'GetHttpContext = System.Web.HttpContext.Current.Request.Url.Host()
> GetHttpContext = "Not Nothing"
> else
> GetHttpContext = "Nothing"
> End If
> End Function
> But it returns #Error. I have deployed in Report Manager so that the
report
> is not run in design mode.
> What's wrong with my code ?
> "Teo Lachev [MVP]" wrote:
> > You need to add System.Web.dll to your project references.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> > news:73451CD4-AE35-4F53-BB01-C22A2F6A3DD1@.microsoft.com...
> > > I write the following code in Custom Code:
> > >
> > > Function GetExportFormat() as string
> > > GetExportFormat = System.Web.HttpContext.Current
> > > End Function
> > >
> > > Error is shown : HttpContext is not a member of Web.
> > > What's wrong with my code ?
> > >
> > > "Teo Lachev [MVP]" wrote:
> > >
> > > > This is not supported natively by the Report Server, but here is an
> > approach
> > > > you can try:
> > > >
> > > > Since the Report Server is a web application, you should be able to
> > write
> > > > custom code to obtain the report URL from HttpContext.Current. Then,
you
> > can
> > > > determine which format the report is requested. If this works, you
can
> > base
> > > > the Jump To action on a expression which calls your custom function
and
> > > > return "" if the export format is Excel. Please note that
> > > > HttpContext.Current is not available when the report is previewed
under
> > the
> > > > Report Designer so you have to check if it is null.
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ---
> > > >
> > > > "timseal" <timseal@.discussions.microsoft.com> wrote in message
> > > > news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> > > > >
> > > > > "May Liu" wrote:
> > > > >
> > > > > > Can I disable/hide the hyperlink (jump to report) once the
report is
> > > > exported
> > > > > > to Excel but ENABLE in browser ?
> > > > >
> > > > > I asked a similar question myself:
> > > > >
> > > >
> >
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> > > > >
> > > > > No reply yet. This seems like a pretty annoying problem, has
anyone
> > else
> > > > > faced it? Anyone have ideas for workarounds (none that I've
thought
> > of
> > > > > have worked yet)?
> > > > >
> > > > > Tim
> > > >
> > > >
> > > >
> >
> >
> >|||Actually, the URL is showing in Excel. It was just wrapping around the row
and it was hidden. Duh!
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Teo Lachev [MVP]" <teo.lachev@.nospam.prologika.com> wrote in message
news:%23VCcwuh1EHA.1264@.TK2MSFTNGP12.phx.gbl...
> May,
> Perhaps you are not using the Code keyword to call your function or
security
> is not set properly. I did a quick test and the following worked for me:
> 1. Added the following static function to an external assembly:
> public static string GetHttpContext() {
> if (System.Web.HttpContext.Current != null)
> return System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
> else
> return "N/A";
> }
> 2. Registered the assembly in the report by browsing to the assembly in
the
> report References tab.
> 3. Added a textbox to my report with a value of
> ="URL: " & AWC.RS.Library.RsLibrary.GetHttpContext()
> 4. Assign full CAS rights to the assembly in rssrvpolicy.config as
follows:
> <CodeGroup class="UnionCodeGroup" version="1"
> PermissionSetName="FullTrust" Name="AWCLibrary">
> <IMembershipCondition class="UrlMembershipCondition" version="1"
> Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportServer\bin\AWC.RS.Library.dll"/>
> </CodeGroup>
>
> Some additional notes:
> 1. You need to use rs:ClearSession=True with each request to avoid session
> caching from the browser. By default, IE sends the session identifier with
> each request. When the Report Server decides to reuse the session, it
> doesn't process the report. Instead, it uses the report cached
intermediate
> format and it just renders the report in the requested format. In this
case,
> AbsoluteUri will return the original report URL.
> 2. For some reason the URL is not displayed in the Excel format. However,
> this shouldn't be a problem for you because you are not interested in
> displaying the URL but just finding out the requested format.
> 3. To debug the function, change the assembly build output to C:\Program
> Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin and
> attach to aspnet_wp.exe (XP or Windows 2000) or w3wp.exe (Windows 2003).
> Make sure that Common Language code is selected.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> news:FAF99299-D72A-41A2-B116-A9E6A666F933@.microsoft.com...
> > I have added the System.Web.dll in my project reference. Then I add
> textbox
> > which value is return value of custome code. The function is as follow:
> >
> > Function GetHttpContext() as string
> > If Not System.Web.HttpContext.Current Is Nothing
> > 'GetHttpContext = System.Web.HttpContext.Current.Request.Url.Host()
> > GetHttpContext = "Not Nothing"
> > else
> > GetHttpContext = "Nothing"
> > End If
> > End Function
> >
> > But it returns #Error. I have deployed in Report Manager so that the
> report
> > is not run in design mode.
> > What's wrong with my code ?
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > You need to add System.Web.dll to your project references.
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ---
> > >
> > > "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> > > news:73451CD4-AE35-4F53-BB01-C22A2F6A3DD1@.microsoft.com...
> > > > I write the following code in Custom Code:
> > > >
> > > > Function GetExportFormat() as string
> > > > GetExportFormat = System.Web.HttpContext.Current
> > > > End Function
> > > >
> > > > Error is shown : HttpContext is not a member of Web.
> > > > What's wrong with my code ?
> > > >
> > > > "Teo Lachev [MVP]" wrote:
> > > >
> > > > > This is not supported natively by the Report Server, but here is
an
> > > approach
> > > > > you can try:
> > > > >
> > > > > Since the Report Server is a web application, you should be able
to
> > > write
> > > > > custom code to obtain the report URL from HttpContext.Current.
Then,
> you
> > > can
> > > > > determine which format the report is requested. If this works, you
> can
> > > base
> > > > > the Jump To action on a expression which calls your custom
function
> and
> > > > > return "" if the export format is Excel. Please note that
> > > > > HttpContext.Current is not available when the report is previewed
> under
> > > the
> > > > > Report Designer so you have to check if it is null.
> > > > >
> > > > > --
> > > > > Hope this helps.
> > > > >
> > > > > ---
> > > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > > Author: "Microsoft Reporting Services in Action"
> > > > > Publisher website: http://www.manning.com/lachev
> > > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > > Home page and blog: http://www.prologika.com/
> > > > > ---
> > > > >
> > > > > "timseal" <timseal@.discussions.microsoft.com> wrote in message
> > > > > news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> > > > > >
> > > > > > "May Liu" wrote:
> > > > > >
> > > > > > > Can I disable/hide the hyperlink (jump to report) once the
> report is
> > > > > exported
> > > > > > > to Excel but ENABLE in browser ?
> > > > > >
> > > > > > I asked a similar question myself:
> > > > > >
> > > > >
> > >
>
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> > > > > >
> > > > > > No reply yet. This seems like a pretty annoying problem, has
> anyone
> > > else
> > > > > > faced it? Anyone have ideas for workarounds (none that I've
> thought
> > > of
> > > > > > have worked yet)?
> > > > > >
> > > > > > Tim
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
to Excel but ENABLE in browser ?"May Liu" wrote:
> Can I disable/hide the hyperlink (jump to report) once the report is exported
> to Excel but ENABLE in browser ?
I asked a similar question myself:
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
No reply yet. This seems like a pretty annoying problem, has anyone else
faced it? Anyone have ideas for workarounds (none that I've thought of
have worked yet)?
Tim|||This is not supported natively by the Report Server, but here is an approach
you can try:
Since the Report Server is a web application, you should be able to write
custom code to obtain the report URL from HttpContext.Current. Then, you can
determine which format the report is requested. If this works, you can base
the Jump To action on a expression which calls your custom function and
return "" if the export format is Excel. Please note that
HttpContext.Current is not available when the report is previewed under the
Report Designer so you have to check if it is null.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"timseal" <timseal@.discussions.microsoft.com> wrote in message
news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> "May Liu" wrote:
> > Can I disable/hide the hyperlink (jump to report) once the report is
exported
> > to Excel but ENABLE in browser ?
> I asked a similar question myself:
>
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> No reply yet. This seems like a pretty annoying problem, has anyone else
> faced it? Anyone have ideas for workarounds (none that I've thought of
> have worked yet)?
> Tim|||I write the following code in Custom Code:
Function GetExportFormat() as string
GetExportFormat = System.Web.HttpContext.Current
End Function
Error is shown : HttpContext is not a member of Web.
What's wrong with my code ?
"Teo Lachev [MVP]" wrote:
> This is not supported natively by the Report Server, but here is an approach
> you can try:
> Since the Report Server is a web application, you should be able to write
> custom code to obtain the report URL from HttpContext.Current. Then, you can
> determine which format the report is requested. If this works, you can base
> the Jump To action on a expression which calls your custom function and
> return "" if the export format is Excel. Please note that
> HttpContext.Current is not available when the report is previewed under the
> Report Designer so you have to check if it is null.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "timseal" <timseal@.discussions.microsoft.com> wrote in message
> news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> >
> > "May Liu" wrote:
> >
> > > Can I disable/hide the hyperlink (jump to report) once the report is
> exported
> > > to Excel but ENABLE in browser ?
> >
> > I asked a similar question myself:
> >
> http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> >
> > No reply yet. This seems like a pretty annoying problem, has anyone else
> > faced it? Anyone have ideas for workarounds (none that I've thought of
> > have worked yet)?
> >
> > Tim
>
>|||You need to add System.Web.dll to your project references.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
news:73451CD4-AE35-4F53-BB01-C22A2F6A3DD1@.microsoft.com...
> I write the following code in Custom Code:
> Function GetExportFormat() as string
> GetExportFormat = System.Web.HttpContext.Current
> End Function
> Error is shown : HttpContext is not a member of Web.
> What's wrong with my code ?
> "Teo Lachev [MVP]" wrote:
> > This is not supported natively by the Report Server, but here is an
approach
> > you can try:
> >
> > Since the Report Server is a web application, you should be able to
write
> > custom code to obtain the report URL from HttpContext.Current. Then, you
can
> > determine which format the report is requested. If this works, you can
base
> > the Jump To action on a expression which calls your custom function and
> > return "" if the export format is Excel. Please note that
> > HttpContext.Current is not available when the report is previewed under
the
> > Report Designer so you have to check if it is null.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "timseal" <timseal@.discussions.microsoft.com> wrote in message
> > news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> > >
> > > "May Liu" wrote:
> > >
> > > > Can I disable/hide the hyperlink (jump to report) once the report is
> > exported
> > > > to Excel but ENABLE in browser ?
> > >
> > > I asked a similar question myself:
> > >
> >
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> > >
> > > No reply yet. This seems like a pretty annoying problem, has anyone
else
> > > faced it? Anyone have ideas for workarounds (none that I've thought
of
> > > have worked yet)?
> > >
> > > Tim
> >
> >
> >|||I have added the System.Web.dll in my project reference. Then I add textbox
which value is return value of custome code. The function is as follow:
Function GetHttpContext() as string
If Not System.Web.HttpContext.Current Is Nothing
'GetHttpContext = System.Web.HttpContext.Current.Request.Url.Host()
GetHttpContext = "Not Nothing"
else
GetHttpContext = "Nothing"
End If
End Function
But it returns #Error. I have deployed in Report Manager so that the report
is not run in design mode.
What's wrong with my code ?
"Teo Lachev [MVP]" wrote:
> You need to add System.Web.dll to your project references.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> news:73451CD4-AE35-4F53-BB01-C22A2F6A3DD1@.microsoft.com...
> > I write the following code in Custom Code:
> >
> > Function GetExportFormat() as string
> > GetExportFormat = System.Web.HttpContext.Current
> > End Function
> >
> > Error is shown : HttpContext is not a member of Web.
> > What's wrong with my code ?
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > This is not supported natively by the Report Server, but here is an
> approach
> > > you can try:
> > >
> > > Since the Report Server is a web application, you should be able to
> write
> > > custom code to obtain the report URL from HttpContext.Current. Then, you
> can
> > > determine which format the report is requested. If this works, you can
> base
> > > the Jump To action on a expression which calls your custom function and
> > > return "" if the export format is Excel. Please note that
> > > HttpContext.Current is not available when the report is previewed under
> the
> > > Report Designer so you have to check if it is null.
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ---
> > >
> > > "timseal" <timseal@.discussions.microsoft.com> wrote in message
> > > news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> > > >
> > > > "May Liu" wrote:
> > > >
> > > > > Can I disable/hide the hyperlink (jump to report) once the report is
> > > exported
> > > > > to Excel but ENABLE in browser ?
> > > >
> > > > I asked a similar question myself:
> > > >
> > >
> http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> > > >
> > > > No reply yet. This seems like a pretty annoying problem, has anyone
> else
> > > > faced it? Anyone have ideas for workarounds (none that I've thought
> of
> > > > have worked yet)?
> > > >
> > > > Tim
> > >
> > >
> > >
>
>|||May,
Perhaps you are not using the Code keyword to call your function or security
is not set properly. I did a quick test and the following worked for me:
1. Added the following static function to an external assembly:
public static string GetHttpContext() {
if (System.Web.HttpContext.Current != null)
return System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
else
return "N/A";
}
2. Registered the assembly in the report by browsing to the assembly in the
report References tab.
3. Added a textbox to my report with a value of
="URL: " & AWC.RS.Library.RsLibrary.GetHttpContext()
4. Assign full CAS rights to the assembly in rssrvpolicy.config as follows:
<CodeGroup class="UnionCodeGroup" version="1"
PermissionSetName="FullTrust" Name="AWCLibrary">
<IMembershipCondition class="UrlMembershipCondition" version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\AWC.RS.Library.dll"/>
</CodeGroup>
Some additional notes:
1. You need to use rs:ClearSession=True with each request to avoid session
caching from the browser. By default, IE sends the session identifier with
each request. When the Report Server decides to reuse the session, it
doesn't process the report. Instead, it uses the report cached intermediate
format and it just renders the report in the requested format. In this case,
AbsoluteUri will return the original report URL.
2. For some reason the URL is not displayed in the Excel format. However,
this shouldn't be a problem for you because you are not interested in
displaying the URL but just finding out the requested format.
3. To debug the function, change the assembly build output to C:\Program
Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin and
attach to aspnet_wp.exe (XP or Windows 2000) or w3wp.exe (Windows 2003).
Make sure that Common Language code is selected.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
news:FAF99299-D72A-41A2-B116-A9E6A666F933@.microsoft.com...
> I have added the System.Web.dll in my project reference. Then I add
textbox
> which value is return value of custome code. The function is as follow:
> Function GetHttpContext() as string
> If Not System.Web.HttpContext.Current Is Nothing
> 'GetHttpContext = System.Web.HttpContext.Current.Request.Url.Host()
> GetHttpContext = "Not Nothing"
> else
> GetHttpContext = "Nothing"
> End If
> End Function
> But it returns #Error. I have deployed in Report Manager so that the
report
> is not run in design mode.
> What's wrong with my code ?
> "Teo Lachev [MVP]" wrote:
> > You need to add System.Web.dll to your project references.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> > news:73451CD4-AE35-4F53-BB01-C22A2F6A3DD1@.microsoft.com...
> > > I write the following code in Custom Code:
> > >
> > > Function GetExportFormat() as string
> > > GetExportFormat = System.Web.HttpContext.Current
> > > End Function
> > >
> > > Error is shown : HttpContext is not a member of Web.
> > > What's wrong with my code ?
> > >
> > > "Teo Lachev [MVP]" wrote:
> > >
> > > > This is not supported natively by the Report Server, but here is an
> > approach
> > > > you can try:
> > > >
> > > > Since the Report Server is a web application, you should be able to
> > write
> > > > custom code to obtain the report URL from HttpContext.Current. Then,
you
> > can
> > > > determine which format the report is requested. If this works, you
can
> > base
> > > > the Jump To action on a expression which calls your custom function
and
> > > > return "" if the export format is Excel. Please note that
> > > > HttpContext.Current is not available when the report is previewed
under
> > the
> > > > Report Designer so you have to check if it is null.
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ---
> > > >
> > > > "timseal" <timseal@.discussions.microsoft.com> wrote in message
> > > > news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> > > > >
> > > > > "May Liu" wrote:
> > > > >
> > > > > > Can I disable/hide the hyperlink (jump to report) once the
report is
> > > > exported
> > > > > > to Excel but ENABLE in browser ?
> > > > >
> > > > > I asked a similar question myself:
> > > > >
> > > >
> >
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> > > > >
> > > > > No reply yet. This seems like a pretty annoying problem, has
anyone
> > else
> > > > > faced it? Anyone have ideas for workarounds (none that I've
thought
> > of
> > > > > have worked yet)?
> > > > >
> > > > > Tim
> > > >
> > > >
> > > >
> >
> >
> >|||Actually, the URL is showing in Excel. It was just wrapping around the row
and it was hidden. Duh!
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Teo Lachev [MVP]" <teo.lachev@.nospam.prologika.com> wrote in message
news:%23VCcwuh1EHA.1264@.TK2MSFTNGP12.phx.gbl...
> May,
> Perhaps you are not using the Code keyword to call your function or
security
> is not set properly. I did a quick test and the following worked for me:
> 1. Added the following static function to an external assembly:
> public static string GetHttpContext() {
> if (System.Web.HttpContext.Current != null)
> return System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
> else
> return "N/A";
> }
> 2. Registered the assembly in the report by browsing to the assembly in
the
> report References tab.
> 3. Added a textbox to my report with a value of
> ="URL: " & AWC.RS.Library.RsLibrary.GetHttpContext()
> 4. Assign full CAS rights to the assembly in rssrvpolicy.config as
follows:
> <CodeGroup class="UnionCodeGroup" version="1"
> PermissionSetName="FullTrust" Name="AWCLibrary">
> <IMembershipCondition class="UrlMembershipCondition" version="1"
> Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportServer\bin\AWC.RS.Library.dll"/>
> </CodeGroup>
>
> Some additional notes:
> 1. You need to use rs:ClearSession=True with each request to avoid session
> caching from the browser. By default, IE sends the session identifier with
> each request. When the Report Server decides to reuse the session, it
> doesn't process the report. Instead, it uses the report cached
intermediate
> format and it just renders the report in the requested format. In this
case,
> AbsoluteUri will return the original report URL.
> 2. For some reason the URL is not displayed in the Excel format. However,
> this shouldn't be a problem for you because you are not interested in
> displaying the URL but just finding out the requested format.
> 3. To debug the function, change the assembly build output to C:\Program
> Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin and
> attach to aspnet_wp.exe (XP or Windows 2000) or w3wp.exe (Windows 2003).
> Make sure that Common Language code is selected.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> news:FAF99299-D72A-41A2-B116-A9E6A666F933@.microsoft.com...
> > I have added the System.Web.dll in my project reference. Then I add
> textbox
> > which value is return value of custome code. The function is as follow:
> >
> > Function GetHttpContext() as string
> > If Not System.Web.HttpContext.Current Is Nothing
> > 'GetHttpContext = System.Web.HttpContext.Current.Request.Url.Host()
> > GetHttpContext = "Not Nothing"
> > else
> > GetHttpContext = "Nothing"
> > End If
> > End Function
> >
> > But it returns #Error. I have deployed in Report Manager so that the
> report
> > is not run in design mode.
> > What's wrong with my code ?
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > You need to add System.Web.dll to your project references.
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ---
> > >
> > > "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> > > news:73451CD4-AE35-4F53-BB01-C22A2F6A3DD1@.microsoft.com...
> > > > I write the following code in Custom Code:
> > > >
> > > > Function GetExportFormat() as string
> > > > GetExportFormat = System.Web.HttpContext.Current
> > > > End Function
> > > >
> > > > Error is shown : HttpContext is not a member of Web.
> > > > What's wrong with my code ?
> > > >
> > > > "Teo Lachev [MVP]" wrote:
> > > >
> > > > > This is not supported natively by the Report Server, but here is
an
> > > approach
> > > > > you can try:
> > > > >
> > > > > Since the Report Server is a web application, you should be able
to
> > > write
> > > > > custom code to obtain the report URL from HttpContext.Current.
Then,
> you
> > > can
> > > > > determine which format the report is requested. If this works, you
> can
> > > base
> > > > > the Jump To action on a expression which calls your custom
function
> and
> > > > > return "" if the export format is Excel. Please note that
> > > > > HttpContext.Current is not available when the report is previewed
> under
> > > the
> > > > > Report Designer so you have to check if it is null.
> > > > >
> > > > > --
> > > > > Hope this helps.
> > > > >
> > > > > ---
> > > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > > Author: "Microsoft Reporting Services in Action"
> > > > > Publisher website: http://www.manning.com/lachev
> > > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > > Home page and blog: http://www.prologika.com/
> > > > > ---
> > > > >
> > > > > "timseal" <timseal@.discussions.microsoft.com> wrote in message
> > > > > news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> > > > > >
> > > > > > "May Liu" wrote:
> > > > > >
> > > > > > > Can I disable/hide the hyperlink (jump to report) once the
> report is
> > > > > exported
> > > > > > > to Excel but ENABLE in browser ?
> > > > > >
> > > > > > I asked a similar question myself:
> > > > > >
> > > > >
> > >
>
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> > > > > >
> > > > > > No reply yet. This seems like a pretty annoying problem, has
> anyone
> > > else
> > > > > > faced it? Anyone have ideas for workarounds (none that I've
> thought
> > > of
> > > > > > have worked yet)?
> > > > > >
> > > > > > Tim
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
2012年2月14日星期二
disable and enable triggers
hi,
I have 500-1000 records daily need to be updated in a heavy production
table. I have to disable the all triggers update records, enable all
triggers again.
My question is ...
1. Is it practicale in prod table?
2. Is table doing reindexing everytime I enable the triggers in that table.
3.What is the best way to update the records it if above is bad.
Thanks
mecn wrote:
> hi,
> I have 500-1000 records daily need to be updated in a heavy production
> table. I have to disable the all triggers update records, enable all
> triggers again.
> My question is ...
> 1. Is it practicale in prod table?
> 2. Is table doing reindexing everytime I enable the triggers in that table.
> 3.What is the best way to update the records it if above is bad.
> Thanks
>
>
Why do you need to disable the triggers to do this update?
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||Yes,
I don't want to fire the triggers when I updating records
on that table
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:45AE8D0F.5040007@.realsqlguy.com...
> mecn wrote:
> Why do you need to disable the triggers to do this update?
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
|||http://msdn2.microsoft.com/en-us/library/ms189748.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OK8CXunOHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Yes,
> I don't want to fire the triggers when I updating records
> on that table
>
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:45AE8D0F.5040007@.realsqlguy.com...
>
|||mecn,
Then why are the triggers there in the first place? If there is a business
rule as to which kinds of rows should fire the trigger then you might be
able to incorporate that into the trigger itself.
-- Bill
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OK8CXunOHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Yes,
> I don't want to fire the triggers when I updating records
> on that table
>
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:45AE8D0F.5040007@.realsqlguy.com...
>
I have 500-1000 records daily need to be updated in a heavy production
table. I have to disable the all triggers update records, enable all
triggers again.
My question is ...
1. Is it practicale in prod table?
2. Is table doing reindexing everytime I enable the triggers in that table.
3.What is the best way to update the records it if above is bad.
Thanks
mecn wrote:
> hi,
> I have 500-1000 records daily need to be updated in a heavy production
> table. I have to disable the all triggers update records, enable all
> triggers again.
> My question is ...
> 1. Is it practicale in prod table?
> 2. Is table doing reindexing everytime I enable the triggers in that table.
> 3.What is the best way to update the records it if above is bad.
> Thanks
>
>
Why do you need to disable the triggers to do this update?
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||Yes,
I don't want to fire the triggers when I updating records
on that table
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:45AE8D0F.5040007@.realsqlguy.com...
> mecn wrote:
> Why do you need to disable the triggers to do this update?
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
|||http://msdn2.microsoft.com/en-us/library/ms189748.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OK8CXunOHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Yes,
> I don't want to fire the triggers when I updating records
> on that table
>
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:45AE8D0F.5040007@.realsqlguy.com...
>
|||mecn,
Then why are the triggers there in the first place? If there is a business
rule as to which kinds of rows should fire the trigger then you might be
able to incorporate that into the trigger itself.
-- Bill
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OK8CXunOHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Yes,
> I don't want to fire the triggers when I updating records
> on that table
>
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:45AE8D0F.5040007@.realsqlguy.com...
>
disable and enable triggers
hi,
I have 500-1000 records daily need to be updated in a heavy production
table. I have to disable the all triggers update records, enable all
triggers again.
My question is ...
1. Is it practicale in prod table?
2. Is table doing reindexing everytime I enable the triggers in that table.
3.What is the best way to update the records it if above is bad.
Thanksmecn wrote:
> hi,
> I have 500-1000 records daily need to be updated in a heavy production
> table. I have to disable the all triggers update records, enable all
> triggers again.
> My question is ...
> 1. Is it practicale in prod table?
> 2. Is table doing reindexing everytime I enable the triggers in that table
.
> 3.What is the best way to update the records it if above is bad.
> Thanks
>
>
Why do you need to disable the triggers to do this update?
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Yes,
I don't want to fire the triggers when I updating records
on that table
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:45AE8D0F.5040007@.realsqlguy.com...
> mecn wrote:
> Why do you need to disable the triggers to do this update?
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||http://msdn2.microsoft.com/en-us/library/ms189748.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OK8CXunOHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Yes,
> I don't want to fire the triggers when I updating records
> on that table
>
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:45AE8D0F.5040007@.realsqlguy.com...
>|||mecn,
Then why are the triggers there in the first place? If there is a business
rule as to which kinds of rows should fire the trigger then you might be
able to incorporate that into the trigger itself.
-- Bill
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OK8CXunOHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Yes,
> I don't want to fire the triggers when I updating records
> on that table
>
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:45AE8D0F.5040007@.realsqlguy.com...
>
I have 500-1000 records daily need to be updated in a heavy production
table. I have to disable the all triggers update records, enable all
triggers again.
My question is ...
1. Is it practicale in prod table?
2. Is table doing reindexing everytime I enable the triggers in that table.
3.What is the best way to update the records it if above is bad.
Thanksmecn wrote:
> hi,
> I have 500-1000 records daily need to be updated in a heavy production
> table. I have to disable the all triggers update records, enable all
> triggers again.
> My question is ...
> 1. Is it practicale in prod table?
> 2. Is table doing reindexing everytime I enable the triggers in that table
.
> 3.What is the best way to update the records it if above is bad.
> Thanks
>
>
Why do you need to disable the triggers to do this update?
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Yes,
I don't want to fire the triggers when I updating records
on that table
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:45AE8D0F.5040007@.realsqlguy.com...
> mecn wrote:
> Why do you need to disable the triggers to do this update?
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||http://msdn2.microsoft.com/en-us/library/ms189748.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OK8CXunOHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Yes,
> I don't want to fire the triggers when I updating records
> on that table
>
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:45AE8D0F.5040007@.realsqlguy.com...
>|||mecn,
Then why are the triggers there in the first place? If there is a business
rule as to which kinds of rows should fire the trigger then you might be
able to incorporate that into the trigger itself.
-- Bill
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OK8CXunOHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Yes,
> I don't want to fire the triggers when I updating records
> on that table
>
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:45AE8D0F.5040007@.realsqlguy.com...
>
disable and enable triggers
hi,
I have 500-1000 records daily need to be updated in a heavy production
table. I have to disable the all triggers update records, enable all
triggers again.
My question is ...
1. Is it practicale in prod table?
2. Is table doing reindexing everytime I enable the triggers in that table.
3.What is the best way to update the records it if above is bad.
Thanksmecn wrote:
> hi,
> I have 500-1000 records daily need to be updated in a heavy production
> table. I have to disable the all triggers update records, enable all
> triggers again.
> My question is ...
> 1. Is it practicale in prod table?
> 2. Is table doing reindexing everytime I enable the triggers in that table.
> 3.What is the best way to update the records it if above is bad.
> Thanks
>
>
Why do you need to disable the triggers to do this update?
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Yes,
I don't want to fire the triggers when I updating records
on that table
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:45AE8D0F.5040007@.realsqlguy.com...
> mecn wrote:
>> hi,
>> I have 500-1000 records daily need to be updated in a heavy production
>> table. I have to disable the all triggers update records, enable all
>> triggers again.
>> My question is ...
>> 1. Is it practicale in prod table?
>> 2. Is table doing reindexing everytime I enable the triggers in that
>> table.
>> 3.What is the best way to update the records it if above is bad.
>> Thanks
>>
> Why do you need to disable the triggers to do this update?
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||http://msdn2.microsoft.com/en-us/library/ms189748.aspx
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OK8CXunOHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Yes,
> I don't want to fire the triggers when I updating records
> on that table
>
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:45AE8D0F.5040007@.realsqlguy.com...
>> mecn wrote:
>> hi,
>> I have 500-1000 records daily need to be updated in a heavy production
>> table. I have to disable the all triggers update records, enable all
>> triggers again.
>> My question is ...
>> 1. Is it practicale in prod table?
>> 2. Is table doing reindexing everytime I enable the triggers in that
>> table.
>> 3.What is the best way to update the records it if above is bad.
>> Thanks
>>
>>
>> Why do you need to disable the triggers to do this update?
>>
>> --
>> Tracy McKibben
>> MCDBA
>> http://www.realsqlguy.com
>|||mecn,
Then why are the triggers there in the first place? If there is a business
rule as to which kinds of rows should fire the trigger then you might be
able to incorporate that into the trigger itself.
-- Bill
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OK8CXunOHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Yes,
> I don't want to fire the triggers when I updating records
> on that table
>
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:45AE8D0F.5040007@.realsqlguy.com...
>> mecn wrote:
>> hi,
>> I have 500-1000 records daily need to be updated in a heavy production
>> table. I have to disable the all triggers update records, enable all
>> triggers again.
>> My question is ...
>> 1. Is it practicale in prod table?
>> 2. Is table doing reindexing everytime I enable the triggers in that
>> table.
>> 3.What is the best way to update the records it if above is bad.
>> Thanks
>>
>>
>> Why do you need to disable the triggers to do this update?
>>
>> --
>> Tracy McKibben
>> MCDBA
>> http://www.realsqlguy.com
>
I have 500-1000 records daily need to be updated in a heavy production
table. I have to disable the all triggers update records, enable all
triggers again.
My question is ...
1. Is it practicale in prod table?
2. Is table doing reindexing everytime I enable the triggers in that table.
3.What is the best way to update the records it if above is bad.
Thanksmecn wrote:
> hi,
> I have 500-1000 records daily need to be updated in a heavy production
> table. I have to disable the all triggers update records, enable all
> triggers again.
> My question is ...
> 1. Is it practicale in prod table?
> 2. Is table doing reindexing everytime I enable the triggers in that table.
> 3.What is the best way to update the records it if above is bad.
> Thanks
>
>
Why do you need to disable the triggers to do this update?
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Yes,
I don't want to fire the triggers when I updating records
on that table
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:45AE8D0F.5040007@.realsqlguy.com...
> mecn wrote:
>> hi,
>> I have 500-1000 records daily need to be updated in a heavy production
>> table. I have to disable the all triggers update records, enable all
>> triggers again.
>> My question is ...
>> 1. Is it practicale in prod table?
>> 2. Is table doing reindexing everytime I enable the triggers in that
>> table.
>> 3.What is the best way to update the records it if above is bad.
>> Thanks
>>
> Why do you need to disable the triggers to do this update?
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||http://msdn2.microsoft.com/en-us/library/ms189748.aspx
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OK8CXunOHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Yes,
> I don't want to fire the triggers when I updating records
> on that table
>
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:45AE8D0F.5040007@.realsqlguy.com...
>> mecn wrote:
>> hi,
>> I have 500-1000 records daily need to be updated in a heavy production
>> table. I have to disable the all triggers update records, enable all
>> triggers again.
>> My question is ...
>> 1. Is it practicale in prod table?
>> 2. Is table doing reindexing everytime I enable the triggers in that
>> table.
>> 3.What is the best way to update the records it if above is bad.
>> Thanks
>>
>>
>> Why do you need to disable the triggers to do this update?
>>
>> --
>> Tracy McKibben
>> MCDBA
>> http://www.realsqlguy.com
>|||mecn,
Then why are the triggers there in the first place? If there is a business
rule as to which kinds of rows should fire the trigger then you might be
able to incorporate that into the trigger itself.
-- Bill
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OK8CXunOHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Yes,
> I don't want to fire the triggers when I updating records
> on that table
>
> "Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
> news:45AE8D0F.5040007@.realsqlguy.com...
>> mecn wrote:
>> hi,
>> I have 500-1000 records daily need to be updated in a heavy production
>> table. I have to disable the all triggers update records, enable all
>> triggers again.
>> My question is ...
>> 1. Is it practicale in prod table?
>> 2. Is table doing reindexing everytime I enable the triggers in that
>> table.
>> 3.What is the best way to update the records it if above is bad.
>> Thanks
>>
>>
>> Why do you need to disable the triggers to do this update?
>>
>> --
>> Tracy McKibben
>> MCDBA
>> http://www.realsqlguy.com
>
disable and enable trigger on schedule
How do you disable and enable the trigger on a table automatically at some
time daily?Hi,
Identify the triggers which needs to be disabled. Then use the below Alter
command to disable
1. Create a SQL Agent job to disable the trigger and schedule a time
ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
2. Create another SQL Agent job to enable the trigger and schedule a time
ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
Make sure data integrity is not lost when you disable the trigger.
Thanks
Hari
SQL Server MVP
"00KobeBrian" <a@.b.com> wrote in message
news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
> How do you disable and enable the trigger on a table automatically at some
> time daily?
>|||Hi,
Thanks Hari for greate information. I just like to provide following link
for detailed information:
http://msdn2.microsoft.com/en-us/library/ms182706.aspx
http://msdn2.microsoft.com/en-us/library/ms189748.aspx
Hope this helps.
Have a good day!
Best regards,
Vincent Xu
Microsoft Online Partner Support
======================================================Get Secure! - www.microsoft.com/security
======================================================When responding to posts, please "Reply to Group" via your newsreader so
that others
may learn and benefit from this issue.
======================================================This posting is provided "AS IS" with no warranties,and confers no rights.
======================================================>>From: "Hari Prasad" <hari_prasad_k@.hotmail.com>
>>References: <e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl>
>>Subject: Re: disable and enable trigger on schedule
>>Date: Tue, 5 Sep 2006 20:56:58 -0500
>>Lines: 26
>>X-Priority: 3
>>X-MSMail-Priority: Normal
>>X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
>>X-RFC2646: Format=Flowed; Response
>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
>>Message-ID: <#WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl>
>>Newsgroups: microsoft.public.sqlserver.server
>>NNTP-Posting-Host: cpe-65-27-44-57.kc.res.rr.com 65.27.44.57
>>Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP04.phx.gbl
>>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.server:444272
>>X-Tomcat-NG: microsoft.public.sqlserver.server
>>Hi,
>>Identify the triggers which needs to be disabled. Then use the below
Alter
>>command to disable
>>1. Create a SQL Agent job to disable the trigger and schedule a time
>>ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
>>2. Create another SQL Agent job to enable the trigger and schedule a time
>>ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
>>Make sure data integrity is not lost when you disable the trigger.
>>Thanks
>>Hari
>>SQL Server MVP
>>"00KobeBrian" <a@.b.com> wrote in message
>>news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>> How do you disable and enable the trigger on a table automatically at
some
>> time daily?
>>
>>|||How can I know if the trigger is enabled or disabled? Thanks.
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
> Hi,
> Identify the triggers which needs to be disabled. Then use the below Alter
> command to disable
> 1. Create a SQL Agent job to disable the trigger and schedule a time
> ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
> 2. Create another SQL Agent job to enable the trigger and schedule a time
> ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
> Make sure data integrity is not lost when you disable the trigger.
> Thanks
> Hari
> SQL Server MVP
> "00KobeBrian" <a@.b.com> wrote in message
> news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>> How do you disable and enable the trigger on a table automatically at
>> some time daily?
>|||Hi 00KobeBrian
Use the function OBJECTPROPERTY
SELECT OBJECTPROPERTY(object_id('name of trigger')',
'ExecIsTriggerDisabled')
--
HTH
Kalen Delaney, SQL Server MVP
"00KobeBrian" <a@.b.com> wrote in message
news:OOsLHBX0GHA.1256@.TK2MSFTNGP02.phx.gbl...
> How can I know if the trigger is enabled or disabled? Thanks.
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> Identify the triggers which needs to be disabled. Then use the below
>> Alter command to disable
>> 1. Create a SQL Agent job to disable the trigger and schedule a time
>> ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
>> 2. Create another SQL Agent job to enable the trigger and schedule a time
>> ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
>> Make sure data integrity is not lost when you disable the trigger.
>> Thanks
>> Hari
>> SQL Server MVP
>> "00KobeBrian" <a@.b.com> wrote in message
>> news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>> How do you disable and enable the trigger on a table automatically at
>> some time daily?
>>
>|||Hi,
If you are using SQL 2005, you can refer to following article:
<http://msdn2.microsoft.com/en-us/library/ms188746.aspx>
Thanks.
Best regards,
Vincent Xu
Microsoft Online Partner Support
======================================================Get Secure! - www.microsoft.com/security
======================================================When responding to posts, please "Reply to Group" via your newsreader so
that others
may learn and benefit from this issue.
======================================================This posting is provided "AS IS" with no warranties,and confers no rights.
======================================================>>From: "00KobeBrian" <a@.b.com>
>>References: <e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl>
<#WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl>
>>Subject: Re: disable and enable trigger on schedule
>>Date: Wed, 6 Sep 2006 12:52:34 +0800
>>Lines: 33
>>X-Priority: 3
>>X-MSMail-Priority: Normal
>>X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
>>X-RFC2646: Format=Flowed; Response
>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
>>Message-ID: <OOsLHBX0GHA.1256@.TK2MSFTNGP02.phx.gbl>
>>Newsgroups: microsoft.public.sqlserver.server
>>NNTP-Posting-Host: 202.40.134.130
>>Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gbl
>>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.server:444283
>>X-Tomcat-NG: microsoft.public.sqlserver.server
>>How can I know if the trigger is enabled or disabled? Thanks.
>>
>>"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
>>news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> Identify the triggers which needs to be disabled. Then use the below
Alter
>> command to disable
>> 1. Create a SQL Agent job to disable the trigger and schedule a time
>> ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
>> 2. Create another SQL Agent job to enable the trigger and schedule a
time
>> ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
>> Make sure data integrity is not lost when you disable the trigger.
>> Thanks
>> Hari
>> SQL Server MVP
>> "00KobeBrian" <a@.b.com> wrote in message
>> news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>> How do you disable and enable the trigger on a table automatically at
>> some time daily?
>>
>>
>>|||Can you please give me an example? I am using SQL 2000. Thanks.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:eKMpdLX0GHA.5100@.TK2MSFTNGP05.phx.gbl...
> Hi 00KobeBrian
> Use the function OBJECTPROPERTY
> SELECT OBJECTPROPERTY(object_id('name of trigger')',
> 'ExecIsTriggerDisabled')
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "00KobeBrian" <a@.b.com> wrote in message
> news:OOsLHBX0GHA.1256@.TK2MSFTNGP02.phx.gbl...
>> How can I know if the trigger is enabled or disabled? Thanks.
>>
>> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
>> news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> Identify the triggers which needs to be disabled. Then use the below
>> Alter command to disable
>> 1. Create a SQL Agent job to disable the trigger and schedule a time
>> ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
>> 2. Create another SQL Agent job to enable the trigger and schedule a
>> time
>> ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
>> Make sure data integrity is not lost when you disable the trigger.
>> Thanks
>> Hari
>> SQL Server MVP
>> "00KobeBrian" <a@.b.com> wrote in message
>> news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>> How do you disable and enable the trigger on a table automatically at
>> some time daily?
>>
>>
>|||I gave you an example of checking for whether a trigger is disabled. If the
SELECT OBJECTPROPERTY returns 1, the trigger is disabled, if it returns 0,
the trigger is enabled, if it returns NULL, you typed something incorrectly.
If you need more details than that, you'll have to be more specific about
what you don't understand.
--
HTH
Kalen Delaney, SQL Server MVP
"00KobeBrian" <a@.b.com> wrote in message
news:O5vt5%23X0GHA.2072@.TK2MSFTNGP06.phx.gbl...
> Can you please give me an example? I am using SQL 2000. Thanks.
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:eKMpdLX0GHA.5100@.TK2MSFTNGP05.phx.gbl...
>> Hi 00KobeBrian
>> Use the function OBJECTPROPERTY
>> SELECT OBJECTPROPERTY(object_id('name of trigger')',
>> 'ExecIsTriggerDisabled')
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "00KobeBrian" <a@.b.com> wrote in message
>> news:OOsLHBX0GHA.1256@.TK2MSFTNGP02.phx.gbl...
>> How can I know if the trigger is enabled or disabled? Thanks.
>>
>> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
>> news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> Identify the triggers which needs to be disabled. Then use the below
>> Alter command to disable
>> 1. Create a SQL Agent job to disable the trigger and schedule a time
>> ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
>> 2. Create another SQL Agent job to enable the trigger and schedule a
>> time
>> ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
>> Make sure data integrity is not lost when you disable the trigger.
>> Thanks
>> Hari
>> SQL Server MVP
>> "00KobeBrian" <a@.b.com> wrote in message
>> news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>> How do you disable and enable the trigger on a table automatically at
>> some time daily?
>>
>>
>>
>
time daily?Hi,
Identify the triggers which needs to be disabled. Then use the below Alter
command to disable
1. Create a SQL Agent job to disable the trigger and schedule a time
ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
2. Create another SQL Agent job to enable the trigger and schedule a time
ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
Make sure data integrity is not lost when you disable the trigger.
Thanks
Hari
SQL Server MVP
"00KobeBrian" <a@.b.com> wrote in message
news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
> How do you disable and enable the trigger on a table automatically at some
> time daily?
>|||Hi,
Thanks Hari for greate information. I just like to provide following link
for detailed information:
http://msdn2.microsoft.com/en-us/library/ms182706.aspx
http://msdn2.microsoft.com/en-us/library/ms189748.aspx
Hope this helps.
Have a good day!
Best regards,
Vincent Xu
Microsoft Online Partner Support
======================================================Get Secure! - www.microsoft.com/security
======================================================When responding to posts, please "Reply to Group" via your newsreader so
that others
may learn and benefit from this issue.
======================================================This posting is provided "AS IS" with no warranties,and confers no rights.
======================================================>>From: "Hari Prasad" <hari_prasad_k@.hotmail.com>
>>References: <e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl>
>>Subject: Re: disable and enable trigger on schedule
>>Date: Tue, 5 Sep 2006 20:56:58 -0500
>>Lines: 26
>>X-Priority: 3
>>X-MSMail-Priority: Normal
>>X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
>>X-RFC2646: Format=Flowed; Response
>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
>>Message-ID: <#WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl>
>>Newsgroups: microsoft.public.sqlserver.server
>>NNTP-Posting-Host: cpe-65-27-44-57.kc.res.rr.com 65.27.44.57
>>Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP04.phx.gbl
>>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.server:444272
>>X-Tomcat-NG: microsoft.public.sqlserver.server
>>Hi,
>>Identify the triggers which needs to be disabled. Then use the below
Alter
>>command to disable
>>1. Create a SQL Agent job to disable the trigger and schedule a time
>>ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
>>2. Create another SQL Agent job to enable the trigger and schedule a time
>>ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
>>Make sure data integrity is not lost when you disable the trigger.
>>Thanks
>>Hari
>>SQL Server MVP
>>"00KobeBrian" <a@.b.com> wrote in message
>>news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>> How do you disable and enable the trigger on a table automatically at
some
>> time daily?
>>
>>|||How can I know if the trigger is enabled or disabled? Thanks.
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
> Hi,
> Identify the triggers which needs to be disabled. Then use the below Alter
> command to disable
> 1. Create a SQL Agent job to disable the trigger and schedule a time
> ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
> 2. Create another SQL Agent job to enable the trigger and schedule a time
> ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
> Make sure data integrity is not lost when you disable the trigger.
> Thanks
> Hari
> SQL Server MVP
> "00KobeBrian" <a@.b.com> wrote in message
> news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>> How do you disable and enable the trigger on a table automatically at
>> some time daily?
>|||Hi 00KobeBrian
Use the function OBJECTPROPERTY
SELECT OBJECTPROPERTY(object_id('name of trigger')',
'ExecIsTriggerDisabled')
--
HTH
Kalen Delaney, SQL Server MVP
"00KobeBrian" <a@.b.com> wrote in message
news:OOsLHBX0GHA.1256@.TK2MSFTNGP02.phx.gbl...
> How can I know if the trigger is enabled or disabled? Thanks.
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> Identify the triggers which needs to be disabled. Then use the below
>> Alter command to disable
>> 1. Create a SQL Agent job to disable the trigger and schedule a time
>> ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
>> 2. Create another SQL Agent job to enable the trigger and schedule a time
>> ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
>> Make sure data integrity is not lost when you disable the trigger.
>> Thanks
>> Hari
>> SQL Server MVP
>> "00KobeBrian" <a@.b.com> wrote in message
>> news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>> How do you disable and enable the trigger on a table automatically at
>> some time daily?
>>
>|||Hi,
If you are using SQL 2005, you can refer to following article:
<http://msdn2.microsoft.com/en-us/library/ms188746.aspx>
Thanks.
Best regards,
Vincent Xu
Microsoft Online Partner Support
======================================================Get Secure! - www.microsoft.com/security
======================================================When responding to posts, please "Reply to Group" via your newsreader so
that others
may learn and benefit from this issue.
======================================================This posting is provided "AS IS" with no warranties,and confers no rights.
======================================================>>From: "00KobeBrian" <a@.b.com>
>>References: <e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl>
<#WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl>
>>Subject: Re: disable and enable trigger on schedule
>>Date: Wed, 6 Sep 2006 12:52:34 +0800
>>Lines: 33
>>X-Priority: 3
>>X-MSMail-Priority: Normal
>>X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
>>X-RFC2646: Format=Flowed; Response
>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
>>Message-ID: <OOsLHBX0GHA.1256@.TK2MSFTNGP02.phx.gbl>
>>Newsgroups: microsoft.public.sqlserver.server
>>NNTP-Posting-Host: 202.40.134.130
>>Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gbl
>>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.server:444283
>>X-Tomcat-NG: microsoft.public.sqlserver.server
>>How can I know if the trigger is enabled or disabled? Thanks.
>>
>>"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
>>news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> Identify the triggers which needs to be disabled. Then use the below
Alter
>> command to disable
>> 1. Create a SQL Agent job to disable the trigger and schedule a time
>> ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
>> 2. Create another SQL Agent job to enable the trigger and schedule a
time
>> ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
>> Make sure data integrity is not lost when you disable the trigger.
>> Thanks
>> Hari
>> SQL Server MVP
>> "00KobeBrian" <a@.b.com> wrote in message
>> news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>> How do you disable and enable the trigger on a table automatically at
>> some time daily?
>>
>>
>>|||Can you please give me an example? I am using SQL 2000. Thanks.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:eKMpdLX0GHA.5100@.TK2MSFTNGP05.phx.gbl...
> Hi 00KobeBrian
> Use the function OBJECTPROPERTY
> SELECT OBJECTPROPERTY(object_id('name of trigger')',
> 'ExecIsTriggerDisabled')
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "00KobeBrian" <a@.b.com> wrote in message
> news:OOsLHBX0GHA.1256@.TK2MSFTNGP02.phx.gbl...
>> How can I know if the trigger is enabled or disabled? Thanks.
>>
>> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
>> news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> Identify the triggers which needs to be disabled. Then use the below
>> Alter command to disable
>> 1. Create a SQL Agent job to disable the trigger and schedule a time
>> ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
>> 2. Create another SQL Agent job to enable the trigger and schedule a
>> time
>> ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
>> Make sure data integrity is not lost when you disable the trigger.
>> Thanks
>> Hari
>> SQL Server MVP
>> "00KobeBrian" <a@.b.com> wrote in message
>> news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>> How do you disable and enable the trigger on a table automatically at
>> some time daily?
>>
>>
>|||I gave you an example of checking for whether a trigger is disabled. If the
SELECT OBJECTPROPERTY returns 1, the trigger is disabled, if it returns 0,
the trigger is enabled, if it returns NULL, you typed something incorrectly.
If you need more details than that, you'll have to be more specific about
what you don't understand.
--
HTH
Kalen Delaney, SQL Server MVP
"00KobeBrian" <a@.b.com> wrote in message
news:O5vt5%23X0GHA.2072@.TK2MSFTNGP06.phx.gbl...
> Can you please give me an example? I am using SQL 2000. Thanks.
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:eKMpdLX0GHA.5100@.TK2MSFTNGP05.phx.gbl...
>> Hi 00KobeBrian
>> Use the function OBJECTPROPERTY
>> SELECT OBJECTPROPERTY(object_id('name of trigger')',
>> 'ExecIsTriggerDisabled')
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "00KobeBrian" <a@.b.com> wrote in message
>> news:OOsLHBX0GHA.1256@.TK2MSFTNGP02.phx.gbl...
>> How can I know if the trigger is enabled or disabled? Thanks.
>>
>> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
>> news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> Identify the triggers which needs to be disabled. Then use the below
>> Alter command to disable
>> 1. Create a SQL Agent job to disable the trigger and schedule a time
>> ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
>> 2. Create another SQL Agent job to enable the trigger and schedule a
>> time
>> ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
>> Make sure data integrity is not lost when you disable the trigger.
>> Thanks
>> Hari
>> SQL Server MVP
>> "00KobeBrian" <a@.b.com> wrote in message
>> news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>> How do you disable and enable the trigger on a table automatically at
>> some time daily?
>>
>>
>>
>
disable and enable trigger on schedule
How do you disable and enable the trigger on a table automatically at some
time daily?Hi,
Identify the triggers which needs to be disabled. Then use the below Alter
command to disable
1. Create a SQL Agent job to disable the trigger and schedule a time
ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
2. Create another SQL Agent job to enable the trigger and schedule a time
ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
Make sure data integrity is not lost when you disable the trigger.
Thanks
Hari
SQL Server MVP
"00KobeBrian" <a@.b.com> wrote in message
news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
> How do you disable and enable the trigger on a table automatically at some
> time daily?
>|||Hi,
Thanks Hari for greate information. I just like to provide following link
for detailed information:
http://msdn2.microsoft.com/en-us/library/ms182706.aspx
http://msdn2.microsoft.com/en-us/library/ms189748.aspx
Hope this helps.
Have a good day!
Best regards,
Vincent Xu
Microsoft Online Partner Support
========================================
==============
Get Secure! - www.microsoft.com/security
========================================
==============
When responding to posts, please "Reply to Group" via your newsreader so
that others
may learn and benefit from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties,and confers no rights.
========================================
==============
--[vbcol=seagreen]
Alter[vbcol=seagreen]
some[vbcol=seagreen]|||How can I know if the trigger is enabled or disabled? Thanks.
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
> Hi,
> Identify the triggers which needs to be disabled. Then use the below Alter
> command to disable
> 1. Create a SQL Agent job to disable the trigger and schedule a time
> ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
> 2. Create another SQL Agent job to enable the trigger and schedule a time
> ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
> Make sure data integrity is not lost when you disable the trigger.
> Thanks
> Hari
> SQL Server MVP
> "00KobeBrian" <a@.b.com> wrote in message
> news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>|||Hi 00KobeBrian
Use the function OBJECTPROPERTY
SELECT OBJECTPROPERTY(object_id('name of trigger')',
'ExecIsTriggerDisabled')
HTH
Kalen Delaney, SQL Server MVP
"00KobeBrian" <a@.b.com> wrote in message
news:OOsLHBX0GHA.1256@.TK2MSFTNGP02.phx.gbl...
> How can I know if the trigger is enabled or disabled? Thanks.
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
>|||Hi,
If you are using SQL 2005, you can refer to following article:
<http://msdn2.microsoft.com/en-us/library/ms188746.aspx>
Thanks.
Best regards,
Vincent Xu
Microsoft Online Partner Support
========================================
==============
Get Secure! - www.microsoft.com/security
========================================
==============
When responding to posts, please "Reply to Group" via your newsreader so
that others
may learn and benefit from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties,and confers no rights.
========================================
==============
--[vbcol=seagreen]
<#WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl>[vbcol=seagreen]
Alter[vbcol=seagreen]
time[vbcol=seagreen]|||Can you please give me an example? I am using SQL 2000. Thanks.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:eKMpdLX0GHA.5100@.TK2MSFTNGP05.phx.gbl...
> Hi 00KobeBrian
> Use the function OBJECTPROPERTY
> SELECT OBJECTPROPERTY(object_id('name of trigger')',
> 'ExecIsTriggerDisabled')
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "00KobeBrian" <a@.b.com> wrote in message
> news:OOsLHBX0GHA.1256@.TK2MSFTNGP02.phx.gbl...
>|||I gave you an example of checking for whether a trigger is disabled. If the
SELECT OBJECTPROPERTY returns 1, the trigger is disabled, if it returns 0,
the trigger is enabled, if it returns NULL, you typed something incorrectly.
If you need more details than that, you'll have to be more specific about
what you don't understand.
HTH
Kalen Delaney, SQL Server MVP
"00KobeBrian" <a@.b.com> wrote in message
news:O5vt5%23X0GHA.2072@.TK2MSFTNGP06.phx.gbl...
> Can you please give me an example? I am using SQL 2000. Thanks.
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:eKMpdLX0GHA.5100@.TK2MSFTNGP05.phx.gbl...
>
time daily?Hi,
Identify the triggers which needs to be disabled. Then use the below Alter
command to disable
1. Create a SQL Agent job to disable the trigger and schedule a time
ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
2. Create another SQL Agent job to enable the trigger and schedule a time
ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
Make sure data integrity is not lost when you disable the trigger.
Thanks
Hari
SQL Server MVP
"00KobeBrian" <a@.b.com> wrote in message
news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
> How do you disable and enable the trigger on a table automatically at some
> time daily?
>|||Hi,
Thanks Hari for greate information. I just like to provide following link
for detailed information:
http://msdn2.microsoft.com/en-us/library/ms182706.aspx
http://msdn2.microsoft.com/en-us/library/ms189748.aspx
Hope this helps.
Have a good day!
Best regards,
Vincent Xu
Microsoft Online Partner Support
========================================
==============
Get Secure! - www.microsoft.com/security
========================================
==============
When responding to posts, please "Reply to Group" via your newsreader so
that others
may learn and benefit from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties,and confers no rights.
========================================
==============
--[vbcol=seagreen]
Alter[vbcol=seagreen]
some[vbcol=seagreen]|||How can I know if the trigger is enabled or disabled? Thanks.
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
> Hi,
> Identify the triggers which needs to be disabled. Then use the below Alter
> command to disable
> 1. Create a SQL Agent job to disable the trigger and schedule a time
> ALTER TABLE <Table_name> Disable Trigger <Trigger_ name>
> 2. Create another SQL Agent job to enable the trigger and schedule a time
> ALTER TABLE <Table_name> Enable Trigger <Trigger_ name>
> Make sure data integrity is not lost when you disable the trigger.
> Thanks
> Hari
> SQL Server MVP
> "00KobeBrian" <a@.b.com> wrote in message
> news:e2UoIgU0GHA.4264@.TK2MSFTNGP05.phx.gbl...
>|||Hi 00KobeBrian
Use the function OBJECTPROPERTY
SELECT OBJECTPROPERTY(object_id('name of trigger')',
'ExecIsTriggerDisabled')
HTH
Kalen Delaney, SQL Server MVP
"00KobeBrian" <a@.b.com> wrote in message
news:OOsLHBX0GHA.1256@.TK2MSFTNGP02.phx.gbl...
> How can I know if the trigger is enabled or disabled? Thanks.
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:%23WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl...
>|||Hi,
If you are using SQL 2005, you can refer to following article:
<http://msdn2.microsoft.com/en-us/library/ms188746.aspx>
Thanks.
Best regards,
Vincent Xu
Microsoft Online Partner Support
========================================
==============
Get Secure! - www.microsoft.com/security
========================================
==============
When responding to posts, please "Reply to Group" via your newsreader so
that others
may learn and benefit from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties,and confers no rights.
========================================
==============
--[vbcol=seagreen]
<#WLdTeV0GHA.4448@.TK2MSFTNGP04.phx.gbl>[vbcol=seagreen]
Alter[vbcol=seagreen]
time[vbcol=seagreen]|||Can you please give me an example? I am using SQL 2000. Thanks.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:eKMpdLX0GHA.5100@.TK2MSFTNGP05.phx.gbl...
> Hi 00KobeBrian
> Use the function OBJECTPROPERTY
> SELECT OBJECTPROPERTY(object_id('name of trigger')',
> 'ExecIsTriggerDisabled')
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "00KobeBrian" <a@.b.com> wrote in message
> news:OOsLHBX0GHA.1256@.TK2MSFTNGP02.phx.gbl...
>|||I gave you an example of checking for whether a trigger is disabled. If the
SELECT OBJECTPROPERTY returns 1, the trigger is disabled, if it returns 0,
the trigger is enabled, if it returns NULL, you typed something incorrectly.
If you need more details than that, you'll have to be more specific about
what you don't understand.
HTH
Kalen Delaney, SQL Server MVP
"00KobeBrian" <a@.b.com> wrote in message
news:O5vt5%23X0GHA.2072@.TK2MSFTNGP06.phx.gbl...
> Can you please give me an example? I am using SQL 2000. Thanks.
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:eKMpdLX0GHA.5100@.TK2MSFTNGP05.phx.gbl...
>
订阅:
博文 (Atom)