Friday, August 14, 2015

Sitecore - Moving items from web to master

In most of the cases, generally you create items in master database and publish to web/production data. However, sometimes few items are in web database and not in master. Reason can be anything, like you might have deleted it in master but did not publish the parent item or due to some other reason.

If you are thinking, you will create package from web and deploy it in master, that will not work. :-) When you create package from master, it installs the items in master only and same is the case with web.

Right and easy way to do is Transfer the item. Yes, you read it right. There is a provision in Sitecore to transfer the items from one database to another.

Select the item which you want to transfer from one database to another. Right click on it and then select Copying. Click on Transfer. see screenshot



Once you click on Transfer, it opens up a popup box. Click 'Next'. see screenshot


After clicking on next, you have to choose the database where you would like to transfer the item. In this case,master database is selected. see screenshot

Select the folder where you want to transfer the item on master database(in this case). Click 'Next' and it will transfer the item to master database.

If you like the blog, kindly put your comments. You can write email to support@bajajsumit.com for any Sitecore or .Net related help.

Wednesday, April 15, 2015

Delete duplicate records from table in single statement (SQL Server)

Deleting duplicate records is very common requirement therefore multiple options are available to delete duplicate records. However this article provides the solution to delete the duplicate records using single statement.

Delete from <TABLE_NAME> where <ID> not in ( select max(<ID>) from TABLE_NAME> group by <DUPLICATE_COLUMN>)



For example:

Employee table
EmpId
EmpFullName
EmpSalary
EmpTitle
1
Sumit Bajaj
5000
Dev
2
Amit
10000
SDev
3
Sumit Bajaj
5000
Dev
4
Priyanka
50000
Mgr
5
Umesh
10000
SDev
6
Umesh
10000
SDev
7
Amit
10000
SDev
8
Geetika
5000
Dev

where few records are duplicate and need to be removed.

For this table, delete query would be 

Delete from Employee where EmpId not in (select max(EmpId) from Employee group by EmpFullName)

After executing this query you will left with only unique records as shown below.

EmpId
EmpFullName
EmpSalary
EmpTitle
3
Sumit Bajaj
5000
Dev
4
Priyanka
50000
Mgr
6
Umesh
10000
SDev
7
Amit
10000
SDev
8
Geetika
5000
Dev

Thanks for reading and hope this article helped.


Friday, March 13, 2015

Oracle SQL Developer Installation


After spending enough time on installing Oracle SQL Developer and respective issues, I thought of writing few easy steps to install it. Hope it would help and save your time.

Steps to install Oracle SQL Developer(for windows):
  1. Download SQL Developer from Oracle site. Download
  2. Download JDK if it is not installed on your machine. Download
  3. Install JDK and then unzip SQL Developer
  4. Click on sqldeveloper.exe, it will ask for java.exe path
  5. Open the path where JDK is installed. It would be something like "C:\Program Files\Java\jdk1.7.0_40\jre\bin" depeneding upon which version you install.
  6. If it is giving any exception, remove the entry [SetJavaHome] from sqldeveolper.conf file from "..\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf" and give the correct path of java.exe file.
Please provide your feedback if you like the post.

Monday, February 2, 2015

Excess of technology ruins

Most of us are using so many apps on mobile and spending plenty of time using those apps. Well, even I am not exception but excess of technology sometime ruins. I would like to narrate one incident where I used Google Maps and screamed after using it.

I visited Dehradun, Uttrakhund from Gurgaon recently and chose Google Maps to show me the route. It showed me two ways and advised me to go via shortest route which I followed. After reaching half way, I found that road was damaged so badly that I was not able to proceed. After collecting information from villagers nearby, I got to know that this path was always like that. One of the villagers advised me not to go further on that path as for cars its not possible to cross. He advised me to take alternate route which was going through the villages. Thanks to Indian people who are so kind and helpful.

Although that road was raw and some patches were there yet it was better then the path Google Maps proposed. By somehow, I could reach Dehradun crossing so many villages. Generally it takes 5 hours to reach Dehradun but that day it took 9.5 hours to reach to destination. I conveyed my thanks to GOD and villagers who helped me to reach there.

To conclude, I am in complete agreement that using technology to some extent surely helps but using it in excess ruins.

This is what I have written to Google:

 " I have used Google Maps (India) to get the way to Dehradun, Uttrakhund from Gurgaon. It showed me 2 ways and    advised me to go from shortest path which I followed. After going half way I found that the road is so damaged that I can  not proceed.

 So I would like to suggest that if Google could provide feedback popup for that route where a person can give some  rating or comments would be really great. It would help you to choose the best way to go."


Share you incidence and help people to make life better.