Forum Replies Created

Viewing 15 posts - 4,681 through 4,695 (of 7,613 total)

  • RE: Update statistics

    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".

  • RE: scrub data in 5 minute intervals

    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".

  • RE: Find All Items That Call a Stored Procedure

    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".

  • RE: Ways to improve record deletion speed

    Jeff Moden (11/1/2015)


    Mike Good (10/16/2015)


    FWIW - We have successfully used same method proposed by Kristen-173977 for many years, for both batched DELETEs and UPDATEs. The only difference is we...

    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".

  • RE: product join - how to avoid?

    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".

  • RE: Best Practice use of Synonyms to reference Other-Database Tables

    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".

  • RE: Paths not well defined for databases

    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".

  • RE: Index and Optimiser question.

    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".

  • RE: Index and Optimiser question.

    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".

  • RE: Index and Optimiser question.

    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".

  • RE: Help with While Loop

    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".

  • RE: Varchar invalid for sum operator

    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".

  • RE: Foreign Keys

    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".

  • RE: Trigger and email notification

    Eugene Elutin (10/28/2015)


    Lowell (10/28/2015)


    Sergiy (10/27/2015)


    I would strongly recommend not to run sending emails or any other kind of external operations from a trigger.

    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".

  • RE: Date Function (Possibility)

    SQLPain (10/27/2015)


    Thanks Scott, I got your point and it makes sense. but somehow its still not giving me the desired result. If I run your above statement without the GROUPBY...

    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".

Viewing 15 posts - 4,681 through 4,695 (of 7,613 total)