<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: primary key in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596268#M866041</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the key fields of a table must be stored together at the beginning of the table. A non-key field may not occur between two key fields.&lt;/P&gt;&lt;P&gt;A maximum of 16 key fields per table is permitted. The maximum length of the table key is 255.&lt;/P&gt;&lt;P&gt;If the key length is greater than 120, there are restrictions when transporting table entries. The key can only be specified up to a maximum of 120 places in a transport. If the key is larger than 120, table entries must be transported generically.&lt;/P&gt;&lt;P&gt;A table may not have more than 249 fields. The sum of all field lengths is limited to 1962 (whereby fields with data type LRAW and LCHR are not counted).&lt;/P&gt;&lt;P&gt;Fields of types LRAW or LCHR must be at the end of the table. Only one such field is allowed per table. There must also be a field of type INT2 directly in front of such a field. The actual length of the field can be entered there by the database interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check this link&lt;/P&gt;&lt;P&gt;[http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb6e446011d189700000e8322d00/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dhruv Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Mar 2008 09:40:04 GMT</pubDate>
    <dc:creator>dhruv_shah3</dc:creator>
    <dc:date>2008-03-17T09:40:04Z</dc:date>
    <item>
      <title>primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596262#M866035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;how many maximum primary keys allowed in one table.&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;radhakrishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:25:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596262#M866035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596263#M866036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can have all the fields as primary key in ur table...&lt;/P&gt;&lt;P&gt;No such limit is fixed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:32:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596263#M866036</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596264#M866037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Any number of keys can be used as index keys. But, in the where clause of the select query which uses this table, make sure that u use the first index key.&lt;/P&gt;&lt;P&gt;Else u will get the performance error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:34:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596264#M866037</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596265#M866038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A primary key can consist of multiple columns. However, it is unusual for a key to be constructed from more than five columns, since this makes it difficult for users to enter unique values. The arrangement of the columns behind the keywords PRIMARY KEY defines the key sequence.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:36:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596265#M866038</guid>
      <dc:creator>nivaskumar2</dc:creator>
      <dc:date>2008-03-17T09:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596266#M866039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai  &lt;STRONG&gt;Reddy&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is no such restriction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Eshwar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:37:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596266#M866039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596267#M866040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Radhakrishna,&lt;/P&gt;&lt;P&gt;A maximum of 16 key fields per table is permitted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you specify more than 16 fields, it gives you the following error message.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table ZVENKAT123 has more than 16 key fields (violates SAA standard)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks,.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Venkat.O&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: venkat o on Mar 17, 2008 6:00 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:39:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596267#M866040</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596268#M866041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the key fields of a table must be stored together at the beginning of the table. A non-key field may not occur between two key fields.&lt;/P&gt;&lt;P&gt;A maximum of 16 key fields per table is permitted. The maximum length of the table key is 255.&lt;/P&gt;&lt;P&gt;If the key length is greater than 120, there are restrictions when transporting table entries. The key can only be specified up to a maximum of 120 places in a transport. If the key is larger than 120, table entries must be transported generically.&lt;/P&gt;&lt;P&gt;A table may not have more than 249 fields. The sum of all field lengths is limited to 1962 (whereby fields with data type LRAW and LCHR are not counted).&lt;/P&gt;&lt;P&gt;Fields of types LRAW or LCHR must be at the end of the table. Only one such field is allowed per table. There must also be a field of type INT2 directly in front of such a field. The actual length of the field can be entered there by the database interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check this link&lt;/P&gt;&lt;P&gt;[http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb6e446011d189700000e8322d00/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dhruv Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:40:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596268#M866041</guid>
      <dc:creator>dhruv_shah3</dc:creator>
      <dc:date>2008-03-17T09:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596269#M866042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;16 key fields per table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:41:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596269#M866042</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596270#M866043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can have only one primary key in the table. That is why it is called primary &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But you can create any number of indexes (also unique which are like a primary key). Too many indexes isn't advised though, as it has impact on the performance of database write.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Mat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:41:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596270#M866043</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596271#M866044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any number of.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:45:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596271#M866044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596272#M866045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;There is no limit on the number of primary keys in a table.&lt;/P&gt;&lt;P&gt;You can use 'n' number of fields as primary key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sayee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:50:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596272#M866045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596273#M866046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as said above, there is only ONE primary key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There can be other secondary keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every key/index can consist of several index fields which are fields of the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not whether there are restrictions, for the number of indexes and for the number if index fields. If there are, then they could be release dependent and database platform dependent (number of fields seems to be restricted to around 250 fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it does not make much sense to have so many index fields, you need a few selective fields in a index, so moore than 10 fields in unusual.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it does not make much sense to have too many indexes, the optimzer will be confused. Table changes will become slow. Many tables have only a primary key (which is mandatory), many have only a few secondary keys, very few have around 10 indexes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 09:57:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/primary-key/m-p/3596273#M866046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T09:57:51Z</dc:date>
    </item>
  </channel>
</rss>

