Forum Replies Created

Viewing 13 posts - 16 through 28 (of 28 total)

  • RE: Triggers

    So I changed it to a Instead Of trigger and it now prevents any entries from being inserted but no error, I just cannot figure out why!!:sick:

    Create Trigger NoDuplicates

    On...

  • RE: Triggers

    nope that didn't work either now it let's me insert data but it is also letting me use duplicates

  • RE: Triggers

    Thanks for your help, Check this out and see if I finally got it!

    Create Trigger NoDuplicates

    On TestUniqueNulls

    After Insert, Update AS

    Begin

    IF

    (Select Count(Distinct A.NoDupName)

    From TestUniqueNulls AS A join Inserted AS B

    On...

  • RE: Triggers

    Ok so I added 'distinct noDupName' to my count but i am still not getting it.

    Create Trigger NoDuplicates

    On TestUniqueNulls

    After Insert, Update AS

    Begin

    IF

    (Select Count(Distinct NoDupName)

    From TestUniqueNulls AS A join...

  • RE: Triggers

    I Think this may be right now What would I do to test it? Write a select Statement?

    Create Trigger NoDuplicates

    On TestUniqueNulls

    After Insert, Update AS

    Begin

    IF

    (Select Count(*)

    From TestUniqueNulls AS A join...

  • RE: Triggers

    Create Trigger NoDuplicates

    On TestUniqueNulls

    After Insert, Update AS

    Begin

    IF

    (Select Count(*)

    From TestUniqueNulls join TestuniqueNulls

    On TestUniqueNulls.NoDupName = TestUniqueNulls.noDupName) > 1

    Begin

    RollBack Tran

    RaiseError('Duplicate value', 11, 1)

    End

    End

  • RE: Triggers

    Maybe something like this:

    Create Trigger NoDuplicates

    /*Code

    After Insert Update AS

    Begin

    IF

    (Select Count(*)

    From TestUniqueNulls

    */

    The thing is I think there needs to be a join but the question doesn't specify enough...

  • RE: Stored Procedures

    Thank you, I had actually use 'google' in order to get the result you were referring to. I had been using firefox and it didn't show me that. Thanks Again!

  • RE: Dynamic Sql using sql server 2008

    yes it definitely has to be dynamic sql

  • RE: Dynamic Sql using sql server 2008

    SELECT

    sysobjects.Name

    , sysindexes.Rows

    FROM

    sysobjects

    INNER JOIN sysindexes

    ON sysobjects.id = sysindexes.id

    WHERE

    ...

  • RE: Dynamic Sql using sql server 2008

    Select Top 1 tab.name

    From sys.tables tab

    Order By name Asc;

    how about this?

  • RE: Dynamic Sql using sql server 2008

    Like this?

    Select Sys.tables.name

    From sys.tables

    Order By name Asc

  • RE: Dynamic Sql using sql server 2008

    Not really sure how to get the first table alphabetically in the database by writing it in the script. I mean I know which one I need but do not...

Viewing 13 posts - 16 through 28 (of 28 total)