Click here to monitor SSC
SQLServerCentral is supported by Redgate
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: 3043 | Views in the last 30 days: 3
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? ...