|
|
|
NOT PRIMARY KEY
|
|||
|---|---|---|---|
|
#18+
Подскажите, плз, как в Сайбесе сделать поле НЕ PRIMARY KEY? Т.е. было так: CREATE TABLE 1 (id integer NOT NULL PRIMARY KEY, name string); Теперь надо написать команду, которая убирает PRIMARY KEY. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.02.2005, 01:29 |
|
||
|
NOT PRIMARY KEY
|
|||
|---|---|---|---|
|
#18+
Как я понял, имя его не известо. Тогда с помощью PB открыть базу, найти таблицу, найти PK и удавить его. А на будущее, чтобы можно было командно, лучше писать так: ALTER TABLE MyTable ADD CONSTRAINT pk_MyTable PRIMARY KEY (Column1, Column2); Тогда проблем не будет. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.02.2005, 07:20 |
|
||
|
NOT PRIMARY KEY
|
|||
|---|---|---|---|
|
#18+
Guest1Подскажите, плз, как в Сайбесе сделать поле НЕ PRIMARY KEY? Т.е. было так: CREATE TABLE 1 (id integer NOT NULL PRIMARY KEY, name string); Теперь надо написать команду, которая убирает PRIMARY KEY. В Oracle - так: Код: plaintext ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.02.2005, 14:54 |
|
||
|
NOT PRIMARY KEY
|
|||
|---|---|---|---|
|
#18+
Поскольку не указано в каком именно Sybase происходит действие, считаем ASA, для него приведу цитату из хелпа: ASA BOLExample 3 The following statement removes all columns from the primary key for the skill table. Before you delete a primary key, make sure you are aware of the consequences in your database. ALTER TABLE skill DELETE PRIMARY KEY На всякий случай приведу пример как создать ключ: ASA BOLExample 2 The following statement adds the columns skill_id and skill_type to the primary key for the skill table: ALTER TABLE skill ADD PRIMARY KEY ( "skill_id", "skill_type" ) If a PRIMARY KEY clause is specified in an ALTER TABLE statement, the table must not already have a primary key that was created by the CREATE TABLE statement or another ALTER TABLE statement. и такое вот примечание по поводу очередности столбцов в ключе: ASA BOLColumn order in multi-column primary keys Primary key column order is determined by the order of the columns during table creation. It is not based on the order of the columns as specified in the primary key declaration. А вообще, мне кажется этот топик более подходит для форума Sybase ASA, ASE, IQ , а не PowerBuilder. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.02.2005, 17:00 |
|
||
|
|

start [/forum/topic.php?fid=15&fpage=90&tid=1338542]: |
0ms |
get settings: |
10ms |
get forum list: |
13ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
45ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
40ms |
get tp. blocked users: |
2ms |
| others: | 241ms |
| total: | 371ms |

| 0 / 0 |
