-
SQL Update if Record Exists or Insert
Quite often we need an approach where we need to Insert record if it is not already present. Sometime to manage relationship. There are few different way of doing it, like “If Exists”, or “Insert on Duplicate Key” (mysql) but the best I found is one from MSDN Blog Entry ( http://blogs.msdn.com/b/miah/archive/2008/02/17/sql-if-exists-update-else-insert.aspx) The approach is…
-
Advance SQL: Finding Hierarchical data using Recursive CTE
Often we have a Table that store Hierarchical data, such as any shopping cart will have product category in table that store parent table within same table. We often use such information. The typical structure of table is ID, Name , ParentID Where ParentID is ID within same table or for Top level it is…
-
Database Optimization
Well, most of program use database for their web application. Eventually all web application does have database. But how many of those web application really works good. Well quite few. I am in web programming for more than 7 years now and during these years I have seen lot of developers building website using PHP…
-
Case Sensitive Search in SQL Server
Mysql mostly provide a Case sensitive search because of its default collate configuration. However SQL server use different collate and hence by default it is not case sensitive. It is good to not having case sensitive search by default, as except password compare you most often doesn’t need case sensitive search. Do you? well I…
-
SQLite Bulk Insert on ADO.NET
Today, I was trying to find an alternative on reading a Binary data file to use information in my software. For this I choose to use SQlite the embedded database. It has quite a few steps before I achieve a acceptable speed with database and here is list of those that need to be taken…
-
Reseed Auto Increment Value in SQL Server
You can reseed the Auto increment field to desire number by using following SQL statement [I think it is specific for SQL Server only] other Database have their own methods. DBCC CHECKIDENT (<TableName>, RESEED, 0) Works great for me on Sql Server 2008
-
MySQL WorkBench : New GUI
I was looking at MySQL.com and found a new GUI, which came as replacement of old MYSQL administrative GUI. My impression was not good to learn that they have something new, as I thought it might be just that they get their old interface opensourced or something. But when I install this application, hmm ..…