Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

where user_master.User_id in (select data from split(@user_id,',')) runs slow

$
0
0

Dear All.

I have a report where i have a selection of users for employees (multiple selection)

now in my store procedure i am using a split tvf which accepts CSV string of user_ids like '1,2,3' from report and delimeter character

now i am doing like 

where user_id (int col) in (select data from split(@USer_id,','))  -- suppose passing 112 only 

it runs slow and takes more than a minute

where user_id = 112  runs in seconds ..

is there any better way to do this ..


Dilip Patil..


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>