February 2, 2015 at 11:16 am
I was joining two tables on PersonFullname column when found that one tables has PersonFullname as Roger, Sharon whereas the other has Sharon Roger
How can I swap one and Join the tables.
February 2, 2015 at 11:55 am
sharonsql2013 (2/2/2015)
I was joining two tables on PersonFullname column when found that one tables has PersonFullname as Roger, Sharon whereas the other has Sharon RogerHow can I swap one and Join the tables.
If a comma is present, split on the comma and re-concatenate the parts with the understanding that the query will not be SARGable. If you have a lot of data like this, you might want to add a persisted computed column to the "comma" table that does the switch so that queries can be SARGable.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 2, 2015 at 5:37 pm
Post deleted because I realized Jeff suggested the same thing (a COMPUTED PERSISTED column).
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply