Sunteți pe pagina 1din 5

Data Compression

Save disk storage Compression can improve disk I/O and memory utilization Backup Compression

Backup compression enables the backup of a database to be compressed without having to compress the database itself Table-Valued Parameters

Table-Valued Parameters (TVPs) allows stored procedures to accept and return lists of parameters. Microsoft Office 2007

SQL Server Reporting Server reports can now export directly to Word.

1. Transparent Data Encryption. The ability to encrypt an entire database. 2. Backup Encryption. Executed at backup time to prevent tampering. 3. LINQ. Development query language for access multiple types of data such as SQL and XML. 4. Data Synchronizing. Development of frequently disconnected applications. 5. Dates and Times. New data types: Date, Time, Date Time Offset. 6. File Stream. New data type VarBinary(Max) FileStream for managing binary data. 7. Table Value Parameters. The ability to pass an entire table to a stored procedure. 8. MERGE. TSQL command combining Insert, Update, and Delete.

External Key Management. Storing Keys separate from the data. Auditing. Monitoring of data access. Data Compression. Fact Table size reduction and improved performance. Resource Governor. Restrict users or groups from consuming high levels or resources. Hot Plug CPU. Add CPUs on the fly. Performance Studio. Collection of performance monitoring tools. Installation improvements. Disk images and service pack uninstall options. Dynamic Development. New ADO and Visual Studio options as well as Dot Net 3. Entity Data Services. Line Of Business (LOB) framework and Entity Query Language (eSQL)

Large UDT. No size restriction on UDT.

Spatial Data. Data type for storing Latitude, Longitude, and GPS entries. Full Text Search. Native Indexes, thesaurus as metadata, and backup ability. SQL Server Integration Service. Improved multiprocessor support and faster lookups.

SQL Server Analysis Server. Stack improvements, faster block computations. SQL Server Reporting Server. Improved memory management and better rendering. Microsoft Office 2007. Use OFFICE as an SSRS template. SSRS to WORD. SQL 2000 Support Ends. Mainstream Support for SQL 2000 is coming to an end.

What's the difference between VARCHAR and CHAR?


CHAR 1 used to store character string value of fixed length. 2 the maximum no of character that data type can hold is 255 character . 3 Char is 50% faster than varchar. 4 use the Static memory allocation . VARCHAR 1 used to store variable length alphanumeric data. 2 The maximum this data type can hold upto 4000 character . 3 it's slower than the Char. 4 use the dynamic memory allocation .

difference between PRIMARY KEY and UNIQUE KEY:


PRIMARY KEY UNIQUE KEY

NULL

It doesnt allow Null values. Because of this we refer PRIMARY KEY = UNIQUE KEY + Not Null CONSTRAINT

Allows Null value. But only one Null value.

INDEX index

By default it adds a clustered index

By default it adds a UNIQUE non-clustered

LIMIT

A table can have only one PRIMARY KEY Column[s]

A table can have more than one UNIQUE Key Column[s]

CREA TE SYNTAX

Below is the sample example for

Below is the sample example for defining a

defining a single column as a PRIMARY single column as a UNIQUE KEY column while KEY column while creating a table: creating a table: CREATE TABLE dbo.Customer CREATE TABLE dbo.Customer ( Id INT NOT NULL PRIMARY KEY, FirstName VARCHAR(100), LastName VARCHAR(100), City VARCHAR(50) ) Below is the Sample example for defining multiple Below is the Sample example for defining multiple columns as PRIMARY KEY. It also shows how we can give name for the PRIMARY KEY: CREATE TABLE dbo.Customer ( CREATE TABLE dbo.Customer ( Id INT NOT NULL, Id INT NOT NULL, FirstName VARCHAR(100) NOT NULL, LastName VARCHAR(100), columns as UNIQUE KEY. It also shows how we can give name for the UNIQUE KEY: ( Id INT NOT NULL UNIQUE, FirstName VARCHAR(100), LastName VARCHAR(100), City VARCHAR(50) )

FirstName VARCHAR(100) NOT NULL, LastName VARCHAR(100), City VARCHAR(50),

City VARCHAR(50), CONSTRAINT UK_CUSTOMER UNIQUE(Id,First Name)

CONSTRAINT PK_CUSTOMER PRIMA ) RY KEY(Id,FirstName) )

ALTE R SYNTAX

Below is the Syntax for adding PRIMARY KEY CONSTRAINT on a column when the table is already created and doesnt have any primary key: ALTER TABLE dbo.Customer ADD CONSTRAINT PK_CUSTOMER PRIMA RY KEY (Id)

Below is the Syntax for adding UNIQUE KEY CONSTRAINT on a column when the table is already created: ALTER TABLE dbo.Customer ADD CONSTRAINT UK_CUSTOMER UNIQUE(Id)

DROP SYNTAX

Below is the Syntax for dropping a PRIMARY KEY: ALTER TABLE dbo.Customer DROP CONSTRAINT PK_CUSTOMER

Below is the Syntax for dropping a UNIQUE KEY: ALTER TABLE dbo.Customer DROP CONSTRAINT UK_CUSTOMER

Execution Plan Retention and Reuse (SP are compiled and their execution plan is cached and used

again to when the same SP is executed again)

Improved performance By default, a procedure compiles the first time it is executed and creates an execution plan that is reused for subsequent executions. Reduced network usage between clients and servers The stored procedure performs intermediate processing on the database server, without transmitting unnecessary data across the network. Only the records that are actually required by the client application are transmitted. Improved security Easier maintenance database operations in the data tier, only the procedures must be updated for any changes in the underlying database. Reuse of code for repetitious database operation eliminates needless rewrites of the same code.

There are three types of relationships: One-to-one: Both tables can have only one record on either side of the relationship. Each primary key value relates to only one (or no) record in the related table.
They're like spousesyou may or may not be married, but if you are, both you and your spouse have only one spouse.

One-to-many: The primary key table contains only one record that relates to none, one, or many records in the related table.
This relationship is similar to the one between you and a parent. You have only one mother, but your mother may have several children.

Many-to-many: Each record in both tables can relate to any number of records (or no records) in the other table. For instance,
if you have several siblings, so do your siblings (have many siblings)

foreign key field must be of the same data type as the primary key.

S-ar putea să vă placă și