Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

key in table

Former Member
0 Likes
988

Is it advicable to make all the fields in a table as key? The case is to maintain a control table where 2 fields are required and it should be unique also. is there any thing wrong in doing it?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
967

You can, but why? IF you know all of the key fields, there's nothing that the database can tell you when you select it.

Rob

Is it advicable to make all the fields in a table as key? The case is to maintain a control table where 2 fields are required and it should be unique also. is there any thing wrong in doing it?

7 REPLIES 7
Read only

Former Member
0 Likes
967

Well in your scenario, where you have only two fields in tables, and they need to be unique..Yes u can make it. As I also develop a screen in which we have to store two dates as a key in table...

Hope this’ll help you .

Bye

Read only

0 Likes
967

Thanks Javed,

I was checking whether its a good practice to do making all the fields in table as key.

Read only

0 Likes
967

I see no problem there, if you had a lot of fields in your table and you tried to make them all keys, you would get an error because there is a limit. No problem here though.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
968

You can, but why? IF you know all of the key fields, there's nothing that the database can tell you when you select it.

Rob

Read only

0 Likes
967

hi Rob,

I wanted to record whether a particular transaction has occured or not. If ocuured on the same date it should not be allowed once again. So the transaction and date are my only fields and only keys. Is there any SAP tables with all the fields as key.

Read only

0 Likes
967

I figured that out right after I made the post. I don't know of any tables like that, but it shouldn't be a problem. You might want to add the client as the first key field.

Rob

Read only

0 Likes
967

There are lots of SAP tables like this - TB040 for instance.

Rob