Viewing 15 posts - 4,666 through 4,680 (of 7,597 total)
It's best to delete by the clustering key.
Therefore, what is the table clustered on? If it's clustered on identity -- gack! -- but you have an index...
November 2, 2015 at 2:34 pm
For SQL jobs, you could do something like this:
SELECT j.name, js.*
FROM msdb.dbo.sysjobsteps js
LEFT OUTER JOIN msdb.dbo.sysjobs j ON j.job_id = js.job_id
WHERE js.command LIKE '%sp[_]MysteryProcedure%'
November 2, 2015 at 2:22 pm
Jeff Moden (11/1/2015)
Mike Good (10/16/2015)
November 2, 2015 at 9:26 am
You didn't even indicate which table every columns comes from.
Is indexdate in temp1 or temp2?
Is transdate in temp1 or temp2?
Why do you need DISTINCT?
October 30, 2015 at 2:05 pm
I suggest using synonyms for all such remote tables. But use only logical names, that reflect the business purpose, not any physical attributes (server name / location / etc.)....
October 30, 2015 at 1:58 pm
It's easy to forget, but drives can, and do, fail. Sometimes they become so damaged/corrupt they cannot be read. If that happened, obviously you would lose all your...
October 30, 2015 at 1:20 pm
Again, column "F" seems to figure in every one of your searches. If that's true, cluster the table on F first. You might be able to eliminate some...
October 30, 2015 at 12:13 pm
GilaMonster (10/30/2015)
ben.brugman (10/30/2015)
The Question was:Can SQL-server use an index and then use the covering index to collect the data?
(And therefore not using the 'main' table).
The answer is No.
What you'll see...
October 30, 2015 at 12:12 pm
It depends. If the nonclustered index contains all columns needed to satisfy the query, SQL will not go back to the main table.
If you (almost) search the table by...
October 29, 2015 at 5:26 pm
DECLARE @KEYIDVALUE varchar(30) = ''
DECLARE @BASECODE varchar(10)
DECLARE @ASSETUID varchar(15)
DECLARE @CATCODE varchar(10)
DECLARE @COMPONENTNO varchar(3)
DECLARE @QUALRATING INT
DECLARE @MISSIONRATING INT
DECLARE @CURRENTDATE varchar(8)
DECLARE cursor_assets CURSOR LOCAL FAST_FORWARD FOR
SELECT Asset_UID + CatCode,
...
October 29, 2015 at 5:22 pm
Try this:
select sum(cast(cast(replace(Enter_your_field_name, ',', '') as decimal(28, 6) as int)) from Table_name
October 29, 2015 at 5:14 pm
Fwiw, here's my version of it, with an optional TRUNCATE (currently commented out) of the tables in between the DROP and ADD. I use this script, for example, to...
October 29, 2015 at 10:44 am
Eugene Elutin (10/28/2015)
Lowell (10/28/2015)
Sergiy (10/27/2015)
And glitch in the functionality beyond SQL Server...
October 28, 2015 at 11:03 am
SQLPain (10/27/2015)
October 27, 2015 at 9:57 am
The MIN and MAX need to operate on the dates in the table, not on GETDATE(), therefore more like this:
SELECT LoanID As [Loan ID]
FROM APayments
Where DraftDate > DATEADD(DAY, DATEDIFF(DAY, 0,...
October 26, 2015 at 4:13 pm
Viewing 15 posts - 4,666 through 4,680 (of 7,597 total)