Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

JOIN technique

By Luigi Marinescu,

I have next tables: Sales, Products, Brands
I want to display all sales for products belonging to a list of brands (Ids) ' ',2,3,5,6,' OR ALL Brands (if this list is empty)


Execution sample
exec dbo.sp_JoinTechnique ',2,3,5,6,'


So, I've tested on my data and works better than the regular way (maybe because of the indexes) but I want to know your opinions too.




Total article views: 3027 | Views in the last 30 days: 4
Related Articles

Brand <> Reputation?

I was reading a book recently and it equated brand with reputation. My first thought was "aha", that...


Building Your Brand at Work?

This Friday's poll asks how much you can help yourself while working at your job? Can you build your...


Un-SQL Friday: Branding?

Following in Midnight DBA’s more interesting half new blog fest topic. My branding? I don’t have a ...


Building YOUR Brand - Part 2

Yesterday I posted Building YOUR Brand that described a formula for becoming rich and famous. Well, ...


Branding, my ass! (Un-SQL Friday 001)

Here is my contribution to my blog party, Un-SQL Friday 001: Branding.  Join in the fun, won’t you? ...


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones