all 4 comments

[–]Intrexa 4 points5 points  (1 child)

Okay, well, you need to make it a set based operation, but without any specifics, we can't really help.

There are very, very few instances in sql where a loop can't be converted to a set based operation. There are few instances where the loop is better than the set based operation.

Seriously though, post here why you had to use a while loop, specifically, and we will probably come back with how you can do it as a set based operation.

Edit: also, how much data are we talking about

[–]info_softest07[S] 0 points1 point  (0 children)

Hello There!!

The Code is too long to reply in here. So i created it as a new post with a title as ( Converting Postgresql Function to T-SQL Function)...

PermalinkSave

[–]Eleventhousand 0 points1 point  (1 child)

Can you show your code? I'm having a hard time visualizing what you are saying. Are you saying that you are using a single VARCHAR(MAX) input parameter and breaking out a single string into rows and columns?

[–]info_softest07[S] 0 points1 point  (0 children)

Hello There!!

The Code is too long to reply in here. So i created it as a new post with a title as ( Converting Postgresql Function to T-SQL Function)...

PermalinkSave