.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> Sql Server >> Post New Question Subscribe to Interview Questions

What is Magic Table in SQL Server?

Posted By :abhays     Posted Date :June 12, 2014    Points :40   Category :Sql Server 
Magic Tables are invisible tables which created on MS SQL Server, during INSERT/UPDATE/DELETE operations on any table. These tables temporarily persists values before completing the DML statements.

SQL Server allows you to define a Magic Table. Magic Tables are invisible tables or virtual tables. You can see them only with the help Triggers in SQL Server. Magic Tables are those tables which allow you to hold inserted, deleted and updated values during insert, delete and update DML operations on a table in SQL Server. So let's have a look at a practical example of how to use Magic Tables in SQL Server. The example is developed in SQL Server 2012 using the SQL Server Management Studio.

These are the two Magic Tables:
1.Inserted
2.Deleted

Generally Magic Tables are invisible tables, we can only see them with the help of Trigger's in SQL Server.


You can also find related Interview Question to What is Magic Table in SQL Server?  below: 

Which system table holds the details of all the processes running on the Microsoft sql server?

  
The name of the system table is sysprocesses .

Select * from sysprocesses


Make sure you run this query in master database. (More...)

More than one IDENTITY column per table can be exist in SQL Server . (True /False)

  
False.
There can only be one IDENTITY column per table in SQL Server.
Its auto Incremented Column defined by the user. (More...)

What Is Cascade And Restrict When We Use DROP Table In SQL SERVER ?

  
When we are using Drop table in SQL the syntax is simple.
Drop table table_name(CASCADE / RESTRICT)
We use cascade to drop table although it have some dependencies just like triggers,stroeprocrdure,primarykey,foreignkey it will delete first.
But if we use restrict a error message is shown on using of DROP if the table have relation Trigger,storeprocedure. (More...)

how to find the table name in sql server database?

  
select * from INFORMATION_SCHEMA.tables where table_name like 'tblname%' (More...)

how to find column name from sql server table?

  
select * from INFORMATION_SCHEMA.Columns where column_name like 'colname%' (More...)

can you reset seed for a table in sql server?

  
yes, DBCC CHECKIDENT('[YourTableName]', RESEED, 0) (More...)

How to get basic SQL Server table structure information

  
sp_help will give you a whole bunch of information about a table including the columns, keys and constraints.

For example

exec sp_help 'Employee'

will give you information about table Employee. (More...)

How to update record in a table using records in another table in SQL Server ?

  
update tableOne set tableOne.field1=tableTwo.fieldX from tableOne, tableTwo where tableOne.commonID=tableTwo.commonID (More...)

How to update record in a table using records in another table in SQL Server ?

  
update tableOne set tableOne.field1=tableTwo.fieldX from tableOne, tableTwo where tableOne.commonID=tableTwo.commonID (More...)

Database Concurrency in Sql Server.

  
When two or more user try to update same type of data in a table then Database Concurrency helps in this situation.

There are 2 types of Database Concurrency

Pessimistic: When one user try to change the data with pessimistic concurrency then a lock is placed on the data in a table so that another user cannot change data. when one user finishes then other user can able to change.

Optimistic: When two user works on the same data in a table and one change that data first then second user cannot change that same data becasue the which he have using is allready changed so he cannot do the change becasue change apply to another data that is changed by first user. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend