.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

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

Posted By :Abhisek Panda     Posted Date :December 25, 2009    Points :10   Category :Sql Server 
DROP option in the ALTER TABLE command is used to drop constraints specified on the table.

You can also find related Interview Question to Which option is used to drop constraints specified on the table?  below: 

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...)

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...)

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...)

Database: How many primary key constraints can be created for one table?

Only one primary key constraints can be created for one table. (More...)

What are the privileges that can be granted on a table by a user to others?

Insert, update, delete, select, references, index, execute, alter, all (More...)

What command is used to create a table by copying the structure of another table?


Explanation :

To copy only the structure, the WHERE clause of the SELECT command should contain a FALSE statement as in the following.
If the WHERE condition is true, then all the rows or rows satisfying the condition will be copied to the new table. (More...)

What is the use of CASCADE CONSTRAINTS?

When this clause is used with the DROP command, a parent table can be dropped even when a child table exists. (More...)

Explain Constraints in SQL SERVER?

Data integrity is an important feature in SQL Server. When used properly, it ensures that data is accurate, correct, and valid. It also acts as a trap for otherwise undetectable bugs within applications.


A PRIMARY KEY constraint is a unique identifier for a row within a database table. Every table should
have a primary key constraint to uniquely identify each row and only one primary key constraint can be created for each table. The primary key constraints are used to enforce entity integrity.

UNIQUE constraint:

A UNIQUE constraint enforces the uniqueness of the values in a set of columns, so no duplicate values are entered. The unique key constraints are used to enforce entity integrity as the primary key

FOREIGN KEY constraint:

A FOREIGN KEY constraint prevents any actions that would destroy links between tables with the corresponding data values. A foreign key in one table points to a primary key in another table. Foreign
keys prevent actions that would leave rows with foreign key values when there are no primary keys with that value. The foreign key constraints are used to enforce referential integrity.

CHECK constraint:

A CHECK constraint is used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity. A NOT NULL constraint enforces that the column will not accept null values. The not null constraints are used to enforce domain integrity, as the check constraints. (More...)

What are constraints in SQL Server?

Constraints enforce the data integrity to the database and protect columns of the table from unwanted values. NOT NULL, CHECK, UNIQUE, PRIMARY KEY, FOREIGN KEY are the types of contraints define in SQL Server.


How to get a row was inserted most recently in a table?

select top 1 * from tablename order by ColumnName desc (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