|
-
Mar 21st, 2000, 09:36 PM
#1
Thread Starter
Hyperactive Member
This isn't exactly vb, but it's related to the vb project that I'm working on, and you seem to be well rounded. If I create a trigger in SQL Server 7.0, is there a way for me to grab the currentrow that made the trigger fire (on updating an existing record or inserting a new record) without using a select statement against the entire table?
Also, any way to call an external exe from the trigger?
Thanks in advance,
Wade
-
Mar 21st, 2000, 10:25 PM
#2
Frenzied Member
You should examine Transact-SQl help for "Create Trigger". You can use the psuedo tables "inserted" or "deleted".
WRT calling external exe's, I'll look into my docs and get back to ya tomorrow
-
Mar 21st, 2000, 11:15 PM
#3
Thread Starter
Hyperactive Member
Thanks John...the Inserted pseudo table is just what I was looking for. I'll be doing some research on my end too...hopefully one of us will figure out how to call an exe.
Thanks again,
Wade
-
Mar 22nd, 2000, 10:03 PM
#4
Thread Starter
Hyperactive Member
Here's an idea
Thanks for looking into it. Here's an idea. You can schedule a job which invokes an external app or runs vbscript. Is there a way for a trigger to call a job?
Thanks again,
Wade
-
Mar 23rd, 2000, 02:17 AM
#5
Frenzied Member
I don't believe so. Triggers appear to execute T-SQL only. I could, however, be wrong.
-
Mar 23rd, 2000, 07:02 AM
#6
Hyperactive Member
Read my previous reply.
You develop a "tiny" VB or VC++ application whose entire purpose is to POLL a particular Table on the SQL Server. When it finds a record in that table the fields indicate which application to run and what parameters to pass it.
Then you application does a ShellExecute or whatever to kick off the other application and removes the record from the table.
Set the timer for 1 "pulse" every 60 seconds and you wont even notice it running.
Code:
SELECT COUNT(*) AS NumRecs FROM ProcessTable WHERE Status = 'Active'
This is barely even noticable to the system and if the value that comes > 0 you go into process mode otherwise it just resets the time for another 60 seconds and waits.
-
Mar 23rd, 2000, 09:39 PM
#7
Thread Starter
Hyperactive Member
Thanks for the replies and the ideas. There's also a master stored procedure (xp_cmdshell) that can be called.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|