Viewing 15 posts - 886 through 900 (of 2,648 total)
Make sure all the columns on Object8 that your query references are either in the index key or the included columns, this will stop it doing a key lookup for...
April 6, 2021 at 3:21 pm
Hi Scott.... revisiting your code above.... I'm getting a "Msg 8120, Level 16, State 1, Line 24 Column 'alias1.CALL_TIME_SECS' is invalid in the select list because it is not...
March 30, 2021 at 2:48 pm
FROM a2wh.dbo.CallLogCommon com with (NOLOCK)
JOIN a2wh.dbo.Campaigns ud with (NOLOCK)
ON com.[campaign] = ud.[campaign]
CROSS APPLY dbo.itvfGetSeconds(Call_Time) ctsec
CROSS APPLY dbo.itvfGetSeconds(Talk_Time) ttsec
March 30, 2021 at 2:05 pm
Same as Scott's but can use BETWEEN instead of two ANDs and can perform the subtraction in another CROSS APPLY.
Also, it is good practice to always have an ELSE in...
March 29, 2021 at 4:07 pm
although going through the route of linked server best practices would mean that the linked server would not be named as the server name but rather as a logical...
March 26, 2021 at 7:52 pm
Linked servers will be the easiest way. Then you just add the server name as a prefix:
SELECT *
FROM [ServerName].[DatabaseName].[SchemaName].[TableName]
March 26, 2021 at 4:16 pm
These are your subqueries
,(SELECT RS.LIB_SERVICE
...
March 25, 2021 at 11:20 pm
One of the major ideas of client/server architecture was that the system would come in tiers. The database layer would get a result set, then pass that set on...
March 25, 2021 at 6:34 pm
If you want the SQL optimised you would be better off giving us the actual SQL that is generated along with the execution plan.
March 25, 2021 at 2:26 pm
You're likely wasting resources by using a CROSS JOIN. Just do a standard INNER JOIN using the LIKE comparison as the join condition.
The optimiser should make them have the...
March 17, 2021 at 10:44 pm
Set up the data:
if object_id('tempdb..#a','U') is not null
drop table #a
if object_id('tempdb..#b','U') is not null
drop table #b
go
create table #a
(
... March 16, 2021 at 2:26 pm
Jonathan AC Roberts wrote:Your database is not normalised.
The standard way to store this is to have two tables instead of your #u table
It's a work table, Jonathan.
I know it's a temporary...
March 14, 2021 at 12:29 am
Your database is not normalised.
The standard way to store this is to have two tables instead of your #u table
CREATE TABLE #User
(
UserID int...
March 13, 2021 at 5:51 pm
I need to count the number of times each surgeon has done a procedure where op1 to op4 includes procedure b AND d OR just d irrespective of any...
March 11, 2021 at 7:54 pm
My Splitter function takes 3 parameters - data, delimiter and ValueForBlanks - typically empty string or NULL, but the value '[[DELETE]]' then completely removes any blank entries
Or you could...
March 5, 2021 at 8:56 pm
Viewing 15 posts - 886 through 900 (of 2,648 total)