Tab

Saturday, 6 August 2011

Which system database of which we can't take the backup?

We can't take the backup of the tempdb database and the tempdb database is a universal "scratch" area within SQL Server. The SQL Server engine utilizes tempdb as a temporary storage area when doing sorting and aggregation operations. Applications can also utilize tempdb through the use of temporary tables, procedures, and cursors. You can look at tempdb as serving a function similar to the paging file within Windows. Anything created within tempdb, by its very nature, is temporary. When you restart a SQL Server instance, tempdb is wiped out and re-created.

You should never create any object that is required to be persistent within tempdb, because you will lose anything stored in tempdb when the instance is restarted.

--
For more articles, Please Visit : http://microsoft-sql-server-dba.blogspot.com/

How to get list of Database Users

The below query will list of out list of Database user's

use ReportServer

sp_helpuser

--
For more articles, Please Visit : http://microsoft-sql-server-dba.blogspot.com/

Wednesday, 29 June 2011

The basic differences between Primary Key and Unique key are as follows


 1) By default Primary Key will generate Clustured Index whereas Unique Key will Generate Non-Clustured Index.
2) Primary Key is a combination of Unique and NOT NULL Constraints so it can’t have duplicate values or any NUll Whereas for Oracle UNIQUE Key can have any number of NULL whereas for SQL Server It can have only one NULL
3) A table can have only one PK but It can have any number of UNIQUE Key.

Sunday, 26 June 2011

Copy data from one table to another table

The following is the query to copy the data from one table to another table.

select * into employee2 from employee1
Here Table employee1 is existing table and take backup in another table named : employee1. It will automatically will create the another table employee1 with the same structure. 


Microsoft Database mirroring

  •          The database mirroring is implement only one database at time
  •          The selected database must be in full recovery mode only (Other recovery mode won't work)
  •          You can't mirror on system databases like (master, msdb, tempdb, model)
--
For more articles, Please Visit : http://microsoft-sql-server-dba.blogspot.com/

What is bit datatype and what's the information that can be stored inside a bit column?

Bit datatype is used to store Boolean information like 1 or 0 (true or false). Until SQL Server 6.5 bit datatype could hold either a 1 or 0 and there was no support for NULL. But from SQL Server 7.0 onwards, bit datatype can represent a third state, which is NULL.


--
For more articles, Please Visit : http://microsoft-sql-server-dba.blogspot.com/