Viewing 13 posts - 16 through 28 (of 28 total)
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...
August 8, 2012 at 12:38 pm
nope that didn't work either now it let's me insert data but it is also letting me use duplicates
August 8, 2012 at 11:44 am
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...
August 8, 2012 at 11:42 am
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...
August 8, 2012 at 9:36 am
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...
August 8, 2012 at 8:54 am
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
August 8, 2012 at 8:49 am
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...
August 8, 2012 at 8:23 am
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!
August 4, 2012 at 11:42 am
yes it definitely has to be dynamic sql
July 30, 2012 at 5:46 pm
SELECT
sysobjects.Name
, sysindexes.Rows
FROM
sysobjects
INNER JOIN sysindexes
ON sysobjects.id = sysindexes.id
WHERE
...
July 30, 2012 at 4:16 pm
Select Top 1 tab.name
From sys.tables tab
Order By name Asc;
how about this?
July 30, 2012 at 3:25 pm
Like this?
Select Sys.tables.name
From sys.tables
Order By name Asc
July 30, 2012 at 3:14 pm
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...
July 30, 2012 at 3:07 pm
Viewing 13 posts - 16 through 28 (of 28 total)