SQL Server Triggers Interview Questions 


 

SQL Server Triggers Interview Questions
I asked this a moment ago but realised I had written the wrong thing.

What is the syntax for a trigger which prevents an INSERT from occurring into a table (purchases), if an attribute (call it 'cash') from another table (person), is less than 100?

ie the tables are:
TABLE person (has attribute 'cash')

Thanks for your help!
TABLE purchases
what is trigger in sql server?
tell an example.
What is the syntax for a trigger which fires if an attribute (call it attribute1) from table1, drops below 10?

I have written something but it compiles "with warnings"

Thankyou so much for your help!
when you insert one sequence in a table it will show you the total number of character in a sequence.

this question is related to bioinformatics.
I know VB 2005.I also know how to create databases but not anything about the SQL Language or any other functions, stored procedures, triggers, etc. I want a book which will teach me enough to be a competent database programmer.

Also please tell me a few websites where I can buy online and get it shipped.
In my project, I have a central data base(a small one!) and there are some subsystems working with that. Is it better that I put trigger in Updating the tables or just check them for example every 2 secs? (I presume it will not be updated so much)

[And I am using MS SQL Server+VS]
I want an application variable that indicates the table that was changed. Can someone help?
Nope, triggers do not take parameters. Simply because they are invoked automatically, you never call them so no question of passing parameters. Although if you want to access new or old data for the rows, you could access inserted and deleted virtual tables to get to that.
Not sure why you want to create triggers dynamically. I dont really get the point. I mean, you could use sp_executesql to create the trigger statements, but not sure that will help, and might cause blocking and whole lot of problems. You might want to rethink your strategy and actual business problem that you are trying to solve before thinking in technical terms.
Why doesnt Commit or rollback work in a PL/SQL Trigger?
I am setting up an example database for a class I am taking. The assignment involves setting up many triggers in on a set of tables, and as per assignment requirements I am using Microsoft SQL Sever. I have one script in which there are 3 triggers declared, on after the other. However, this script consistently returns an error. If I run the triggers in 3 separate scripts, it all goes fine. Is there any way to include these 3 triggers into a single script so that I can minimize the amount of files I am turning in?
I want a trigger that after being updated, I can get the values of different columns in a row and assign them to a variable?
I need to update a attribute named Q_Products in table Products whenever a row is inserted, deleted or updated in a table called Lineitems. What I have isnt working


I guess I am not sure how find a statement to control the Q_products to update automatically. I dont know what to put by the "set" and "where" commands

Any ideas?
I don't understand BEFORE/AFTER

I know that it indicates when the trigger's code executes (before or after the triggering statement is completed) but I still don't really understand what that means.

Any low-tech answers would be very much appreciated, as I have very little knowledge in this area.

Thanks for your help :)
I need to trigger SQL Server to start running(populates a table), whenever something has changed on Oracle on a table.

Does anyone know how to do this?

Plz give sql code if possible.
logically-delete a row in a table, rather than being actually removed. It means we need to add a column and mark it when delete query occurred.
1234Showing 46 to 60 of 60