Forum Replies Created

Viewing 15 posts - 7,411 through 7,425 (of 7,619 total)

  • RE: run job from the last inserted record

    You can specify a batchsize for a bulk load, and SQL then commits every time after that many rows are loaded (obviously you definitely want to specify a batchsize for...

    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: What are the implications of backing up a database more than once to the same file

    As for the restore, it's very easy to create a script to have SQL restore the last backup of a db.

    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: How to select latest appointment for a list of customers from Appointments table

    Maybe, then you could also do this:

    select

    a.* -- to save time, should define all columns you want to return

    from

    dbo.Appointments a

    ...

    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: Combined wildcard and between statements

    I think this will do it:

    WHERE

    DIAG1 NOT LIKE 'C[0-8][0-9]%' AND

    DIAG1 NOT LIKE 'C9[0-7]%' AND

    DIAG1 NOT LIKE 'D3[7-9]%'...

    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: How to select latest appointment for a list of customers from Appointments table

    I strongly suspect you will want to see more details on the last appointment than just the date:

    SELECT

    CustomerId, AppointmentDate, ...

    FROM (

    SELECT *,...

    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: Strange order for returned records, suddenly

    but that does not mean that someone else didn't change something

    As Lynn has stated, that can happen even without any change being made to anything.

    SQL only provides ORDERing if 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".

  • RE: Total / average function advice

    Yes, your queries will be vastly faster if you cluster on add datetime rather than identity. Hopefully your queries are then typically like this:

    SELECT

    SUM(...) AS...

    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: Total / average function advice

    An occassional highly unusual exception doesn't validate the horrible idea in general of identity as the default for a clus key.

    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: Total / average function advice

    True, there could be special situations.

    you could potentially have a very large and active table that is in a database mirrored over a slow wan connection.

    If you're trying to mirror...

    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: Total / average function advice

    Other than logging-type tables, where the clus key value is essentially irrelevant, I can't imagine any case where identity would be the proper clus key on business data.

    Sure, for 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: Total / average function advice

    There are vastly better ways to stress that in general a table needs a clustered key than to have the damaging and false notion that it should be an identity...

    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: Total / average function advice

    While I may agree, I have to play devils advocate, why not cluster on the identity column?

    Because the overwhelming majority of queries will specify the datetime.

    I wish I had a...

    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: SQL Server Agent - who ran that job?

    As long as you do things in the proper sequence -- change AD first, then use the SQL tools, not the Windows tools, to change the account pwd -- 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".

  • RE: Total / average function advice

    *Cluster* the table on the add date/time (rather than on, say, an identity column, which may still be a good idea to have on this table, just don't cluster 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: SQL Server Agent - who ran that job?

    Create a logon trigger, and capture everything you can -- app_name, host_id, host_name (most people don't bother to fake this) and original_login (just in case).

    You could of course then also...

    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 - 7,411 through 7,425 (of 7,619 total)