Viewing 15 posts - 691 through 705 (of 3,480 total)
Read that maybe 20 times before I understood. LOL Let me see if I have this right... If this were a "normal" table of component parts...
CREATE TABLE Component(ComponentID INT IDENTITY...
June 10, 2020 at 12:17 am
If you have a Calendar table that's similar to one you would use for a Date dimension in DAX/SSAS Tabular, you could just specify the start and end dates of...
June 8, 2020 at 8:59 pm
progress! I created a Table-valued function to do the BOM stuff, then used CROSS APPLY to join it to OrderDetails, and it worked. (It's an approximation of a Work Order...
June 4, 2020 at 3:16 pm
Same as mine, except I put the column names at the beginning.
Glad you sorted it out. I didn't want to just give you the answer, because then you wouldn't learn...
June 3, 2020 at 2:47 pm
Oops, yes, I did miss it. This is what I used. (Funny I would get the answer right and then miss copying it... the easy part!)
SELECT AllergyName
,LowStart...
June 3, 2020 at 2:54 am
This is how I did it...
SELECT AllergyName
,LowStart = MAX(CASE WHEN ScaleValue = 'Low' THEN ScaleStart END)
,LowEnd = MAX(CASE WHEN ScaleValue = 'Low' THEN ScaleEnd END)
,ModerateStart = MAX(CASE...
June 3, 2020 at 12:31 am
I could do it like this, I suppose...
use AdventureWorks2017;
go
-- what parts are in stock
SELECT currInv.ProductId
, currInv.TotalQOH
, sod.OrderQty
, rt_Sold = SUM(sod.OrderQty) OVER (PARTITION BY currInv.ProductID
ORDER BY soh.OrderDate
ROWS...
June 2, 2020 at 10:27 pm
I'll give you a hint... MAX( CASE WHEN...)
It's a LOT of that.
Jeff Moden posted an article on Crosstabs... that might help too. (Don't want to give the game away... I...
June 2, 2020 at 6:05 pm
IF NOT OBJECT_ID('tempdb..#AirAndPollenScale') IS NULL
DROP TABLE #AirAndPollenScale
CREATE TABLE #AirAndPollenScale(
[AllergyScaleID] [int],
[AllergyName] [nvarchar](max) NULL,
[ScaleStart] [int] NULL,
[ScaleEnd] [int] NULL,
[ScaleValue] [nvarchar](100) NULL,
)
INSERT #AirAndPollenScale ([AllergyScaleID], [AllergyName], [ScaleStart], [ScaleEnd], [ScaleValue]) VALUES (1,... June 2, 2020 at 4:15 pm
I would swear I've seen this before. I think I solved it by running SSMS as local administrator, and it will work. Right-click SSMS, click 'Run as administrator' and then...
June 2, 2020 at 1:24 am
It's hard to tell without seeing at the very least the table definition of tApplication, and a few dummy records. But 105 columns is a lot - it's possible that...
June 1, 2020 at 11:46 pm
I need to delete the rows where status = 1
DELETE
FROM TestPO
WHERE Status=1;
?
From your description, it's not at all clear what records you really want deleted. Which record(s) are duplicates? How...
May 27, 2020 at 2:09 am
Something I should practice... for sure!
I have to admit that my very first response to the question was "Can I do this with the dbatools PowerShell library?" I should have...
May 25, 2020 at 1:55 am
Viewing 15 posts - 691 through 705 (of 3,480 total)