Forum Replies Created

Viewing 15 posts - 7,111 through 7,125 (of 7,619 total)

  • RE: Check Constraint Works on Inserts, but Not on Updates

    mmallkc (10/30/2012)

    Whenever I try to insert a new record in violation of this constraint, I get an error as expected. However, when I update the table in violation of this...

    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: New To SQL, Need To Learn About Triggers

    capnhector (11/1/2012)


    David92595 (11/1/2012)


    Can Fields B, C, and D still be manually changed after the fact if need be? or are fields B,C, and D locked as computer values at 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".

  • RE: 100 Most famous interview Questions and Answers

    How many columns can a table have?

    Haven't a clue. If you get even close, you've got a horrible table design anyway.

    Who would ask such a Mickey Mouse q??

    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: Exclude Rows from one table based on items in two columns

    You could also use WHERE with NOT:

    ...

    WHERE NOT (

    (CARS = 'Volvo' AND Year = 2006) OR

    (CARS = 'Buick' AND Year =...

    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 many rows in a table before using a clustered index?

    scogeb (11/2/2012)


    Michael Valentine Jones (11/2/2012)


    scogeb (11/2/2012)


    I like to think there is always an exception to every rule. Take for instance a table that ALWAYS has inserts and NEVER has...

    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: Last Time a Table was Accessed

    I think technically this is the last time the table was accessed since SQL was last (re)started.

    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 there an accurate script for datediff format in years:months:days?

    /* Author: ScottPletcher */

    SELECT

    start_date,

    end_date AS end_date,

    CAST(

    DATEDIFF(YEAR, start_date, end_date) - CASE...

    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: Some way to write an INNER JOIN, but joining on either of two columns

    What is the problem? Do you have NULLs in the the MainZip when it's not present/used?

    SELECT D.*

    FROM Doctors D

    INNER JOIN ZipCodes Z ON

    (D.MainZip IS...

    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 with Include

    Don't rely solely on the missing index recommendations from those tables. SQL typically suggests way too many indexes. You need to have someone review all available information before...

    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: Dynamic SQL to change Recovery Model

    Try using [ ] instead of ' ' around the user name:

    DECLARE @sql nvarchar(max)

    SET @sql = ''

    SELECT @sql = @sql+

    'DROP USER ['+name+'] --<<--

    '

    FROM sys.database_principals

    WHERE principal_id >...

    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 Question

    I would have to know the version of SQL to know how to answer this.

    For 2008+, you have CDC.

    For SQL prior to that, they probably wouldn't like my answer, but...

    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: many to many relations

    lak.konduri (10/21/2012)


    I have one table and the columns are bookingreference,complaintreference,category1,category2,desriptionofthecomplaint,

    one bookingref have one complaintid,

    one complaintid have many bookingreferences,

    one complaintid have many categories and one category have many complaintid,

    one complaintid have...

    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: Identity column and the seed

    The seed value -- rather than seed + 1 -- is the identity value that will be assigned to the first row inserted into the table.

    So, if you want 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: design database

    I agree, this is way too big for a quick question.

    I'd also be willing to bet that much of what they gave you is objectively not designed very well, if...

    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: Dynamic SQL to change Recovery Model

    I'd also suggest changing the:

    WHERE recovery_model_desc != 'simple'

    to:

    WHERE recovery_model_desc != N'simple' AND state_desc = N'ONLINE'

    You're just wasting time trying to change the db's recovery model if it isn't ONLINE.

    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,111 through 7,125 (of 7,619 total)