Viewing 15 posts - 24,316 through 24,330 (of 59,102 total)
Chris Cross (2/21/2014)
The request was very similar, a full list...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 21, 2014 at 8:46 am
I have to get ready for work but let me throw a couple of things your way.
The code found all of the problems and now is a matter of interpretation...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 21, 2014 at 8:09 am
Here's a classic example of an "Employee" organizational chart table. It has the self referencing FK that I'm talking about where the "ManagerID" must be found as an "EmployeeID"...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 20, 2014 at 9:05 pm
Ok... Here's your table with some modified data to make a couple of points.
-- DROP TABLE dbo.eqmas
go
CREATE TABLE dbo.eqmas
(eq_nmr VARCHAR(20),...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 20, 2014 at 8:38 pm
Sean Lange (2/20/2014)
Jeff Moden (2/20/2014)
Cast the final ouput as MONEY to get the leading zero.If that works then ...
Oh ye of little faith. 😛
SELECT TOP 10000
...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 20, 2014 at 6:27 pm
Dieselbf2 (2/20/2014)
hunchback (2/20/2014)
Here is an example without taking into consideration user types.
SELECT
t.name AS tn,
sc.*
FROM
sys.tables AS t
INNER JOIN
sys.columns AS sc
ON sc.object_id = t.object_id
INNER...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 20, 2014 at 12:57 pm
cms9651 (2/20/2014)
SELECT
case when ([ENER1] + [ENER2]) / 1000000 > 1 then
cast(Cast(Round(( [ENER1] + [ENER2] ) / 1000000, 2) AS NUMERIC(9, 2)) AS VARCHAR(10))
else
'0' + cast(Cast(Round(( [ENER1] +...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 20, 2014 at 12:20 pm
nonghead-webspam (2/19/2014)
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2014 at 10:08 pm
blasto_max (2/19/2014)
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2014 at 9:50 pm
In many cases, people who have these types of Pivots also eventually want a "Total" column. The ancient "Black Art" of CROSSTABs easily allows for such a thing.
SELECT...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2014 at 9:39 pm
Cees Cappelle-442904 (2/19/2014)
I'll look into the FK thingie. Would be nice if you could point me in the right direction to modify my sp to CTE instead of cursors.
Apologies for...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2014 at 8:53 pm
SQLRNNR (2/19/2014)
Yay - I'm finally insane!!! :hehe::w00t:
Very cool! Congratulations!
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2014 at 8:45 pm
SQLRNNR (2/18/2014)
Jeff Moden (2/18/2014)
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2014 at 10:11 pm
Lempster (2/18/2014)
Quirky Update?
That would be the ticket. It may take more than one pass but it would be nasty fast (heh... I'm a poet and don't know it).
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2014 at 10:04 pm
It's not really a stumper the way I did it. According to the groupings, the correct answer displays. The problem is that's not the answer that you're expecting.
Shifting...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2014 at 9:58 pm
Viewing 15 posts - 24,316 through 24,330 (of 59,102 total)