Showing posts with label trigger. Show all posts
Showing posts with label trigger. Show all posts

Friday, March 30, 2012

How to trigger the update command of the SQLDataSource

Hi - I'm using .net2, and have a gridview, populated by a SQL Datasource (Edit, Insert, Delete, Select).

Like we all used to do with the datagrid, I've added text boxes into the footer, and a link button, which I'd like to use to fire the Update command.

How do I get the link button to trigger the update command?

Thanks, Mark

in you link button click event handler call

datasourceName.Update();

Hop this help

How to trigger Snapshot and Merge Replication

I have two servers config'd for merge replication (server A is SUB, server B
is PUB)
When insert on server B table1 occur, I need trigger to exec snapshot,
followed by merge replication jobs. The jobs exist on server A.
I know how to create triggers, but not clear on how to trigger a SQL job
from server B to run from server A?
using SQL 2K5
You coyuld set up a linked server and run sp_start_job on server A using a
fully qualified name...
Cheers,
Paul Ibison
sql

How to Trigger a Job on MSDE from SQL Server

Hi,
Can i have "Jobs" on MSDE .
If yes, then i want that jobs to be fired from SQL Server.
Actually what i want is to have one SQL Server, and MSDE on all other
machines. And the central SQL Server would take care of when a perticual job
is to be exicuted.
Can i do this. Will "Linked Servers" help.
Regards,
Raj Dhrolia.Please don't post independently to multiple groups. See my reply in
microsoft.public.sqlserver.tools
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Raj Dhrolia" <rajdhrolia@.hotmail.com> wrote in message
news:O7gGcu00DHA.4064@.tk2msftngp13.phx.gbl...
> Hi,
> Can i have "Jobs" on MSDE .
> If yes, then i want that jobs to be fired from SQL Server.
> Actually what i want is to have one SQL Server, and MSDE on all other
> machines. And the central SQL Server would take care of when a perticual
job
> is to be exicuted.
> Can i do this. Will "Linked Servers" help.
> Regards,
> Raj Dhrolia.
>
>
>

How to Trigger a Job on MSDE from SQL Server

Hi,
Can i have "Jobs" on MSDE .
If yes, then i want that jobs to be fired from SQL Server.
Actually what i want is to have one SQL Server, and MSDE on all other
machines. And the central SQL Server would take care of when a perticual job
is to be exicuted.
Can i do this. Will "Linked Servers" help.
Regards,
Raj Dhrolia.Please don't post independently to multiple groups. See my reply in
microsoft.public.sqlserver.tools
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Raj Dhrolia" <rajdhrolia@.hotmail.com> wrote in message
news:%23YIWPu00DHA.2568@.TK2MSFTNGP09.phx.gbl...
quote:

> Hi,
> Can i have "Jobs" on MSDE .
> If yes, then i want that jobs to be fired from SQL Server.
> Actually what i want is to have one SQL Server, and MSDE on all other
> machines. And the central SQL Server would take care of when a perticual

job
quote:

> is to be exicuted.
> Can i do this. Will "Linked Servers" help.
> Regards,
> Raj Dhrolia.
>
>
>

Monday, March 26, 2012

How to tracking trigger

Hi guys,
I'm using trigger to write multiple files (5-6 file on multiple directories)
using xp_cmdshell (invoke echo "" > path) on SQL Server 2000.
I've found that sometime it does not output all the files it should be
written (almost the last file). So I'd like to check what happen on my
trigger. Could you please suggest me?
Thanks in advance,
Thana N.Thana
Run SQL Server Profiler to capture SP:StmtCompleted event.
"Thana N." <n-thana-n0reply@.h0tmail.c0m> wrote in message
news:eDiBAnS9DHA.2412@.TK2MSFTNGP09.phx.gbl...
> Hi guys,
> I'm using trigger to write multiple files (5-6 file on multiple
directories)
> using xp_cmdshell (invoke echo "" > path) on SQL Server 2000.
> I've found that sometime it does not output all the files it should be
> written (almost the last file). So I'd like to check what happen on my
> trigger. Could you please suggest me?
> Thanks in advance,
> Thana N.
>|||Uri,
Is there anyway to track the historical for this? Because it is running on
the production and I cannot have a right to run Profiler for this (my sql
user is not in a group of sysadmin).
Thanks for reply,
Thana N.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:ONJrz0S9DHA.2560@.TK2MSFTNGP09.phx.gbl...
> Thana
> Run SQL Server Profiler to capture SP:StmtCompleted event.
>
> "Thana N." <n-thana-n0reply@.h0tmail.c0m> wrote in message
> news:eDiBAnS9DHA.2412@.TK2MSFTNGP09.phx.gbl...
> > Hi guys,
> >
> > I'm using trigger to write multiple files (5-6 file on multiple
> directories)
> > using xp_cmdshell (invoke echo "" > path) on SQL Server 2000.
> >
> > I've found that sometime it does not output all the files it should be
> > written (almost the last file). So I'd like to check what happen on my
> > trigger. Could you please suggest me?
> >
> > Thanks in advance,
> > Thana N.
> >
> >
>

