What are the two virtual tables SQL Server maintains for
triggers?
Answers were Sorted based on User's Feedback
Answer / sanjeev kumar
Two virtual tables are:
1) Inserted
2) Deleted
these two tables are also called magic table.
it has no any physical existence. it is used to keep trac of
the previous data when DML operation used.
it's used in a trigger.
Example:
Create trigger testtri on test3
for update
as
begin
declare @previousname varchar(50) -- local variable
select @previousname = del.name from deleted del
insert into test(name)values(@previousname)
end
Is This Answer Correct ? | 7 Yes | 0 No |
Answer / sri
The 2 virtual tables are the OLD and the NEW
OLD is invalid in the case of INSERT and NEW is invalid in
the case of DELETE statements
Inside the trigger we can use the OLD and NEW as follows
:OLD.columnname
:NEW.columnname
Is This Answer Correct ? | 3 Yes | 6 No |
what is joins please explain breffly ??
How do I find the default sql server instance?
1. What are the grouping function in SQL ? 2. If base table of a view deleted means, what will happen while we querying on view ? will give any error ? 3. Difference between DROP, DELETE, TRUNCATE table ? 4. What is constraints and types ? 5. What is max size of nchar & nvarchar ? 6. Define ROLLBACK, COMMIT, SAVE POINT 7. How non-clustered better ? or rank the Clustered, Non-Clustered and Table scan in performance wise 8. Select 10 rows from a table ? 9. Define DML, DDL, DCL, DTL commands ? 10. What is mean by NULL value ? NULL means "" or 0 or undefined ? 11. Default constraints ? 12. Can we have more then primary Key in table ? 13. Type of integrity ? Entity, Referential, Domain ?
How to restore performance issues and how to check?
What is relationship? What number of sorts of relationship are there?
How do you make a trace?
Suppose in a situation if two list boxes are there and if you select multiple options based on that the options related to those selected items should display in second list box. Again if we select multiple items in second listbox then the related to those selected items should display . In this scenario how will you design database,tables?
Can you tell me about the concept of ER diagrams?
Explain what are db_options used for?
You want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition?
How much is a sql server license?
What is the difference between writing data to mirrored drives versus raid5 drives