I'm still a bit new to MS SQL and was wondering if there was a better way to do what I want.

If the user supplies a location the LocID with be > 0 and I want to select the data where emp.LOCATION_ID = @LocID. If the LocID = 0 then I don't want to include that in the where clause.

I wrote something that works but seems like there should be an easier way to do this.

Any comments or suggestions are welcome....