Viewing 15 posts - 811 through 825 (of 3,489 total)
That was cheating-level easy... except you need a helper function, Jeff Moden's DelimitedSplit8K function. It's here https://www.sqlservercentral.com/articles/tally-oh-an-improved-sql-8k-“csv-splitter”-function
Here's the SQL:
SELECT x.Item AS Category
, COUNT(*) AS UseCaseCount
FROM
(
SELECT ID
,...
February 13, 2020 at 11:11 pm
INSERT INTO OtherDatabase.Schema.Table (<field list>)
SELECT <field list>
FROM...
Or you could
INSERT INTO db.schema.table (field list)
EXEC storedProcName @param1='x', @param2='y';
February 13, 2020 at 9:57 am
The query will eliminate the sets that have already been added. That's what the NOT EXISTS predicate is for.
I guess if you don't like it, you could always write your...
February 13, 2020 at 9:22 am
I need every iteration increased by 5000 rows insert from temp table
Why not something like
SELECT TOP (5000) <field list>
FROM SourceTable st
WHERE NOT EXISTS (SELECT 1 FROM DestinationTable...
February 13, 2020 at 5:40 am
If you're doing an insert where you don't want the constraints checked, you can script out the constraints on the table, then drop them, do the import, then add them...
February 12, 2020 at 2:26 am
Did you actually install SSMS? The weird thing about the newer installers from MSFT is that all the pieces are separate. If you search for it, can you find this...
February 11, 2020 at 8:37 pm
Don't think you can do that very easily with SSRS. the best I think you can do is to make the filters optional... Except you can't build complete filters through...
February 10, 2020 at 8:46 am
Too hard to just copy & paste your CREATE TABLE and INSERT scripts here?
February 10, 2020 at 3:34 am
Would be easier to help with some sample data... It can be completely fake, just representative.
February 9, 2020 at 6:42 pm
Some days I can't see the forest for the trees. If the filters are all optional, you can do the filtering in SSRS. (So you could have a whole bunch...
February 7, 2020 at 3:22 pm
If you think about DAX like a programming language, the functions either return scalar values or tables. And the functions in DAX receive either table-type objects or scalar values too....
February 7, 2020 at 3:08 pm
So you want to make some parameters optional?
SomeColumn = COALESCE(@ParameterName, [SomeColumn])
So If @ParameterName is not assigned a value, then the comparison evaluates to
SomeColumn = SomeColumn
… so it's...
February 7, 2020 at 5:52 am
Could you please post create table scripts and some sample data and expected output?
Since you're new here, welcome! And some reading: How to post a question to get the...
February 6, 2020 at 12:55 am
Just wondering, but why are you doing a PIVOT in T-SQL at all? Why not do it in the presentation layer (Excel, SSRS etc)?
if you absolutely have to do it...
February 4, 2020 at 4:54 am
You'll get tested answers if you provide some consumable data... How about...
SELECT ID, StartDate, EndDate, ContractValue, Manager
FROM
(VALUES (1,'2019-11-01','2020-06-30',45000,'Stephen Smith'),
(2,'2019-12-01','2020-07-30',75000,'Carol Kenin'),
(3,'2020-01-15','2020-08-30',25000,'John Gnan'),
(4,'2020-02-01','2020-09-30',40000,'Jacob Joklin')) z(ID, StartDate, EndDate, ContractValue,...
February 3, 2020 at 9:08 pm
Viewing 15 posts - 811 through 825 (of 3,489 total)