Viewing 15 posts - 91 through 105 (of 8,731 total)
So much code for a simple pivot.
--Create sample data
CREATE TABLE #Table
(
City VARCHAR(50)
)
INSERT INTO #Table (City)
VALUES ('A'), ('B'), ('C'), ('D'), ('E'), ('F'), ('G'), ('H');
--Solution starts here....
October 10, 2019 at 1:42 pm
Here's an article addressing your problem when using AddWithValue.
https://blogs.msmvps.com/jcoehoorn/blog/2014/05/12/can-we-stop-using-addwithvalue-already/
October 9, 2019 at 6:16 pm
Now I see the problem and the reason behind the image that I can see now.
Here's the image of the example.
October 9, 2019 at 5:14 pm
Is there something special I need to do to be able to save some Hebrew text in my table? I have the column set as nvarchar(max) yet when i...
October 9, 2019 at 5:07 pm
As mentioned by Drew, NULLIF
can work, but I'd suggest to go further and use TRY_CONVERT
this will return NULL on all invalid dates instead of generating errors. If servicedatekey...
October 9, 2019 at 3:29 pm
@luis Cazares thanks! There was a third table 'Billing' though. I have tried to follow the same logic to include that in your code, but it is displaying more...
October 8, 2019 at 7:24 pm
You're throwing 500 rows of code into a forum without understanding where's the problem and expect people to solve it without giving sample data, execution plans or data definitions? You...
October 8, 2019 at 5:48 pm
Hello keneangbu,
My first piece of advice would be remove the cursor. Cursors are inherently slow. In your sample piece of code, I do not see a nice way to...
October 8, 2019 at 12:29 pm
For starters, you can optimize your query by reducing the number of calls to your Visits table. It could be done like this:
SELECT DISTINCT userr_id
FROM Approvals...
October 7, 2019 at 9:32 pm
Slow and steady-ish, I'm getting to the top of my division, and hoping to stay there at least one more week considering John's record.
October 7, 2019 at 2:45 pm
Isn’t it a kinda shame to have such queries exposed on a specialised site of SQL Server professionals?
Could we form a group of volunteers who could fix...
October 4, 2019 at 12:55 pm
Realise that the site is disliked by many (I agree that the community isn't as robust as it is here, or as well knit with many of you having ...
October 2, 2019 at 6:11 pm
Last week was dominated by the Mexicans in the league. I hope that it continues like that.
Don't worry, at least the steelers have a chance to win this week.
September 26, 2019 at 7:12 pm
Oh for crying out loud!!! None of my RBs or WRs even bothered showing up yesterday!!! (And the one who did was on my bench!) @#$%^&*!!!!!!!!!!!!
So it's going to...
September 23, 2019 at 2:43 pm
For your question about not the comment on not helping with performance, it's because EXISTS doesn't evaluate the columns from the subquery. An interesting way to test this is by...
September 18, 2019 at 5:18 pm
Viewing 15 posts - 91 through 105 (of 8,731 total)