Viewing 15 posts - 991 through 1,005 (of 3,500 total)
Why not use Jeff Moden's DelimitedSplit8K? It returns an Item and the Item's ordinal position. Then you could just insert that into your final table.
Got any sample data for us...
April 9, 2019 at 6:22 pm
If you grant users execute rights on the schema, then they can access the objects inside it. What are you trying to accomplish by doing this?
April 7, 2019 at 9:55 pm
Grrr… Can't I edit my posts anymore?
I think the problem I'm having is that I can't get SQL Server to do a case-sensitive search. Not sure what I'm doing wrong.
SELECT...
April 2, 2019 at 6:48 am
Did you try using LAG()?
April 2, 2019 at 5:44 am
Another weird thing... What's up with the way this version of the forum software counts responses? It looks like it's counting messages in the thread and not responses. In the...
April 2, 2019 at 4:07 am
Is it possible to collapse some of the forums like you could on the old version of the website? Super handy to minimize the stuff I'm not currently interested in.
(I...
April 2, 2019 at 3:12 am
March 29, 2019 at 10:56 am
First, I can't really read your pictures. Second, I have no scenario or description of what's going on to compare it to, so sure, it's great. They both are. Knock...
March 28, 2019 at 10:45 pm
This will split the data:SELECT col, ds.ItemNumber, ds.Item
FROM #Table t
CROSS APPLY Utilities.dbo.DelimitedSplit8K(col,'-') ds
Then you would have to pivot it. This is most...
March 28, 2019 at 9:41 am
Do you mean like this?
SELECT *
FROM (
SELECT soh.CustomerID
, soh.OrderDate
, LAG(soh.OrderDate,1) OVER (PARTITION BY soh.CustomerID ORDER BY soh.OrderDate) AS PrevSale
FROM Sales.SalesOrderHeader soh
March 27, 2019 at 6:31 pm
You can sort inside the partition. (Using AdventureWorks2008R2)
SELECT soh.CustomerID
, soh.OrderDate
, LAG(soh.OrderDate,1) OVER (PARTITION BY soh.CustomerID ORDER BY soh.OrderDate) AS PrevSale
FROM Sales.SalesOrderHeader soh
ORDER...
March 27, 2019 at 5:21 pm
Then use LAG() and maybe ROW_NUMBER().
Any record with a non-null LAG() value will be a reopen.
March 27, 2019 at 4:24 pm
How far between open/close would count as a "reopen"? You can just use LAG() with a PARTITION to look backwards at the previous records.
March 27, 2019 at 4:08 pm
So when you created small, medium-sized, large, and ridiculously large TVPs and JSON files and queried them, what did the results look like?
March 23, 2019 at 2:50 pm
Why not set the collation to case-insensitive instead of doing all those converting to upper case? But without some sample data, and a sample of query parameter values, it's hard...
March 23, 2019 at 2:44 pm
Viewing 15 posts - 991 through 1,005 (of 3,500 total)