Viewing 15 posts - 3,271 through 3,285 (of 8,731 total)
No need for a performance problem caused by a scalar udf. There's a simple formula explained in the following article that can help you simplify your code.
http://www.sqlservercentral.com/articles/ISNUMERIC()/71512/
SELECT
...
February 25, 2016 at 12:27 pm
Using the OVER clause and the REPLICATE function, you could achieve this.
SELECT WarehouseNumber,
ItemDescription,
Quantity = REPLICATE('?', COUNT(*) OVER( PARTITION BY WarehouseNumber,...
February 25, 2016 at 12:18 pm
Are you merging or you're just updating? If you're just updating, use UPDATE.
Here are some general examples:
UPDATE t
SET value = s.value
FROM TargetTable t
JOIN SourceTable s ON t.id = s.id
...
February 25, 2016 at 12:08 pm
ThomasRushton (2/25/2016)
Phil Parkin (2/25/2016)
Luis Cazares (2/25/2016)
Is it too early for these answers? http://www.sqlservercentral.com/Forums/Topic1764225-3411-1.aspxNot at all.
At least you didn't go with LMGTFY, or JFGI...
That would have implied additional work.
February 25, 2016 at 9:31 am
Maybe something like this?
select rcp.CalendarPeriodId
,rc.CalendarId
,rcp.CalendarYearId
,rcp.PeriodNumber
...
February 25, 2016 at 9:09 am
sys.user (2/25/2016)
Luis Cazares (2/25/2016)
If your problem is that you have too many columns in the GROUP BY clause, you could use a different approach.
I used a CTE...
February 25, 2016 at 8:47 am
Dodgier according to who?
If your problem is that you have too many columns in the GROUP BY clause, you could use a different approach.
WITH cteCrsSub AS(
SELECT...
February 25, 2016 at 8:26 am
Maybe something like this:
SELECT String,
SUBSTRING( String, CHARINDEX('yesterday', String), CHARINDEX('tomorrow', String) - CHARINDEX('yesterday', String) + 8 /*LEN('tomorrow')*/)
FROM(VALUES('Learn from yesterday, live for today, hope for tomorrow. The...
February 25, 2016 at 8:17 am
Is it too early for these answers? http://www.sqlservercentral.com/Forums/Topic1764225-3411-1.aspx
February 25, 2016 at 7:39 am
Lynn Pettis (2/24/2016)
Luis Cazares (2/24/2016)
Lynn Pettis (2/24/2016)
How about this?
The set-based loop might be faster. The example shown in the article is basically the same as this one and the improvement...
February 24, 2016 at 1:46 pm
crookj (2/24/2016)
HappyGeek (2/24/2016)
Ed Wagner (2/24/2016)
ChampionsQueen!!
Dust (another one bites the...)
Bohemian (Rhapsody)
February 24, 2016 at 11:30 am
rodjkidd (2/24/2016)
Grumpy DBA (2/24/2016)
jasona.work (2/24/2016)
/Me leans back, grabs bucket of popcorn
Sure sounds like Gail answered the original question, yet for some reason the OP decided to focus on the comments...
February 24, 2016 at 11:01 am
Lynn Pettis (2/24/2016)
How about this?
The set-based loop might be faster. The example shown in the article is basically the same as this one and the improvement was noticeable.
February 24, 2016 at 10:35 am
If there's a PASS user group near you, you could start there. It doesn't need to be from PASS, but it would be the obvious choice.
For general public speaking,...
February 24, 2016 at 8:25 am
Viewing 15 posts - 3,271 through 3,285 (of 8,731 total)