There is a free webinar for SQL DBA’s from PragmaticWorks on “Intro to .NET for DBA” .
“In this session, Ben will show you a basic overview of developing with C# presented from the perspective of a DBA. This webinar will provide basic information on the .Net framework as well as how to present data, and best practices which DBA’s can look out for from there developers”
If you are interested, please register for it over here.
For your Information – It is at India Time 9.30 PM on Tuesday Night of 01 March 2011.
Tagged as:
Training
Super Key
A combination of one or more columns in a table which can be used to identify a record in a table uniquely, a table can have any number of super keys.
Candidate Key
A Column (or) Combination of columns which can help uniquely identify a record in a table without the need of any external data is called a Candidate Key. Depending on the need and situation a Table may have one or more candidate keys and one of them can be used as a Primary Key of the table.
A candidate key is a sub set of a Super Keys.
For Example, In an Employee Table, we may have columns like Employee ID, Employee Name, and Employee SSN. We can consider either Employee ID or Employee SSN as Candidate Key’s
Compound Key
A Combination of more than one column identifying records of a table uniquely, all the columns that take part in the combination process are Simple Key’s.
We can represent this buy taking a table which has the combined information of Department to Employees, Employee ID + Department ID – here both of them define a record in this table, but both can make sense separately as well.
Primary Key
A Column in a table (which is a Simple Key) which is a Candidate Key (Uniquely identify a records in a table) and has the Constraint NOT NULL attached to it is known as a Primary Key.
Generally, but not always and need not be, Primary Key goes with a Clustered Index.
Composite Primary Key (Composite Key)
When we have a Primary Key of a table defined using more than one columns then it is known as a Composite Key, each columns data can be duplicated, but combined values cannot be. The columns which are participating in a composite primary key are not simple keys.
For Example, we can have a situation where there is a need to define the key using first Name + last Name.
Alternate Key
We cannot define the Alternate Key Seperately from a Candidate Key, for a table, if there are two Candidate Key’s and one is chosen as a Primary Key the other Candidate Key is known as the Alternate Key of that table.
In Example, we can consider the Employee SSN as Alternate Key as we have taken Employee ID as our Primary Key
Unique Key
A column (or) combination of columns which can be used to uniquely identify a record in a table, it can have one NULL Value.
Primary Key can be considered a special case of unique key with a Not Null Constraint.
Generally, but not always and need not be, Unique Key goes with a Non Clustered Index.
Foreign Key
A column of one table points to the Primary Key column of another table to implement referential data integrity.
For Example, we can have a department id column in the employee table which is pointing to department id column in a department table where it a primary key.
If you have liked the article and want to get the articles (or) new posts at sql like, subscribe to articles through email by entering your email address in the top right and verifying the same. If you have any comments, then the below form is for you, go ahead!!!
Tagged as:
RDBMS Concepts
Running a DROP statement on an SQL Server is never an easy task as far as the numbers of thoughts that run in our mind at the time of doing that are considered.
So, here is writing up on the process that we need to follow while dropping a SQL Server Database.
Firstly, the decision process that you have to really go ahead and drop the database, if yes then create a checklist of your own with the below as a starting point to it.
1. Check if any application is using the database,the chance is that they need to be pointed to a new upgraded database or the application is obsolete now and simply needs to be removed.
2. Check if any other databases are using objects of this database.
3. Check if you have any Database Level Triggers on this particular database.
4. Check if you have any Maintenance plans, exclusively referring this database.
5. Check if you have any MS SQL Server Agent Jobs referring this database exclusively.
6. Check if you have any Database Snapshots, if yes, Drop the database snapshots on the database.
7. Check if you have log shipping configured, If the database is involved in log shipping, remove log shipping before dropping the database.
8. Get a thumbs up from the owner of the database
9. Check if there are any existing users. If yes, notify them, or if they are long running check what operation they are trying to do and kill them.
10. Preferably, get the database to SINGLE_USER mode.
11. Take a full backup with “verify the backup” option on, rather take multiple copies with at least one being offsite.
12. Create a script of all the Logins in that database, in case you may miss the logins at the place of Restoration.
13. Take a backup of the master database.
14. Drop the database.
15. Take a backup of the master database.
Now for some basic points
Syntax: DROP DATABASE Database Name
For deleting a database you need to at least have CONTROL permission on the database.
We can delete a database regardless of its state – Offline, Read-only or Suspect or any other.
If you have liked the article and want to get the articles (or) new posts at
sql like, subscribe to articles through email by entering your email address in the top right and verifying the same. if you have any comments, then the below form is for you, go ahead!!!
Tagged as:
Database,
Drop