Sunday, April 10, 2016

Difference between Oracle SQL Query vs Microsoft SQL Server 2008 or Sybase

Oracle and Microsoft SQL Server are two of the most popular database but they are very different from each other and if you are migrating SQL queries or databases, tables from Oracle 11g database to Microsoft SQL Server 2008 then you are bound to face some issues. The main reason of these porting issues are features that are supported and exists in the Oracle database, but not available in Microsoft SQL Server 2008 like SEQUENCE, Order by clause in subqueries, and derived tables, derived table without a name, etc. I am sure there are few more and it will surface based upon different database objects you are using in your tables and queries.

What is purpose of different HTTP Request Types in RESTful Web Service?

RESTful web services heavily rely on HTTP by design. They use different HTTP methods to perform their job and uses an HTTP response code to inform clients about the success or failure of a particular request. REST stands for Representational State transfer and it uses HTTP to allow two systems to communicate via remote calls. RESTFul web services are a collection of REST URI which points to resources. These URI can point to a single resource of a collection of resources. For example, you would expect /employee/101 to contain details employee with 101 and /employees to return a list of all employees. In the RESTFul web service, HTTP request types signify the action to take for the resource.

Sunday, April 3, 2016

How to Convert Result of SELECT Command to Comma Separated String in SQL Server

Sometimes, you need the result of the SQL SELECT clause as a comma-separated String e.g. if you are outputting ids of white-listed products. By default, the SELECT command will print each row in one line and you get a column of names or ids. If you need a comma-separated String then you probably need to use a text editor like Notepad++, Edit Plus, or a tool like Microsoft Excel to convert that column of values into a big CSV String. I often use a text editor like edit plus to replace the \n to comma (,) to create such CSV string because it supports regular expression-based find and replaces operation.