Viewing 15 posts - 6,826 through 6,840 (of 8,731 total)
You seem to have a CROSS TABS or PIVOT problem that you're trying to solve using a CURSOR :sick: .
Reviewing your code, you're adding an integer to a varchar...
February 24, 2014 at 9:18 am
You can't chage that code to make it set based. You need to change the code from usp_make_record to accept several rows at a time.
February 24, 2014 at 8:55 am
DaveDB (2/24/2014)
1) How to handle slow moving database, (when your boss comes over to your desk and asks you to find out why production is moving slowly).
Catch it before it...
February 24, 2014 at 8:52 am
You might want to take a look at the OVER Clause.
February 21, 2014 at 1:50 pm
Here's an option that you could use. Be sure to understand what it does before implementing it. If you have any questions, feel free to ask.
SELECT e1.RISK_FACTOR,
CASE WHEN RISK_FACTOR =...
February 21, 2014 at 11:03 am
sqldriver (2/21/2014)
Luis Cazares (2/19/2014)
sql2k8 (2/19/2014)
February 21, 2014 at 10:09 am
That is usually solved like this:
WITH CTE AS(
SELECT id, id - ROW_NUMBER() OVER (ORDER BY id) grouper
FROM #test1
)
SELECT MIN(id) min_id, MAX(id) max_id
FROM CTE
GROUP BY grouper
ORDER BY min_id
I just noticed that...
February 21, 2014 at 8:54 am
To be fair, (s)he might be in a different time zone.
February 21, 2014 at 8:53 am
You're welcome.
Do you understand how and why it works?
I also missed the link in my previous post. Here it is: How to Make Scalar UDFs Run Faster (SQL Spackle)[/url]
February 21, 2014 at 8:25 am
Duplicate post answered in here: http://www.sqlservercentral.com/Forums/Topic1543925-391-1.aspx
February 21, 2014 at 8:09 am
Here are a couple of options that you could try.
SELECT t.id,
t.[FILE_NAME],
CASE WHEN NOT EXISTS( SELECT 1 FROM test1 x WHERE t.id = x.id + 1)
THEN 'D' ELSE 'F'...
February 21, 2014 at 8:07 am
It's great to read all that. If you need more help, don't hesitate on coming back. We're here to help and hopefully you'll end up helping once you get used...
February 20, 2014 at 10:03 pm
jshahan (2/20/2014)
February 20, 2014 at 2:12 pm
MyDoggieJessie (2/20/2014)
Very creative Luis, kudos!
Thank you! It became clear after realizing it wasn't a running total.
February 20, 2014 at 2:02 pm
Viewing 15 posts - 6,826 through 6,840 (of 8,731 total)