|
|
|
raiserror
|
|||
|---|---|---|---|
|
#18+
pri popitke vstavit" duplicat in the table s Unique Index polychay systemmessage : Server: Msg 2601, Level 14, State 3, Procedure OBTMApplication_AddCustomers, Line 30 Cannot insert duplicate key row in object 'Customers' with unique index 'IX_Customers'. The statement has been terminated. i moi CustomMessage :(ispolzyu cvoi message from sysmessages s parametrami exec sp_addmessage @msgnum =50011 ,@severity =10, @msgtext ='The current database name: %s ,object: %s . Customer %s already exists.') [i]The current database name: par1 ,object: par2 . Customer par3 already exists. kak mne cdelat" tak chtobi etot system message voovshe ne poiavlialcia na client a client videl tol'ko moi custom message ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.09.2002, 23:02:50 |
|
||
|
raiserror
|
|||
|---|---|---|---|
|
#18+
Делать проверку вначале - перед вставкой в таблицу проверять на наличие такого кастомера. -- Слон ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 18.09.2002, 01:40:03 |
|
||
|
raiserror
|
|||
|---|---|---|---|
|
#18+
to Слон Делать проверку вначале - перед вставкой в таблицу проверять на наличие такого кастомера. a kak she unique index ? on avtomatichecki proveriaet pered insert kak ia cdelala : ia ego ybrala i teper" rykami proveriay pered Insert If exists ( select...) raiseerror(custom) if NOT exists insert teper' client vidit tol'ko moi Error message No xotelos" bi kracivo , chtobi unique index proverial a ne rykami ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 18.09.2002, 19:21:40 |
|
||
|
raiserror
|
|||
|---|---|---|---|
|
#18+
В SQL2000 можно использовать instead of триггеры, в семерке - не знаю. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 18.09.2002, 19:24:30 |
|
||
|
|

start [/forum/topic.php?desktop=1&fid=46&tid=1820240]: |
0ms |
get settings: |
5ms |
get forum list: |
12ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
46ms |
get topic data: |
6ms |
get forum data: |
2ms |
get page messages: |
22ms |
get tp. blocked users: |
1ms |
| others: | 213ms |
| total: | 311ms |

| 0 / 0 |
