Viewing 15 posts - 4,681 through 4,695 (of 7,613 total)
river1 (11/4/2015)
Hi,
I saw this job below which runs from 20 to 20 minutos on my production server.
Is it normal to have a statistics update every 20 minutos?
...
and ...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
November 4, 2015 at 5:22 pm
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...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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%'
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
November 2, 2015 at 2:22 pm
Jeff Moden (11/1/2015)
Mike Good (10/16/2015)
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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?
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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.)....
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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,
...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
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...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
October 28, 2015 at 11:03 am
SQLPain (10/27/2015)
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
October 27, 2015 at 9:57 am
Viewing 15 posts - 4,681 through 4,695 (of 7,613 total)