How to tracking trigger

Hi guys,
I'm using trigger to write multiple files (5-6 file on multiple directories)
using xp_cmdshell (invoke echo "" > path) on SQL Server 2000.
I've found that sometime it does not output all the files it should be
written (almost the last file). So I'd like to check what happen on my
trigger. Could you please suggest me?
Thanks in advance,
Thana N.Thana
Run SQL Server Profiler to capture SP:StmtCompleted event.
"Thana N." <n-thana-n0reply@.h0tmail.c0m> wrote in message
news:eDiBAnS9DHA.2412@.TK2MSFTNGP09.phx.gbl...
> Hi guys,
> I'm using trigger to write multiple files (5-6 file on multiple
directories)
> using xp_cmdshell (invoke echo "" > path) on SQL Server 2000.
> I've found that sometime it does not output all the files it should be
> written (almost the last file). So I'd like to check what happen on my
> trigger. Could you please suggest me?
> Thanks in advance,
> Thana N.
>|||Uri,
Is there anyway to track the historical for this? Because it is running on
the production and I cannot have a right to run Profiler for this (my sql
user is not in a group of sysadmin).
Thanks for reply,
Thana N.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:ONJrz0S9DHA.2560@.TK2MSFTNGP09.phx.gbl...
> Thana
> Run SQL Server Profiler to capture SP:StmtCompleted event.
>
> "Thana N." <n-thana-n0reply@.h0tmail.c0m> wrote in message
> news:eDiBAnS9DHA.2412@.TK2MSFTNGP09.phx.gbl...
> directories)
>

How to trace trigger execution in SQL Profiler?

When I try to trace some SQL statement executions inside a Trigger by using 2005 SQL Profiler, I found even the trigger is fired, there's no any trace about it in SQL Profiler. How can I trace trigger execution in 2005 SQL Profiler?Hi,

have a look here: http://groups.google.de/group/microsoft.public.sqlserver.server/browse_frm/thread/c87621996c73012b

HTH, Jens SUessmeyer.

http://www.sqlserver2005.de

Monday, March 19, 2012

How to tell if a function is called within a trigger

How can I tell whether a function has been called, along with the values that were passed into it? My SQL is generated by Visual Basic, and on an insert, a trigger fires, which then *might* call the function depending on a condition that's difficult to monitor. Ideally, I'd be looking for a simple function that would write to a log, or print a message somewhere. "Print" does not work within functions. I'm running SQL Server 2000.You could create a stored procedure that writes to a log, and then call that stored procedure from the trigger. Kinda messy, but will work.|||

1. Profiler

2. Put code in the trigger that inserts relevant values (funtion input parameters, record IDs) into a table at the point the function would be called. Comment out or remove this code after testing. I routinely do this in Try Catch blocks (or 2000 error handling) of sprocs during dev.

|||You also cannot perform an INSERT to a permanent table in a function. If this is important you might consider upgrading to SQL Server 2005 and using a SET CONTEXT_INFO to save some information. I guess you could call a procedure from the trigger but I am really not sure how much this will buy you -- you are sort-of already in a psedudo procedure since you are in a trigger.

Friday, February 24, 2012

how to store a record before deleting it using triggers

hey ,
im new to SQL. i wanted to save a particular record before deleting it usin
g a delete trigger can anyone help me on this .. thnxIO you want to store the whole row and therefore the data you could
consider leaving the data in the table and marking the row as "deleted"
by flagging the row with a bit column as deleted. If you don=B4t want to
maintain the whole row you could do something like this:
CREATE Trigger DELTrg_SomeTable ON SomeTable
FOR DELETE
AS
BEGIN
INSERT INTO SOmeTable
SELECT * from Deleted
/*
Rather than using the asterix to Select the column and data I would
namer the columns you want to select and insert therefore lgiving you
the opputunity to fill in additional fields which are extended int he
archive (something like an audit data, who deleted what row from what
host, etc.)
*/
END
HTH, Jens Suessmeyer.