Backup/Restore Optimization Tips

Backup/Restore Optimization Tips:

Try to perform backup to the local hard disk first, and copy backup file(s) to the tape later.
When you perform backup, some SQL Server commands cannot be made, for example: during backup you cannot run ALTER DATABASE statement with either the ADD FILE or REMOVE FILE options, you cannot shrink database, you cannot [...]

Analyze and Fix Index Fragmentation in SQL Server 2008

Analyze and Fix Index Fragmentation in SQL Server 2008
It is very common that over time SQL Server tables and indexes tend to become fragmented. The fragmentation generally happens when data within the underlying tables on which an index exists is modified. The data modification basically can be an insert, update or a delete operation. The [...]

How to Cluster SQL Server 2005

How to Cluster SQL Server 2005
Believe it or not, the procedure to install a SQL Server 2005 instance onto a cluster is one of the easiest parts of getting your SQL Server 2005 cluster up and running. The SQL Server 2005 setup program is used for the install and does the hard work for you. [...]

SQL Tuning or SQL Optimization

SQL Tuning or SQL Optimization
Sql Statements are used to retrieve data from the database. We can get same results by writing different sql queries. But use of the best query is important when performance is considered. So you need to sql query tuning based on the requirement. Here is the list of queries which we [...]

SQL Subquery

SQL Subquery
Subquery or Inner query or Nested query is a query in a query. A subquery is usually added in the WHERE Clause of the sql statement. Most of the time, a subquery is used when you know how to search for a value using a SELECT statement, but do not know the exact value.
Subqueries [...]

Using Stored Procedures

Most of us, the database programmers, have used Stored Procedures. May be not all of us knows about why we use them. This article is for those who have used/never used stored procedures, and are yet to understand why everyone suggests using them in your Database.
Stored Procedures – What are they?
Stored procedure is a [...]

SQL Server Date Formats CAST and CONVERT

Date Formats CAST and CONVERT (Transact-SQL)
Converts an expression of one data type to another.
Topic link icon Transact-SQL Syntax Conventions
Syntax for CAST:
CAST ( expression AS data_type [ (length ) ])
Syntax for CONVERT:
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )
SQL Server Date Formats

Default

SELECT CONVERT(VARCHAR(20), GETDATE(), 100)

Jan 1 2005 1:29PM 1

USA

SELECT [...]

SQL Statement OR Syntax

SQL Quick Reference:

SQL Statement
Syntax

AND / OR
SELECT column_name(s)
FROM table_name
WHERE condition
AND|OR condition

ALTER TABLE
ALTER TABLE table_name
ADD column_name datatypeor
ALTER TABLE table_name
DROP COLUMN column_name

AS (alias)
SELECT column_name AS column_alias
FROM table_nameor
SELECT column_name
FROM table_name  AS table_alias

BETWEEN
SELECT column_name(s)
FROM table_name
WHERE column_name
BETWEEN value1 AND value2

CREATE DATABASE
CREATE DATABASE database_name

CREATE TABLE
CREATE TABLE table_name
(
column_name1 data_type,
column_name2 data_type,
column_name2 data_type,

)

CREATE INDEX
CREATE INDEX index_name
ON table_name (column_name)or
CREATE UNIQUE INDEX index_name
ON table_name (column_name)

CREATE VIEW
CREATE VIEW [...]

SQL Server 2005 Failover Clustering White Paper

SQL Server 2005 Failover Clustering White Paper
Brief Description:
Comprehensive document about implementing failover clustering for SQL Server 2005 and Analysis Services.
Overview:
This white paper is intended for a technical audience and not technical decision makers. It complements the existing documentation around planning, implementing, and administering of a failover cluster that can be found in Microsoft SQL Server [...]

Roles of DBA

A database administrator (DBA) is a person who is responsible for the environmental aspects of a database. In general, these include basic:

Recoverability – Creating and testing Backups
Integrity – Verifying or helping to verify data integrity
Security – Defining and/or implementing access controls to the data
Availability – Ensuring maximum uptime
Performance – Ensuring maximum performance
Development and testing support [...]

Easy step to install SQL Server 2000

Installing SQL Server 2000
loadTOCNode(2, ’summary’);
To Install SQL Server 2000 Basic Local Installation
loadTOCNode(3, ’summary’);

Insert the Microsoft SQL Server 2000 compact disc in your CD-ROM drive (if the compact disc does not run automatically, double-click Autorun.exe in the root directory of the compact disc), select SQL Server 2000 Components, and then select Install Database Server. Setup prepares [...]