StatisticsTotal Posts: 34 This Year: 0 This Month: 0 This Week: 0 Comments: 174
Admin
Sign In
Navigation
Recent Posts
On this page....
Archives
Full Archives By Category
2007 Calendar View
| November, 2009 (1) |
| August, 2009 (1) |
| July, 2009 (1) |
| June, 2009 (1) |
| May, 2009 (2) |
| April, 2009 (1) |
| March, 2009 (2) |
| February, 2009 (5) |
| January, 2009 (6) |
| December, 2008 (12) |
| November, 2008 (2) |
| | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|
| 28 | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 10 | 11 | 12 | 13 | | 14 | 15 | 16 | 17 | 18 | 19 | 20 | | 21 | 22 | 23 | 24 | 25 | 26 | 27 | | 28 | 29 | 30 | 31 | 1 | 2 | 3 | | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
Categories
CDOSYS (1) Classic ASP (10) Command Line (2) Databases (16) Excel (1) HTML (1) IIS (10) Indexing Service (1) Internet Explorer (7) Media Streaming (1) MS.Net (2) SQA (7) SQL Server (16) Windows OS (2)
Blogroll - Fav Blogs
Acknowledgments
DasBlog Theme Design by: Tom Watts
E-mail:
Theme Image by: dreamLogic
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
|
Technology Blog
 Friday, November 13, 2009
This article is specific to MS SQL Server. There can be various need based scenarios where the data returned by the SELECT statement should be limited to certain length for the columns of data type VARCHAR(MAX), NVARCHAR(MAX), VARBINARY(MAX), TEXT, NTEXT, and IMAGE data types. This can be achieved using SUBSTRING or LEFT functions for specific columns in SELECT statement. But if you have a SELECT statement having many columns of the data types specified before and you want to apply data returned length limitation for each column, the better option would be to use TEXTSIZE command.
 Sunday, August 16, 2009
When we talk about swapping of data between two columns of a table in SQL Server, most of us think of writing SQL scripts in Stored Procedure to achieve it. Well, is it really required? Can a one line statement be written to swap data between two columns in a table? The answer is yes. In this article I cover a simple technique to swap data between two columns of a table.
 Saturday, June 13, 2009
This is in continuation to my previous post on SQL Server Tips.
 Saturday, May 16, 2009
This is in continuation to my previous post on SQL Server Tips. Use table variables instead of temporary tables. Include SET NOCOUNT ON statement into your stored procedures to stop the message indicating the number of rows affected by a T-SQL statement.
 Sunday, March 08, 2009
There are many occasions where a SQL Server Developer uses scripts which take longer to execute. I would rather say a wrong choice or approach in writing scripts caused the execution of the script longer. There are smarter ways to achieve results. In this post I will try to consolidate few tips on smarter SQL Server programming.
 Monday, March 02, 2009
We all have created Stored Procedures in SQL Server. We keep doing regular updates on the applications using SQL Server database. The real problem comes when the application need to be made live and the database stored procedure is required to be synced with the live server. Unless there is no track of change monitored, it would be difficult while deploying the updates and upgrades in SQL SPs on to the live server. Now the question is more clear... Can I find the last modified date for a stored procedure in SQL Server?
 Friday, February 13, 2009
This post is in continuation to my previous post on “Converting Row Data as Comma Separated String”, which is to demonstrate exactly the opposite process “Converting a Comma Separated String Having IDs to Row Result”.
 Thursday, February 12, 2009
You know how many fields are there in the table. You know the size of each field in the table. You know how many records are there in a table. But do you really know the size of a table? How much space is that table really taking?
 Friday, February 06, 2009
SQL Server 2005 has lots of new features, of which one is PIVOT clause. This is similar to Pivot tables in MS Excel and Matrix Control in Reporting Service. Here is a simple example demonstrating how to use PIVOT clause. I am right now taking a simple example. There are scenarios where there could be a need to write a big stored procedure to build a Pivot table in lower versions of SQL Server.
 Friday, January 02, 2009
No doubt that a DTS or SSIS package can be used to export SQL Server table data to a text file. The below article is to demonstrate another way to export SQL Server table data to a text file using xp_cmdshell extended stored procedure (This is with reference to SQL Server 2005 and above).
 Tuesday, December 30, 2008
The SQL Server was installed with “Windows Only” log-on mode. We have logged-in as admin and try to change the log-on mode using server registration property to Mixed Mode (SQL Server and Windows). When we apply the setting and revisit the registration property, the change is not applied. How do we change the logon mode to Mixed mode?
 Saturday, December 20, 2008
One of my office mate Ranjan did some research on internet and found a simple and quick solution to have row data as comma separated string.
 Friday, December 19, 2008
IN SQL Server, it is easy to select one random record or a sequence of random records from a database table. For example if you have requirement to pick a single quiz winner randomly from the database table or you are making an online test application and need to pick X number of questions randomly from the database table; you can certainly use the below SQL queries…
 Wednesday, December 17, 2008
IN SQL Server 2000 and 2005, while creating a table it is possible to create as many number of columns with VARCHAR data type of size 8000. If you are using Query analyzer, you may notice a warning message reading… “Table has been created but its maximum row size (NumberofBytes) exceeds the maximum number of bytes per row (8060).”
 Monday, December 15, 2008
This is a general problem faced by a maintenance team. While importing/exporting data to/from/between databases, the PK is removed accidentally and the table now has lots of duplicate records. The big question for the support staff is how to clean the database? It's simple...
 Wednesday, December 10, 2008
The database backup is taken from the development environment and the BAK file is restored on the production server. On restoring the database from the BAK file, the database users with DB Owner rights are also restored along with the database. But checking the security >> user list in SQL server does not display these users. The SQL server does not allow deleting the users from the database manually as they own objects in the DB. SQL Server does not allow creating the DB user and assign DB Owner rights for the user to the restored DB.
|