Google Custom Search
Sunday, July 18, 2010
Thank You ALL for making SQL Data Camp @ Chennai a GRAND SUCCESS
At this moment being the chairperson of the organizing committee, I would like to thank people who were involved in bringing success to the first ever day long SQL Server event in India.
Speakers:
I would like to thank all the speakers for accepting our invitation to deliver a session.
Pinal, travelling from Malaysia to Hyderabad and to Chennai only to make for this event and delivered two excellent sessions on indexing.
Madhu, Sudhir Mahendru and Basker Krishnamoorthy(members of Data Architecture Center of Expertise (DACoE) of Cognizant Technology Solutions) - This team was impressive in making clear to audience why DATA DESIGNING is so important to any application development lifecycle.
Venkatesan Prabhu, I have to make a special mention about him. He made great changes to his vacation calendar just to make for this event and was pleasant to have him travelling from Australia at the right time.
Raymond, from Doubletake software presented one of the most exciting sessions on high availability with Doubletake. I have never seen an UG giving one full session to a sponsor and we are proud of making our sponsor a part of our team.
Sponsors:
If speakers were driving the event throughout the day, it was our sponsors you were with us from the day we planned till this last moment bringing energy and enthusiasm among us. The following are the persons who drove us through success.
Blythe Morrow, Sujatha Metha, Sanj Gaddam of PASS.
Doubletake Software
Redgate software
Sql-articles.com
Jacob Sebastian of BeyondRelational.com
My User Group Colleagues - Vidhyasagar and Deepak:
These both, I have no words to thank them; I am New York and was instructing them to do what needs to be done. And these guys have accomplished more than what I asked them. They have always been part of my community journey and this one is next stepping stone for us. We together have set a new milestone of conducting an event for SQL Server and we will make sure we will better this one in future events.
User Group Members:
This group has been one of the most active SQL server user groups around India and the members have been most energetic lot. They are the one who bring us enthusiasm and energy for us to take steps forward.
Personally, I was so proud to hear from Pinal, Vidhyasagar and Deepak that there so many attendees wanting to meet and chat with me. I apologize for not turning to be there. But I will make sure that I will meet everyone when I am in India for vacation.
Nagesh, Selva and Senthil:
These three need a special mention here. They have no association with either this User Group or SQL Server but were kindhearted enough to help us from designing the Logos, website, arranging things, coordinating with vendors, loaning their personal car for shuttle and what not. Thank You guys. Without you we would have had tough time managing things around us.
I would once again take this opportunity to Thank everyone for making this event a GRAND SUCCESS.
If I would have missed someone, please apologize me.
Thank you All.
Wednesday, January 20, 2010
SQL Server 2008 R2 by MAY 2010
Saturday, November 28, 2009
Consolidating our blogs into one website
Saturday, October 10, 2009
The Unhealthy Argument
This post of mine is 100 percent a personal opinion and was written not to hurt anyone.
Off late, I have been hearing or knowing incidents which have involved 2 or more persons going into an argument on deciding which technology is the best is it WINDOWS or UNIX, ORACLE or SQL SERVER, .Net or JAVA, IE or Chrome, etc. There are few incidents that came to my notice which I would like to share with you all.
1. This was between friends of mine who worked in my previous company; they both work in the same team providing support to one of their clients. One is an ORACLE DBA and other is SQL Server DBA. They have argued hardly to decide which Database systems is the best and have ended up criticizing Larry Ellison and Bill Gates.
2. The next is between the web browsers, I have read a numerous articles in the blogs and other websites saying IE is the best or Chrome is the best or Firefox is the best, etc. The same has happened between my known persons where they have ended using abusive languages. I am sorry to say this, but when people lose temper that is the end result.
3. Again, between my old colleagues, about WINDOWS or UNIX, each of them have had strong points to prove that they work on the latest technology of the server side Operating systems but failed to convince others. Thank God, NO blows or words were exchanged in the incident.
Now, let me come to say this, each technology or application is designed for a purpose and has its own pros and cons with it. Thanks to my patience in the recent past that I have not had such an Unhealthy Argument like this. In my opinion, a Database or an Operating system is chosen with the needs of the application or the system to be designed. It comes as a decision on that has to be compatible with the end application to be designed. The architect who decides on what needs to be used is not a biased person, he/she knows that he has to be committed to his company's core business values and chooses one deciding on it.
So, people going forth I request each of you not to have a discussion or argument to decide which the best is. We all work on the latest technologies of what we have now and should be proud that most of us are redefining technology that has got us in the past.
Again, this is a personal opinion and was written not to hurt anyone. Thanks for taking time to read this blog. Your comments on the same are welcome.
Thursday, October 1, 2009
Back to Blogging
Tuesday, August 18, 2009
Out for Vacation
Thursday, August 13, 2009
Virtual TechDays: FREE Technical Training Opportunity
Microsoft is Offering Free SQL Server and other products Techinical training in India. This is an online event. Please use the link below to register.
Tuesday, August 4, 2009
Chennai SQL Server User Group Meeting
Wednesday, July 1, 2009
Awarded MVP Again
Krishna Gopalan - KG, I wish to be near you to share the joy this moment. I can still hear you saying "Sugesh, I know you are the right person to do this job", whenever I heard that gave me confidence to enrich my skills as a DBA helping me to achieve near expertise.
Stephen Seth, Vidhya Sagar and Deepak - It is with these guys that I grew up enriching my SQL Server skills. Without them, I would still be a DBA not a MVP.
I would like to thank my friends Dalavai Shanmugha Sundaram, Mr&Mrs. Stephen Seth, Mr&Mrs. Arun Kamaraj, Chakravarthi Elangovan and Poornima rangaswamy for being with me during this tough days of personal and professional career.
A special mention of thanks to Rangaswamy and Rani Thilagam Rangaswamy for shouldering my responsibilities in India when I stay in USA.
And my parents and sister, I have no words to thank them. Without thier support and encouragement I would not have got this again.
Wednesday, June 10, 2009
Creating System Objects in SQL Server
sp_MS_marksystemobject 'object_name'
Saturday, May 9, 2009
Tuesday, April 21, 2009
Drive Details using TSQL
Thursday, April 16, 2009
Determine which objects exist in a particular filegroup
Tuesday, April 14, 2009
How to find startup procedures in sql
USE MASTER
GO
SELECT VALUE, VALUE_IN_USE, DESCRIPTION FROM SYS.CONFIGURATIONS WHERE NAME = 'scan for startup procs'GO
Wednesday, April 8, 2009
SQL Server 2008 SP1 released
Drop Indexes in a Database
Tuesday, April 7, 2009
Change Data Capture
Step to Enable and Configure Change Data Capture:
1. Create a database SQL Server 2008
create database CDC_TEST
go
2. Enable CDC in the database created.
USE SQL2008CDC
GO
EXEC sp_cdc_enable_db
GO
You can verify if CDC is enabled using the query below for the database.
select [name] as DBName,is_cdc_enabled from sys.databases where db_name(database_id)=DB_NAME()
3. You will be a new schema CDC and few system tables created under the database. Change Data Capture requires exclusive use of cdc user and schema.
4. Create a table to enable CDC
USE CDC_TEST
GO
CREATE TABLE dbo.CDC_TEST(
ID int Primary Key NOT NULL,
Name nvarchar(100) NOT NULL,
Email nvarchar(100) NOT NULL)
5. SQL Server agent must be started for CDC.
6. Enable CD for the table where you need to capture the change.
EXEC sp_cdc_enable_table 'dbo', 'cdc_test',
@role_name = NULL, @supports_net_changes =1
You can verify if CDC is enabled using the query below for the table.
use SQL2008CDC
go
select [name], is_tracked_by_cdc from sys.tables
7. Once CDC is enabled for a table, you will find a _CT table created by itself.
8. Now we will verify how CDC works by running a insert into the table CDC_TEST.
use SQL2008CDC
go
INSERT INTO dbo.cdc_test
values (1, N'sugeshkumar', N'sugeshkr@gmail.com')
9. Now update the row that we have inserted in the previous step.
use SQL2008CDC
go
update dbo.cdc_test set name='sugesh' where id = 1
10. The before image and after image of the row can be found on the table that was created with the name _CT.
The column _$operation has the value for the DML operation done, 1 is for delete, 2 for insert, 3 for before image, 4 for after image
You have seen how to enable and configure CDC for a database and table. The list below gives you all available Stored Procedures, DMVs, Functions and table list that is used by Change Data Capture.
Stored Procedures
sys.sp_cdc_add_job (Transact-SQL)
sys.sp_cdc_generate_wrapper_function (Transact-SQL)
sys.sp_cdc_change_job (Transact-SQL)
sys.sp_cdc_get_captured_columns (Transact-SQL)
sys.sp_cdc_cleanup_change_table (Transact-SQL)
sys.sp_cdc_get_ddl_history (Transact-SQL)
sys.sp_cdc_disable_db (Transact-SQL)
sys.sp_cdc_help_change_data_capture (Transact-SQL)
sys.sp_cdc_disable_table (Transact-SQL)
sys.sp_cdc_help_jobs (Transact-SQL)
sys.sp_cdc_drop_job (Transact-SQL)
sys.sp_cdc_scan (Transact-SQL)
sys.sp_cdc_enable_db (Transact-SQL)
sys.sp_cdc_start_job (Transact-SQL)
sys.sp_cdc_enable_table (Transact-SQL)
sys.sp_cdc_stop_job (Transact-SQL)
Dynamic Management Views
sys.dm_cdc_log_scan_sessions (Transact-SQL)
sys.dm_cdc_errors (Transact-SQL)
sys.dm_repl_traninfo (Transact-SQL)
Tables
cdc.
Returns one row for each change made to a captured column in the associated source table.
cdc.captured_columns
Returns one row for each column tracked in a capture instance.
cdc.change_tables
Returns one row for each change table in the database.
cdc.ddl_history
Returns one row for each data definition language (DDL) change made to tables that are enabled for change data capture.
cdc.lsn_time_mapping
Returns one row for each transaction having rows in a change table. This table is used to map between log sequence number (LSN) commit values and the time the transaction committed.
cdc.index_columns
Returns one row for each index column associated with a change table.
dbo.cdc_jobs (Transact-SQL)
Returns the configuration parameters for change data capture agent jobs
Functions
cdc.fn_cdc_get_all_changes_
sys.fn_cdc_has_column_changed (Transact-SQL)
cdc.fn_cdc_get_net_changes_
sys.fn_cdc_increment_lsn (Transact-SQL)
sys.fn_cdc_decrement_lsn (Transact-SQL)
sys.fn_cdc_is_bit_set (Transact-SQL)
sys.fn_cdc_get_column_ordinal (Transact-SQL)
sys.fn_cdc_map_lsn_to_time (Transact-SQL)
sys.fn_cdc_get_max_lsn (Transact-SQL)
sys.fn_cdc_map_time_to_lsn (Transact-SQL)
sys.fn_cdc_get_min_lsn (Transact-SQL)
Monday, April 6, 2009
Generate Create Index Scripts for a Database
DECLARE cIX CURSOR FOR
SELECT OBJECT_NAME(SI.Object_ID), SI.Object_ID, SI.Name, SI.Index_ID
FROM Sys.Indexes SI
LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC ON SI.Name = TC.CONSTRAINT_NAME AND OBJECT_NAME(SI.Object_ID) = TC.TABLE_NAME
WHERE TC.CONSTRAINT_NAME IS NULL
AND OBJECTPROPERTY(SI.Object_ID, 'IsUserTable') = 1
ORDER BY OBJECT_NAME(SI.Object_ID), SI.Index_ID
DECLARE @IxTable SYSNAME
DECLARE @IxTableID INT
DECLARE @IxName SYSNAME
DECLARE @IxID INT
-- Loop through all indexes
OPEN cIX
FETCH NEXT FROM cIX INTO @IxTable, @IxTableID, @IxName, @IxID
WHILE (@@FETCH_STATUS = 0)
BEGIN
DECLARE @IXSQL NVARCHAR(4000) SET @IXSQL = ''
SET @IXSQL = 'CREATE '
-- Check if the index is unique
IF (INDEXPROPERTY(@IxTableID, @IxName, 'IsUnique') = 1)
SET @IXSQL = @IXSQL + 'UNIQUE '
-- Check if the index is clustered
IF (INDEXPROPERTY(@IxTableID, @IxName, 'IsClustered') = 1)
SET @IXSQL = @IXSQL + 'CLUSTERED '
SET @IXSQL = @IXSQL + 'INDEX ' + @IxName + ' ON ' + @IxTable + '('
-- Get all columns of the index
DECLARE cIxColumn CURSOR FOR
SELECT SC.Name
FROM Sys.Index_Columns IC
JOIN Sys.Columns SC ON IC.Object_ID = SC.Object_ID AND IC.Column_ID = SC.Column_ID
WHERE IC.Object_ID = @IxTableID AND Index_ID = @IxID
ORDER BY IC.Index_Column_ID
DECLARE @IxColumn SYSNAME
DECLARE @IxFirstColumn BIT SET @IxFirstColumn = 1
-- Loop throug all columns of the index and append them to the CREATE statement
OPEN cIxColumn
FETCH NEXT FROM cIxColumn INTO @IxColumn
WHILE (@@FETCH_STATUS = 0)
BEGIN
IF (@IxFirstColumn = 1)
SET @IxFirstColumn = 0
ELSE
SET @IXSQL = @IXSQL + ', '
SET @IXSQL = @IXSQL + @IxColumn
FETCH NEXT FROM cIxColumn INTO @IxColumn
END
CLOSE cIxColumn
DEALLOCATE cIxColumn
SET @IXSQL = @IXSQL + ')'
-- Print out the CREATE statement for the index
PRINT @IXSQL
FETCH NEXT FROM cIX INTO @IxTable, @IxTableID, @IxName, @IxID
END
CLOSE cIX
DEALLOCATE cIX
-- Get all existing primary keys
DECLARE cPK CURSOR FOR
SELECT TABLE_NAME, CONSTRAINT_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
ORDER BY TABLE_NAME
DECLARE @PkTable SYSNAME
DECLARE @PkName SYSNAME
-- Loop through all the primary keys
OPEN cPK
FETCH NEXT FROM cPK INTO @PkTable, @PkName
WHILE (@@FETCH_STATUS = 0)
BEGIN
DECLARE @PKSQL NVARCHAR(4000) SET @PKSQL = ''
SET @PKSQL = 'ALTER TABLE ' + @PkTable + ' ADD CONSTRAINT ' + @PkName + ' PRIMARY KEY CLUSTERED ('
-- Get all columns for the current primary key
DECLARE cPKColumn CURSOR FOR
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE TABLE_NAME = @PkTable AND CONSTRAINT_NAME = @PkName
ORDER BY ORDINAL_POSITION
OPEN cPKColumn
DECLARE @PkColumn SYSNAME
DECLARE @PkFirstColumn BIT SET @PkFirstColumn = 1
-- Loop through all columns and append the sql statement
FETCH NEXT FROM cPKColumn INTO @PkColumn
WHILE (@@FETCH_STATUS = 0)
BEGIN
IF (@PkFirstColumn = 1)
SET @PkFirstColumn = 0
ELSE
SET @PKSQL = @PKSQL + ', '
SET @PKSQL = @PKSQL + @PkColumn
FETCH NEXT FROM cPKColumn INTO @PkColumn
END
CLOSE cPKColumn
DEALLOCATE cPKColumn
SET @PKSQL = @PKSQL + ')'
-- Print the primary key statement
PRINT @PKSQL
FETCH NEXT FROM cPK INTO @PkTable, @PkName
END
CLOSE cPK
DEALLOCATE cPK
Friday, April 3, 2009
Common SQL Server Security Issues and Solutions
Thursday, April 2, 2009
Show/Hide divs and swap images with SkinID using Javascript
Example 1: To Show only one div at a time.
ASP.Net Code
<div id="divContent">JavaScript Code:
<h2><a href="#" id="lnk1" onclick="return toggle('div1')">What is Test?</a></h2>
<div id="div1" style="display:none">
<p>Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test</p>
<p>Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test</p>
</div>
<h2><a href="#" id="lnk8" onclick="return toggle('div8')">What is Sample?</a></h2>
<div id="div8" style="display:none">
<p>Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample </p>
</div>
</div>
function toggle(divID)
{
var divToShow = document.getElementById(divID);
var divUL = document.getElementById('dvfaq');
var divs = divUL.getElementsByTagName('DIV');
for(var i = 0; i < divs.length; i++)
{
divs[i].style.display = 'none';
if(divToShow.style.display == 'none')
{
divToShow.style.display = 'block';
}
}
return false;
}
Example 2: To Show multiple divs at a time and click to open and close.
ASP.Net Code
<a id="lnk0" href="#" onclick="return toggle('div0', 'lnk0')">
Q: What is Test? <asp:Image ID="imgToggle" SkinID="ArrowClose"
style="display: inline" runat="server" /><asp:Image ID="Image27"
SkinID="ArrowOpen" style="display: none" runat="server" /></a>
<br />
<div id="div0" style="display:none">
<p>A: Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test </p>
</div>
<a id="lnk1" href="#" onclick="return toggle('div1', 'lnk1')">
Q: What is Sample? <asp:Image ID="Image1" SkinID="ArrowClose"
style="display: inline" runat="server" /><asp:Image ID="Image28"
SkinID="ArrowOpen" style="display: none" runat="server" /></a>
<br />
<div id="div1" style="display:none">
<p> Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample Sample Sample Sample
Sample Sample Sample Sample </p>
</div>
JavaScript Code:
function toggle(divID, imgID)
{
var divToShow = document.getElementById(divID);
if(divToShow.style.display == 'none')
{
divToShow.style.display = 'block';
}
else if(divToShow.style.display == 'block')
{
divToShow.style.display = 'none';
}
var imgToShow = document.getElementById(imgID).getElementsByTagName('img')[0];
var imgToHide = document.getElementById(imgID).getElementsByTagName('img')[1];
if(imgToShow.style.display == 'none')
{
imgToShow.style.display = 'inline';
imgToHide.style.display = 'none';
}
else if(imgToShow.style.display == 'inline')
{
imgToShow.style.display = 'none';
imgToHide.style.display = 'inline';
}
return false;
}
Skin Code:
<asp:Image runat="server" SkinID="ArrowClose" ImageUrl="images/arrowClose.gif"
width="9" height="9" />
<asp:Image runat="server" SkinID="ArrowOpen" ImageUrl="images/arrowOpen.gif"
width="9" height="9" />
