Viewing 15 posts - 1,096 through 1,110 (of 1,400 total)
O the question is for 2012. Sorry, it needs the xml trick. The above is 2017+
March 26, 2020 at 1:26 pm
select string_agg(concat(TeamName, ',', concat(TeamName, 'Date')), ',') from #Teams;
March 26, 2020 at 1:24 pm
Because the start date, end date combinations aren't uniformly spanning 2 years the first part of the script creates the year bands using a tally table. Then the StudentData is...
March 25, 2020 at 10:48 pm
This is very tricky. I'm this far and my @$%@$ pivot isn't work for some reason and I can't figure out why. If (or when) it works my plan is/was...
March 25, 2020 at 10:25 pm
You're right tho it could be simpler
with
range_cte(EMployeeID, TranDate, NewStatus, EndDate) as (
select
EMployeeID, TranDate, NewStatus,
...
March 25, 2020 at 2:41 pm
What is the necessity of dateadd/datediff functions here?
Lead gets you the next date and from what ive seen in the daterange post, it accepts 2 dates aswell.
So why not...
March 25, 2020 at 2:29 pm
drop table if exists #EMployeeStatus;
go
create table #EMployeeStatus(
EMployeeID Int,
TranDate datetime,
OldStatus varchar(50),
NewStatus varchar(50));
go
insert #EMployeeStatus(EMployeeID, TranDate, OldStatus, NewStatus) values
(12345657, '07/11/2018', 'SUSPENDED', 'ACTIVE'),
(12345657,...
March 25, 2020 at 12:19 pm
select * from sys.database_scoped_configurations;
This tells the settings. Since for a while identity_cache ON has been the default. I checked Azure Sql is set to ON by default. ...
March 24, 2020 at 5:45 pm
In the DDL provided:
[event_id] [float] NULL
[race number] [tinyint] NULL
Are these 2 of the 3 columns to be included in the ORDER BY? Which column corresponds to expr1003?
March 24, 2020 at 5:25 pm
Sorry I should've also asked which are the ORDER BY column(s)? The window has 2 parts 🙂
March 24, 2020 at 4:51 pm
basically what I need to do is to summarize the count of column "count2" for a every partition, and then subtract it to the field in "lead2" so, with...
March 24, 2020 at 4:12 pm
This uses the daterange function from this article: https://www.sqlservercentral.com/scripts/a-daterange-table-valued-function
March 23, 2020 at 5:06 pm
drop table if exists #tblTest;
go
create table #tblTest
(ename varchar(10),
Amount float,
eDate date);
go
insert #tblTest values
('ABC',615.00,'03/23/2020'),
('ABC',540.00,'03/23/2020'),
('ABC',207.00,'03/23/2020'),
('PQR',449.00,'03/23/2020'),
('PQR',1065.00,'03/23/2020'),
('PQR',-2435.00,'03/23/2020');
declare
@max_dt ...
March 23, 2020 at 5:05 pm
Afaik and imo there are no pros only cons. There is no such thing as a "gap" in a primary key because 'unit consistency' is not a necessary...
March 23, 2020 at 4:37 pm
Afaik and imo there are no pros only cons. There is no such thing as a "gap" in a primary key because 'unit consistency' is not a necessary attribute. Maybe...
March 23, 2020 at 1:18 pm
Viewing 15 posts - 1,096 through 1,110 (of 1,400 total)