Forum Replies Created

Viewing 15 posts - 1,111 through 1,125 (of 2,647 total)

  • RE: Check Constarint

    USE test

    CREATE TABLE testConstraint (

    A int Null,

    B int Null,

    C int Not Null)

    alter table testConstraint

    add constraint threeColumn CHECK ((C = 150 AND A IS NOT NULL) OR (C = 151 ...

  • RE: Dropping indexes with low read to write ratio?

    GilaMonster (4/17/2012)


    SQLKnowItAll (4/17/2012)


    And as a note to the OP, (not to you Lynn) not knowing your experience, make sure you really know what an overlapping index is. I have seen...

  • RE: The DELETE statement conflicted with the REFERENCE constraint

    I looked back at your original post and realized that you are not deleting all of the records needed to perform the second delete. ALL records with the foreign...

  • RE: Dropping indexes with low read to write ratio?

    Without the field order, it is useless. Index on columnA, columnB, columnC is completely different from columnC, columnB, columnA.

  • RE: The DELETE statement conflicted with the REFERENCE constraint

    sqlfriends (4/17/2012)


    This is hard for me too everytime to post on T-SQL forum, try to make it simple to get some hint, and not post all complicated table structures...

  • RE: The DELETE statement conflicted with the REFERENCE constraint

    Lynn Pettis (4/17/2012)


    SQLKnowItAll (4/17/2012)


    sqlfriends (4/17/2012)


    SQLKnowItAll (4/17/2012)


    No, look:

    ALTER TABLE [dbo].[batSchoolRangeProgramResult] WITH CHECK ADD CONSTRAINT [FK_batSchoolRangeProgramResult_appSchoolRangeProgramSnapshot] FOREIGN KEY([ProcessID], [SchoolYear], [SchoolID], [RangeCd], [ProgramID])

    REFERENCES [dbo].[appSchoolRangeProgramSnapshot] ([ProcessID], [SchoolYear], [SchoolID], [RangeCd], [ProgramID])

    So the constraint...

  • RE: The DELETE statement conflicted with the REFERENCE constraint

    sqlfriends (4/17/2012)


    SQLKnowItAll (4/17/2012)


    No, look:

    ALTER TABLE [dbo].[batSchoolRangeProgramResult] WITH CHECK ADD CONSTRAINT [FK_batSchoolRangeProgramResult_appSchoolRangeProgramSnapshot] FOREIGN KEY([ProcessID], [SchoolYear], [SchoolID], [RangeCd], [ProgramID])

    REFERENCES [dbo].[appSchoolRangeProgramSnapshot] ([ProcessID], [SchoolYear], [SchoolID], [RangeCd], [ProgramID])

    So the constraint is on batSchoolRangeProgramResult...

  • RE: The DELETE statement conflicted with the REFERENCE constraint

    OP, look at your first error:

    "FK_ProgramResult_ProgramSnapshot". The conflict occurred in database "MyDB", table "dbo.ProgramResult".

    EDIT: OP changed names in first post from the actual in the attached code.

  • RE: The DELETE statement conflicted with the REFERENCE constraint

    No, look:

    ALTER TABLE [dbo].[batSchoolRangeProgramResult] WITH CHECK ADD CONSTRAINT [FK_batSchoolRangeProgramResult_appSchoolRangeProgramSnapshot] FOREIGN KEY([ProcessID], [SchoolYear], [SchoolID], [RangeCd], [ProgramID])

    REFERENCES [dbo].[appSchoolRangeProgramSnapshot] ([ProcessID], [SchoolYear], [SchoolID], [RangeCd], [ProgramID])

    So the constraint is on batSchoolRangeProgramResult and that...

  • RE: Primary with Null value

    Not to beat a dead horse... Maybe I'm not.

    1. A Primary Key cannot contain a NULL value.

    2. You can place a unique constraint on a column, which will...

  • RE: SQL Select statements and joins

    Ok, let's start with this... Which table has more records than the other? My "guess" (since you have not included DDL for the tables and sample data as...

  • RE: Appending

    vinu512 (4/14/2012)


    From what I understand this might be what you are looking for:

    Insert Into tbl_year

    Select * From tbl_Jan

    Union All

    Select * From tbl_Feb

    Union All

    Select * From tbl_March

    Union All

    Select * From tbl_April

    Union...

  • RE: Dropping indexes with low read to write ratio?

    Lynn Pettis (4/17/2012)


    SkyBox (4/17/2012)


    S_Kumar_S (4/17/2012)


    25 indexes on an OLTP table is quite high. You may also want to look for partial duplicate indexes which can be merged with other indexes.

    There...

  • RE: Dropping indexes with low read to write ratio?

    SkyBox (4/17/2012)


    S_Kumar_S (4/17/2012)


    25 indexes on an OLTP table is quite high. You may also want to look for partial duplicate indexes which can be merged with other indexes.

    There are a...

  • RE: Index Rebuild and Fillfactor

    PiMané (4/17/2012)


    Lynn Pettis (4/17/2012)


    PiMané (4/17/2012)


    Thanks.. that's probably it... it has very low amount of data.

    In addiction, what's the "optimal", if possible, fillfactor value? 90?

    Thanks,

    Pedro

    Simple answer, it depends. It depends...

Viewing 15 posts - 1,111 through 1,125 (of 2,647 total)