Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Vivek's SQL Notes

Vivek johari is currently a Analyst and have more that 5.5 yeras of experience in database. He has Master degree in Computer and also he is Microsoft certified Sql DBA (MCTS)& Microsoft certified SQl BI professional(MCTS). He is also Oracle certified profession(OCP)DBA in ORACLE 10g and ORACLE 9i.He has the experience of working in PL/SQL, T-SQL and SSIS/SSRS. His work basically involved designing and optimization of the Database.He has also published many database articles on his blog Technologies with Vivek Johari.

Archives: January 2012

SQL Server- Output clause

Output Clause:- The SQL SERVER 2005 gives us an Output Clause which gives us the information about each row affected by the Insert, Update , Delete and Merge statement. It is more useful than @@scope_Identity and @@Identity column since these global variables gives us the information about the last inserted identity column value, but…

Read more

2 comments, 1,169 reads

Posted in Vivek's SQL Notes on 22 January 2012

CTE command In Sql Server


Common table expression (CTE):- Common table expression or CTE can be described as the temporary, named record set return by the execution of the query (insert, delete, update, select or update view statement). It is not stored as an object in the database and it last only till the execution…

Read more

8 comments, 2,529 reads

Posted in Vivek's SQL Notes on 17 January 2012

SQL Server-Table Variable

Table variable:- SQL Server provides an variable known as table variable which is used to store data in a similar way as we store data in physical tables but with some limitations. Like other SQL variable, it is also declare with the help of the Declare keyword with @ prefix. The Syntax…

Read more

4 comments, 2,734 reads

Posted in Vivek's SQL Notes on 7 January 2012

SQL Server - Local temporary table


Local temporary table:- Local temporary table is created in the tempdb and it is visible to the current user's session only. It remains exists till the current user session is connected. Once the user connection is disconnected it gets destroyed. Since the local temporary table is created in the tempdb,…

Read more

0 comments, 3,432 reads

Posted in Vivek's SQL Notes on 7 January 2012

SQL Server - Global temporary tables


Global temporary table:- Global temporary table is created in the tempdb  and it is visible to all other sessions as well. Global temporary tables are only destroyed when the current user disconnected and all the sessions referring to it closed. It means no user sessions refers it. Since the global temporary table is…

Read more

8 comments, 12,395 reads

Posted in Vivek's SQL Notes on 7 January 2012

How to remane a Table in Sql Server

To rename a column in a SQL Table following command can be reused:
SP_RENAME  'old table name', 'New table name'


For example, if we want to rename the table from employee to employeemaster, following command can be used.


SP_RENAME  'employee', 'employeemaster'


This command will rename the table from employee to employeemaster.

Read more

0 comments, 968 reads

Posted in Vivek's SQL Notes on 2 January 2012

How to change the database collation

To change the collation of an database following commands can be used:




ALTER DATABASE [database name] SET SINGLE_USER WITH ROLLBACK IMMEDIATE

ALTER DATABASE  [database name]  COLLATE Newcollation

ALTER DATABASE  [database name]  SET MULTI_USER


For example , suppose if the name of your database is learningdb and…

Read more

0 comments, 1,136 reads

Posted in Vivek's SQL Notes on 2 January 2012