Forum Replies Created

Viewing 15 posts - 871 through 885 (of 7,619 total)

  • Reply To: Indexing

    Look at the usage stats for the indexes to see if they are useful (and/or more useful than not).

    There's no single number of max indexes for a table.  It depends...

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

  • Reply To: Query help

    Didn't have usable data to test with, so the code is untested:

    SELECT A.Name, A.DateOfBirth, ot.Count
    FROM TableA A
    CROSS APPLY (
    SELECT TOP (1) *
    ...

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

  • Reply To: How to handle sticks on column country1 and country2 columns ?

    Your structure should be normalized, as you stated.

    create table #countries

    (

    company int,

    [year] int,

    rev int,

    country_sequence smallint,

    country varchar(100)

    )

    (12011,2010,121,1,'Egypt')

    (12011,2010,121,2,'France')

    ,,,

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

  • Reply To: Looking for some guidance on avoiding Scalar UDFs for DB lookups

    We need to see the actual lookup code to offer more specific advice here.

    Proper indexing could also be critical to getting best performance for this task.

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

  • Reply To: sql server enterprise edition or standard

    Jeff Moden wrote:

    It's probably a bad idea all the way around anyway.  🙁  How many people do you know that actually have a "Baseline" to compare against?

    For me, it would work...

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

  • Reply To: Disabling backup Jobs

    You have the general structure for that, you just had a typo in the SELECT for the cursor.  You had:

    DECLARE job_cursor CURSOR READ_ONLY FOR

    SELECT @job_name, [enable]

    FROM #JobsToDisableEnable

    @job_name will contain NULL...

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

  • Reply To: Disabling backup Jobs

    The DECLARE for the cursor is incorrect: you need to remove the @ from before "@job_name":

    DECLARE job_cursor CURSOR READ_ONLY FOR
    SELECT job_name,[enable] --<<--
    FROM #JobsToDisableEnable

    Also, in the EXEC, you...

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

  • Reply To: sql server enterprise edition or standard

    Jeff Moden wrote:

    juliava wrote:

    Hello,

    I was looking over the Edition specifications, and Standard is capped at 128 GB RAM is that correct?Can someone recommend me to use sql server enterprise edition or...

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

  • Reply To: sql server enterprise edition or standard

    Jeff Moden wrote:

    ScottPletcher wrote:

    If you're using 500GB now, it could be very hard to squeeze down to 128GB.

    It's likely, however, that you are not using data compression now.  From SQL 2016...

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

  • Reply To: Create Alert for Number of connection

    ratbak wrote:

    Please don't use reserved words like "COUNT" and "TIME" for column names.

    Please don't state that "COUNT" and "TIME" are reserved words in SQL Server because they are not.

     

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

  • Reply To: Quick Question on 2019 to older version?

    In fact, you cannot restore any newer-version SQL Server db to any older-version SQL instance, period.  Just does not work.

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

  • Reply To: sql server enterprise edition or standard

    If you're using 500GB now, it could be very hard to squeeze down to 128GB.

    It's likely, however, that you are not using data compression now.  From SQL 2016 on, that...

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

  • Reply To: Disabling backup Jobs

    EXEC msdb.dbo.sp_update_job @job_name='<your_job_name>', @enabled = 0 /* to disable, or 1 to enable */

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

  • Reply To: Sargable query

    You're not going to be able to this calculation:

    ISRECNUM % 20 = 5

    sargable.  By definition, it just isn't.

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

  • Reply To: Drawbacks of having hundreds of data files per database

    Jeff Moden wrote:

    Jeffrey Williams wrote:

    Jeff Moden wrote:

    Jeffrey Williams wrote:

    ScottPletcher wrote:

    Actually, the development team should have nothing to do with how the data in the db is physically stored.  That's the DBA's job.  (Sorry, just...

    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 - 871 through 885 (of 7,619 total)