Viewing 15 posts - 436 through 450 (of 3,544 total)
You need to wrap the subquery with another select and use FOR XML
like this
DECLARE @rssbody XML;
SET @rssbody = (
SELECT FLDB,PROC_SET_CODE,PROC_SET_NAME FROM (
SELECT 'Fl01' as FLDB, PROC_SET_CODE, PROC_SET_NAME
FROM [Fl01].[dbo].[PRSM]
WHERE PROC_SET_CODE...
Far away is close at hand in the images of elsewhere.
Anon.
May 25, 2016 at 10:35 am
Luis Cazares (5/25/2016)
ThomasRushton (5/25/2016)
Ed Wagner (5/25/2016)
Manic Star (5/25/2016)
Hugo Kornelis (5/25/2016)
Grumpy DBA (5/25/2016)
ThomasRushton (5/25/2016)
painJoy and
Heaven and
Chocolate Sprinkles
Ice Cream
Cake!
Birthday
Antediluvian
Far away is close at hand in the images of elsewhere.
Anon.
May 25, 2016 at 10:16 am
WITH a (PID,VisitType,Rn,RowNo)
AS (
SELECT PID,VisitType,Rn
,ROW_NUMBER() OVER (PARTITION BY PID,Rn ORDER BY VisitType ASC)
FROM @PatDev
),
b (PID,MaxRowNo)
AS (
SELECT PID,MAX(RowNo)
FROM a
GROUP BY PID
)
SELECT b.PID
,MAX(CASE WHEN c.C = 1 THEN ISNULL(a2.VisitType,a.VisitType) END) AS [Col1]
,MAX(CASE...
Far away is close at hand in the images of elsewhere.
Anon.
May 25, 2016 at 7:16 am
Is there a specific reason why separate tables?
Far away is close at hand in the images of elsewhere.
Anon.
May 25, 2016 at 6:15 am
TheSQLGuru (5/20/2016)
....suffer from concurrency flaws....
Nice catch Kevin 🙂
Far away is close at hand in the images of elsewhere.
Anon.
May 20, 2016 at 6:07 am
DECLARE @InvoiceNo int = ISNULL((SELECT MAX(o.InvoiceNo) FROM Orders o),0);
WITH cte (ID,InvoiceNo)
AS (
SELECTo.ID,@InvoiceNo+ROW_NUMBER() OVER (ORDER BY o.ID ASC)
FROMOrders o
JOIN SetupAccountTypes a
ON a.ID = o.AccountTypeID
AND a.AccountType = 'COD'
AND o.DeliveryDate >= '20160101'
AND o.DeliveryDate...
Far away is close at hand in the images of elsewhere.
Anon.
May 20, 2016 at 5:54 am
First you need to allocate a unique number to each row
Second use Jeff Moden's DelimitedSplit8K function (here) to split the data
Third use PIVOT or CASE statements to pivot...
Far away is close at hand in the images of elsewhere.
Anon.
May 20, 2016 at 5:32 am
Lowell (5/16/2016)
I just got my MCSA after taking 70-463 Implementing a Data Warehouse in SQL Server 2012/2014.
I had set a mental...
Far away is close at hand in the images of elsewhere.
Anon.
May 16, 2016 at 9:47 am
Create a new report, add data source and dataset
Drag all four columns (ID Seller Hyderabad Bangalore) to detail box
continue on to finish report
Double click on Details_Group under Row Groups
Click Add...
Far away is close at hand in the images of elsewhere.
Anon.
May 11, 2016 at 6:37 am
KMM-489657 (11/15/2007)
Far away is close at hand in the images of elsewhere.
Anon.
May 11, 2016 at 6:03 am
WayneS (5/6/2016)
33 years... wow. I sure hope that you have been quite happy with them.
Well there have been ups and downs but I weathered the storms and even survived some...
Far away is close at hand in the images of elsewhere.
Anon.
May 7, 2016 at 1:17 am
Grumpy DBA (5/4/2016)
Far away is close at hand in the images of elsewhere.
Anon.
May 6, 2016 at 2:16 am
Glad I got a channel now to watch it, missed it for ages.
Watched a replay of the 5 hour marathon of the Red Sox / Astros game.
Thrilling game could not...
Far away is close at hand in the images of elsewhere.
Anon.
April 26, 2016 at 1:57 am
Ed Wagner (4/25/2016)
Far away is close at hand in the images of elsewhere.
Anon.
April 25, 2016 at 5:22 am
Jeff Moden (4/24/2016)
My favorite of all time, though, is "If he had 2 brains, he'd be twice as stupid". 😀
Hey, I resemble that remark :crazy:
Far away is close at hand in the images of elsewhere.
Anon.
April 25, 2016 at 5:20 am
Viewing 15 posts - 436 through 450 (of 3,544 total)