Forum Replies Created

Viewing 15 posts - 6,256 through 6,270 (of 7,619 total)

  • RE: T-SQL help on datetime

    Don't convert to a datetime, just compare it as characters. Invalid data may still get through, but you can't easily at all correct invalid data on the fly in...

    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: Is it better to involve more columns to make an index unique, or just index the nonunique column?

    Define the index based on how you will query it, and the cardinality of the keys.

    If you will always specify the second column in the conditions for the...

    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: steps to move data and log file in sql server cluster

    I think you can move the master db the same way for a cluster as you would for a stand-alone instance. Use the "SQL Server Configuration Manager" to put...

    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: SEQUENCE vs GUID across tables - uniqueness?

    For uniqueness across servers, you can also use a second value, which can often be just a smallint, that identifies the original server that assigned the id. That way,...

    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: query time question

    You'll want indexes on the lookup guids. And, since they're guids, you'll need to rebuild the indexes fairly frequently. You should also strongly consider reducing the FILLFACTOR on...

    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: I try to create one index but it went to suspended mode need help to run this query successfully

    If you can use online rebuild, it might be worth cancelling the current index create and running an online version.

    Also, you should consider specifying other options -- or 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".

  • RE: cardinality and nchar columns, query problems

    TheGreenShepherd (4/12/2012)

    AddressParseStatus is nchar(1) and is used to indicate the value returned by our USPS validation software. It has pretty low cardinality, only 9 possible values. There are roughly 1B...

    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: Select INTO vs. Creating a table

    Actually the SELECT ... INTO is more efficient if the statement can be minimally logged.

    I did a search in Books Online for something to verify that:

    "

    With minimal logging, using the...

    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: Do While or Cursor?

    No worries.

    Mine is more convoluted, I know, but for a large table could potentially perform much better.

    As long as you got a solution you could use 🙂

    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: Do While or Cursor?

    Gillian_Pappas2002 (1/16/2014)

    If all of the customer's records have an QS class, those do not have to be updated at all. Only the same customer order records that have at...

    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: Do While or Cursor?

    Would it be better to do this with a Do While or a cursor?

    No to both. Best is to use a set-based method, possibly like this one:

    UPDATE tn

    SET order_class...

    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: looking for way to unpivot a table, and make field name one of the columns in the output

    Here is a sample CROSS APPLY for your situation.

    SELECT Part#, CustomerID, ca1.Wk_Num, ca1.Qty

    FROM (

    SELECT 'A' AS Part#, 1 AS CustomerID, 10 AS Wk1, 20 AS Wk2,...

    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: case in where clause

    Yeah, sorry, in too big a hurry, left something out of the code:

    SELECT

    /* @IdCompany = */ e.IdTCompany,

    /* @IdClient = */...

    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: case in where clause

    Did you look at the code I wrote??

    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: case in where clause

    SELECT

    /* @IdCompany = */ e.IdTCompany,

    /* @IdClient = */ e.IdClient,

    /* @address = */ COALESCE(a1.address, a2.address)

    FROM emp e

    LEFT...

    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 - 6,256 through 6,270 (of 7,619 total)