on 04-08-2013 1:39 PM
HI,,
I would like to create keys ..in User Tables..
See the image..
in emp master..i create a field..
my requirement is i Dont want to allow the user post duplicate values..
I Think 100% stored procedure is fulfill my requirement..
but i got info from forum.. it is possible through the keys all so..
if u say yes..
see the image i am trying to implement it..
but
while pressing the button..
[Microsoft][SQL Server Native Client 10.0][SQL Server]The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.OHEM' and the index name 'OHEMIX_0'. The duplicate key value is 'User Key Description' (OUKD) (<NULL>).
This error is comming..
++++++++++++++++++
Normally what is the my requirement is
if i put in edit box fms..
it has 3 types..
a) Wit&hout Search in User-Defined Values
b)&Search in Existing User-Defined Values
c)Sear&ch in Existing User-Defined Values according to Saved Query
if i choose b option..
it is accepting values
but here it is accepting duplicate values
how can i stop the duplicate values.......
+++++++++++++++++++
any info...
Hello!
And if you try to implement the query above in the Store Procedure SBO_SP_TransactionNotification?
IF @object_type = '171' -- Refers to the Employees Table
AND @transaction_type IN ('A') -- This query will be executed when a new employee be added
BEGIN
DECLARE @YourUserField varchar(8)
set @YourUserField = ''
Select @YourUserField = isnull(T1.U_YourUserField, '') from OHEM T1 Where T1.[empID] = @num_of_cols_in_key
IF @YourUserField <> ''
BEGIN
Select @error = 1, @error_message='It's not allowed duplicated values for this field!'
END
END
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi $riniva$ Rachumallu..
Use different Keys and field name and try sure it will work , you index the table not the assigning the primary key
better use the TNSP
Hope Helpful
Regards
Kennedy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi...
Little bit confusion..
i was able to implement ..
but getting lot of confusion..
in emp master 3 fields are there u_empid, u_test,u_test1
i would like to enter only unique values only..
i took 3 indexes....
first index..
first filed
second inex
second field
third index
third field..
and i checked unique key...
may be it is comparing with respect to the other fields all so...
See the image..
still allso i is taking duplicate vlaues..
if i take all in one index..
allso accepting duplicate values.....
Hi,
Try to use different key name and then try.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.