Development

SQL Server – Various methods to generate unique number sequence

Hi all, Friends, most of the time we used ranking function like ROW_NUMBER() when it required to generate unique number sequence. But there also other ways to accomplish the same thing without using ranking function. I will tell you 3 various ways to generate the unique number sequence including ranking function. Let’s create a demo… Continue reading SQL Server – Various methods to generate unique number sequence

Development

SQL Server – Methods to find running totals of a column

HI friends, in some working scenario or during interviews we got the task to find the running totals of a column. In this blog I have listed few methods which may help you in determining running totals: Let’s first create a test table and insert some data into it. Create table #t1 (ID int) GO… Continue reading SQL Server – Methods to find running totals of a column

Development

SQL Server – Using Window ranking function with UPDATE statement

Hi friends, I was working on a scenario in which I need to assign a unique values to a column. I was trying to update the column using window ranking function ROW_NUMBER() but I got error that ‘Windowed function can only appear in SELECT or ORDER BY clause’. Then I do some workaround and used… Continue reading SQL Server – Using Window ranking function with UPDATE statement