Viewing 15 posts - 3,946 through 3,960 (of 7,597 total)
Yes, inner joins like that are still valid because they are still unambiguous and thus 100% logically valid. Equi-joins function exactly the same using WHERE joins...
February 16, 2017 at 10:08 am
You could get an initial page split. But after that, SQL detects that incoming values are sequential and shouldn't do another page split unless you overlap other existing rows.
February 15, 2017 at 3:44 pm
I don't think AM/PM is an issue really. Here's the code to calc the diff in minutes; I'll leave converting those minutes to hours:mins or hours.hours as I'm pressed for...
February 14, 2017 at 10:12 am
I think the problem may be deeper than that. Remember, once you alias a table in a query, you cannot refer to that table by its original name, but only...
February 13, 2017 at 10:07 am
You need to add ending quotes to the strings, and not specify a third parameter for the the CHARINDEX, like so:
SELECT SUBSTRING('APP4005673452-45580', CHARINDEX('-','APP4005673452-45580') + 4, 4)
February 10, 2017 at 11:28 am
Since you're already using dynamic SQL, you can directly pass the value to the SQL command:
ALTER PROCEDURE spGetList
@ID INT
AS
--DECLARE @ID INT
DECLARE @Query...
February 9, 2017 at 8:01 am
Would need to see the query plan to know for sure what is going on, but, based solely on your description, there's a limited amount you can do.
1)...
February 8, 2017 at 12:56 pm
Be sure to cluster the temp table as well, on ( TransactionGroupGUID, b.TransactionID )
February 8, 2017 at 12:15 pm
I agree, we need more details and a temp table would be much better. But you should always UPDATE an alias when doing JOIN(s) in an UPDATE. And, if possible,...
February 7, 2017 at 4:37 pm
select top (1) id
from @test T
where VendorID = @VendorID and (CompanyId = @CompanyId Or CompanyId IS NULL)
order by companyid desc
February 7, 2017 at 3:08 pm
Perhaps this?:
;
WITH my_junk AS (
SELECT CAST(my_column as varchar(7)) as my_column FROM (VALUES
('-1.23456'),('-1.2345'),('1.2345000'),('12.3456'),('-1.234'),('1.234'),('-12.345'),('12.345'),('-12.34'),('12.34'),('-1.23'),
('ab'),('x'),(''),('0'),
('1.23'),('-1.2'),('1.2'),('-12.3'),('12.3'),('-1'),('1'),('-12'),('12')
) d (my_column)
)
SELECT my_column, final_value
FROM my_junk
February 7, 2017 at 11:21 am
SQL Server provides system views that greatly assist you here. You need to use those views, rather than just look at SQL code, to determine index(es) usage and missing index(es).
February 6, 2017 at 2:47 pm
How about something like below? Since it involves renaming the table, naturally you may need to adjust the implementation details to avoid/lessen glitches in your specific environment:
1) Create...
February 6, 2017 at 12:06 pm
The biggest performance factor overall is properly clustering the tables. Presumably you always query by client (if you have clients that see multiple clients, you might need another...
February 3, 2017 at 3:17 pm
I wouldn't worry about a one-time occurrence (although you should review whether or not you are on the latest SP/patch for that SQL instance).
If it happens again, then...
February 2, 2017 at 2:37 pm
Viewing 15 posts - 3,946 through 3,960 (of 7,597 total)