Viewing 15 posts - 31 through 45 (of 4,080 total)
You already have a splitter function available in STRING_SPLIT(). It will parse the CSV string into a set of rows with a single column heading of [Value].
SELECT...
April 1, 2021 at 7:06 pm
Why did you repost this? You got at least two answers to your earlier "LEN" post that would work. All you had to do was change the column names...
March 31, 2021 at 2:35 pm
I just edited my post to give you the code based on len(ID). Hope it helps.
March 30, 2021 at 4:16 pm
A query can only return a fixed number of columns. What is the maximum number of "ID" columns? ID5? ID100?
The code below will rank the ID columns...
March 30, 2021 at 4:02 pm
A single query can't return a variable number of columns. It would have to reflect one column for every month of the year and a total at the end.
March 29, 2021 at 9:46 pm
You say minutes in the previous month, but then you list the three previous months and say it must be in tabular form.
Do you want each of the previous months'...
March 26, 2021 at 9:03 pm
Best practice would be to first import the data from the source server into a staging table. (This can be done through BCP, SSIS, or by linked server.) ...
March 26, 2021 at 7:30 pm
Forget I said anything about making interest rate per period a variable. 🙂
March 26, 2021 at 7:23 pm
Understand completely. I really don't consider the rounding issue to be an error. Just mildly annoying. Please don't take anything I said as being critical !! ...
March 26, 2021 at 6:01 pm
Nice work, and a fun solution, Jason.
Just a couple of comments.
I'm curious if it would save CPU cycles is to make the interest rate per period a variable. I'm...
March 26, 2021 at 5:01 pm
An interesting use of synonyms provides flexibility for source or target table names in scripts and procedures.
DECLARE @InputTable varchar(100) = 'ContentX' -- this would be a...
March 26, 2021 at 2:33 pm
I am guilty of banging my head against something for more than an hour, but I have found that if you ask someone (anyone really) to lend you their eyes...
March 26, 2021 at 2:27 am
There's an easy way to create GroupIDs by size using the ROW_NUMBER() function and a little integer math.
The example below uses a varchar column with ROW_NUMBER(), just to show that...
March 26, 2021 at 2:15 am
Per Paul Randal in https://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-2630-nested-transactions-are-real/
The commit of a nested transaction has absolutely no effect – as the only transaction that really exists as far as SQL Server is...
March 25, 2021 at 9:43 pm
That would produce TWO result sets, Steve. The second one would not have column names. Plus you can't really union the two queries if you are relying on @@ROWCOUNT.
Here...
March 25, 2021 at 7:37 pm
Viewing 15 posts - 31 through 45 (of 4,080 total)