Viewing 15 posts - 2,641 through 2,655 (of 4,087 total)
gjuarez (5/23/2016)
DECLARE @days2keep INT
SET @days2keep =180
while @@ROWCOUNT > 0
begin
delete top 10000...
May 23, 2016 at 2:53 pm
GilaMonster (5/23/2016)
Need to find this without using union/union all and in one select statement.
Why this restriction?
Though, from the requirement, it doesn't sound like it needs a union or an apply....
May 23, 2016 at 2:08 pm
Trace is being deprecated. You are better off using extended events if your version of SQL supports them.
Drew
May 23, 2016 at 12:23 pm
First, I find it a lot easier to read if you use the Table Value Constructor
insert into @DedTest
VALUES
('California', '56756', '1003375', 80915, 1, cast(2000000.00 as decimal(18,2)), cast(0 as decimal(18,2))),
('California', '56756', '1003375',...
May 23, 2016 at 11:56 am
Providing an exact duplicate of your original message is not going to make your objectives any clearer. Specifically, it is not going to answer the question of why you...
May 23, 2016 at 8:16 am
Did you try a CROSS APPLY instead of a subquery?
May 20, 2016 at 2:11 pm
Updating a table is expensive; altering a table is expensive. I updated your query without any updates and in ran in about 1/10 the time.
;
WITH E(n) AS(
...
May 20, 2016 at 2:07 pm
Why aren't you just calculating your revenue in your main report?
An alternative would be to include your project information in your sub-report.
Drew
May 20, 2016 at 11:46 am
The CASE expression makes your join non-SARGable. You are better off using a UNION. Why do you not want to use UNION?
Drew
May 20, 2016 at 8:05 am
You cannot use an aggregate in the main query of an UPDATE statement. You'll need to use a CTE, derived table, or subquery.
ROW_NUMBER() will give you a unique sequence...
May 19, 2016 at 3:56 pm
Rod at work (5/19/2016)
May 19, 2016 at 1:41 pm
Steve Jones - SSC Editor (5/19/2016)
drew.allen (5/19/2016)
May 19, 2016 at 1:12 pm
You can do this with only one CTE.
;
WITH cteCount AS(
SELECT Port, Vessel, BLNumber, ROW_NUMBER() OVER( PARTITION BY Port, Vessel ORDER BY COUNT(*) DESC ) rn
...
May 19, 2016 at 12:56 pm
This type of report is usually best left to the presentation layer. It's possible to do this in T-SQL, but it's not the best tool for the job. ...
May 19, 2016 at 12:17 pm
The report is looking for COMPUTER_NAME, but your original query has ComputerName. This is the main argument for using a CONSISTENT naming convention. I prefer separating pieces with...
May 19, 2016 at 8:31 am
Viewing 15 posts - 2,641 through 2,655 (of 4,087 total)