Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Bases";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

Help me please Find similar branches


Alexsyy   (2001-12-04 08:52) [0]

Hi all!
Prompt to make so that primary keys after deleting for example all records in the table at the subsequent addition began with 1? For example: there is a table that contains 4 rows, primary indexes respectively 1..4, deleted everything, added an 1 row, it has a primary index 5 (instead of the desired 1)
Regards Alexsyy



Владислав   (2001-12-04 09:32) [1]

Well, create a primary index (the key is called) from one. What are the problems?



Maxus   (2001-12-04 09:40) [2]

Hello!
If for MS SQL Server, then try this:
1. key attribute do IDENTITY
2. in the delete trigger, execute TRUNCATE TABLE. This command resets the IDENTITY columns in 0.
See help on IDENTITY (CREATE TABLE) and TRUNCATE TABLE.

PS
Keys and indexes are two different things, I think :)




Владислав   (2001-12-04 09:44) [3]

> Maxus (04.12.01 09: 40)

Actually, he wrote for FoxPro and dBase



ValeraVV   (2001-12-04 12:34) [4]

If you need a record sequence number, you can get it (for FoxPro DBase), but newly added records must have a key that is different from other records (including deleted ones); All this is IMHO, and on the issue: the paradox table (in a certain place of the header there is the current value of the auto-increment field), it can be changed, but opening the table as a regular file (I think the same is true for dBase). Description Header "and DBF is available to anyone. If you work through BDE, it is easier to re-create the table (or the field via the alter table request)



Nest   (2001-12-04 14:06) [5]

Well, does DBASE have auto-increment fields?

2Alexsyy
And where do you get the ID value?
Well, for example, when you start filling out an empty table in an orderly way, then where does the value come from?
There are ideas, but I don't want to write idle ..



Mick   (2001-12-04 14:16) [6]

DBASE has auto-increment fields.



Niklen   (2001-12-04 14:36) [7]

It may be necessary to pack the table so that there are no deleted records
Table1.Exclusive: = TRUE;
Table1.Open;
DbiPackTable (Table1.DBHandle, Table1.Handle, nil, nil, TRUE);



Nest   (2001-12-04 14:40) [8]

2Mick
Starting from which version?



Anatoly Podgoretsky   (2001-12-05 01:06) [9]

7



Pages: 1 whole branch

Forum: "Bases";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top





Memory: 0.57 MB
Time: 0.034 c
1-22075
that
2001-12-19 12:40
2002.01.08
Tables in MS Word


1-22257
Dmitry1
2001-12-14 16:53
2002.01.08
Good day


14-22345
petr_v_a
2001-11-05 20:13
2002.01.08
In defense of Lana Rozanova & Co !!!


1-22071
KAA
2001-12-19 10:48
2002.01.08
Two services interfere with each other.


3-21924
Andrei
2001-12-04 14:37
2002.01.08
DbLookUpComboBox





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian Japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Spanish swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada Khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish