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

Top 5 Contributors of the Month
Gaurav Pal

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

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

Posted By :Ghanashyam Nayak     Posted Date :September 29, 2010    Points :10   Category :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.

You can also find related Interview Question to What Is Cascade And Restrict When We Use DROP 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)

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

Which option is used to drop constraints specified on the table?

DROP option in the ALTER TABLE command is used to drop constraints specified on the table. (More...)

What is the error in the following command?

Variable names should start with an alphabet. Here the table name starts with an '&' symbol. So it will give a compilation error. (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...)

Would the select query below fetch any records?

create table #testvm (ID int)

select * from sysobjects where name = '#testvm'

drop table #testvm


Since temp tables are created in tempdb, and use a random name, the query will not work.

If you used a query like this, you would see your table:

select * from tempdb..sysobjects where name like '#testvm%' (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...)

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