Forum Replies Created

Viewing 15 posts - 3,451 through 3,465 (of 7,619 total)

  • RE: Transferring data between tables

    Again, the easiest solution is to simply split into two tables.

    You can even keep the original table name if you:
    1) Create the new table, with all 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: break cluster and get sql server available

    I don't know about "broken", but if you "uncluster" it normally, it runs fine.

    And, yes, then you have two servers each running a single, separate, independent instance.

    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: break cluster and get sql server available

    Somewhat confusing:  "has ... active-active, active-passive setup".  Huh, can't be both at the same time, which is it?

    If A-P, I know we've undone/removed clustering and it worked fine,...

    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: Where Clause Logic

    JR11 - Thursday, April 19, 2018 9:05 AM

    ScottPletcher - Thursday, April 19, 2018 8:22 AM

    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: Where Clause Logic

    Difficult to tell exactly what you need, but if you want the other conditions to apply to "Developer" too, then do this:


    WHERE (customer = @customer_number)...

    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: Transferring data between tables

    richardmgreen1 - Thursday, April 19, 2018 4:06 AM

    ScottPletcher - Wednesday, April 18, 2018 9:27 AM

    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: Join on field of varying length

    daniness - Wednesday, April 18, 2018 1:59 PM

    Hi Scott,
    Thanks for your reply. I'm not following your code. In this portion:

    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 use Cast & Convert

    Use CAST (it's ANSI-standard), and CAST the final result as well, if you want a specific size of result:

    CAST( CAST( SUM(Principal1) AS DECIMAL(5,2) ) + CAST ( SUM(BankInterest) AS DECIMAL(5,2)...

    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: Join on field of varying length

    daniness - Wednesday, April 18, 2018 10:24 AM

    ScottPletcher - Wednesday, April 18, 2018 9:17 AM

    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: Determining the Years, Months, Weeks and Days between two dates

    See if this gives you what you need -- it should at least be very close.  Btw, T-SQL isn't like C#, you don't need separate statements for every calc.

    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: Transferring data between tables

    For that type of table definition, I'd suggest forcing all LOB columns completely out of the main table space (since SQL doesn't allow you to customize column-by-column).  That should avoid...

    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: Join on field of varying length

    I'd use CROSS APPLYs to determine the lengths (this helps keeps the other code "cleaner" by pushing calcs/computations into CROSS APPLYs).  For example:


    SELECT PCMRetrievalCode, LenOfSchemaId,...

    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: Get all index definitions from all databases and all tables

    I still don't understand why you need the index in string format to determine that.  It's actually easier to accurately compare the meta-data rather than a string definition (where noncritical...

    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: Splitting a string after the first space after the 10th character?


    SELECT string, LEFT(string, split_byte - 1) AS string1,
        SUBSTRING(string, split_byte + 1, 8000) AS string2
    FROM (
      VALUES('Apple is Red and Grapes are Purple'),

    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: Question on Backups

    I'm going to label each q so others can comment without having to repeat the full q:

    A1) transaction log back up verses a full back up? 
    A tran...

    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 - 3,451 through 3,465 (of 7,619 total)