Viewing 15 posts - 3,826 through 3,840 (of 4,820 total)
ISNULL needs to be part of the SELECT, not the PIVOT.
Modified code:
CREATE TABLE Sales (EmpId INT, Yr INT, Sales MONEY)
INSERT Sales VALUES(1, 2005, 12000)
INSERT Sales VALUES(1, 2006, 18000)
INSERT Sales VALUES(1,...
August 13, 2014 at 8:08 am
julie.breetzke (8/13/2014)
Must i not use a trigger or must i just use a different trigger?
How would i incorporate the code above into...
August 13, 2014 at 7:54 am
Don't get too attached to the idea. It's more of a quick fix, and could be problematic in terms of applying it to a larger set of data,...
August 12, 2014 at 12:52 pm
Just uploading the execution plan so you can see what you might be in for. The estimates aren't very good on number of executions, so the potential for...
August 12, 2014 at 12:46 pm
Okay... Now we have something better to work with. The query below includes your original example code, but modifies the table to have a clustered index based...
August 12, 2014 at 12:20 pm
Somebody correct me if I'm wrong, but I'm pretty sure CDC is for SQL Server as opposed to any kind of ODBC data source. You'd probably have to...
August 12, 2014 at 12:11 pm
I have a working solution, but before I present it, you need to know that what you're asking for looks like a homework assignment rather than a real-world business problem....
August 12, 2014 at 11:46 am
Okay, now I'm wondering what, exactly, you're doing. Apparently, it's not anywhere near as simple as your original post suggested. If you can post a...
August 12, 2014 at 9:46 am
Let's first clarify the objective. Your post says you have 5,000 records, but you have to loop through it 5 times to get 1,000 records in each of...
August 12, 2014 at 8:31 am
Um... that's not actually an option. Don't get me started on the why...
August 8, 2014 at 10:31 am
Jeff,
I'm not sure we're dealing with some kind of SQL script - either for when they copy production down to a lesser environment (DEV, TEST, etc.), or for a conversion...
August 8, 2014 at 9:34 am
If you cancel a query in SSMS, then the entire query's actions get rolled back, although I don't know what would happen if there were separate batches within what was...
August 8, 2014 at 8:51 am
tstagliano (8/8/2014)
August 8, 2014 at 8:42 am
Gail Shaw? Jeff Moden? Anyone?
August 8, 2014 at 8:37 am
Vantigate (7/31/2014)
You probably want to select the option "Run immediately" instead of "Save...
July 31, 2014 at 4:30 pm
Viewing 15 posts - 3,826 through 3,840 (of 4,820 total)