Viewing 15 posts - 3,541 through 3,555 (of 4,085 total)
I was able to get it to work with the following:
SELECT @Text = Replace(@Text COLLATE LATIN1_GENERAL_BIN, Symbol, HTML)
FROM @Symbols
WHERE PatIndex('%' + Symbol + '%', @Text) > 0
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 18, 2011 at 2:44 pm
toddasd (10/18/2011)
OP, if you want the extra non-matches to not show, thrown a WHERE n.Name IS NOT NULL
AND s.Code IS NOT NULL; to the end...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 18, 2011 at 12:48 pm
This is actually much simpler than it seems, because SELECT is implemented behind the scenes as a loop. Jeff Moden refers to this as a pseudo-cursor. You can...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 18, 2011 at 12:34 pm
This is actually quite easy. You need to order each of the tables separately and then join the two tables both on the segmentID and the order. I...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 18, 2011 at 11:33 am
irobertson (10/18/2011)
So, I still don't beat the case statement. But I had fun, so that's all that matters 🙂
Actually, the CASE version isn't even completely optimized. It's doing a...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 18, 2011 at 10:16 am
You have two options. Which one works best will depend on a number of factors such as what indexes you have/create and how selective those indexes are.
Option 1: CTE...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 18, 2011 at 9:35 am
Jeff Moden has a very good article on exactly this type of problem.
Solving the Running Total and Ordinal Rank Problems (Rewritten)[/url]
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 18, 2011 at 8:15 am
DELETEs are fully logged, and you're trying to delete 10 million rows IN ONE TRANSACTION. You need to break this up into more manageable pieces. You can use...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 18, 2011 at 7:13 am
The most efficient way to do this is to use the correct tool for the job. That tool is a reporting tool (such as SSRS). T-SQL is most...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 17, 2011 at 2:39 pm
This is a presentation issue, and is best done in the presentation layer. You don't mention what you are using for your presentation layer, so we can't give you...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 17, 2011 at 9:14 am
vick12 (10/13/2011)
create stored procedure testsorting
( @sort varchar(60)
)
as
BEGIN
SELECT...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 14, 2011 at 9:16 am
Lynn Pettis (10/13/2011)
Post your code? You may find this solution works better. Always worth investigating.
I didn't save the code.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 13, 2011 at 11:32 am
Junglee_George (10/13/2011)
Which one of the following is preferred considering the performance of the SQL query executed..??
Actually, neither one is preferred. The first one is worst--as has already been mentioned--because...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 13, 2011 at 8:09 am
You have to be careful with the joins, if either of the tables has a one-to-many relationship. You could potentially be double-counting some of the records I would use...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 12, 2011 at 8:41 am
memostone86 (10/11/2011)
Thank you so much Toddasd, it works great
Actually, it doesn't work correctly. It assumes that there is only one change in the power status for each VM in...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 11, 2011 at 2:52 pm
Viewing 15 posts - 3,541 through 3,555 (of 4,085 total)