|
|
|
Create Procedure
|
|||
|---|---|---|---|
|
#18+
Люди умные,помогите,не получается написать процедуру,точнее вывести ID. USE Northwind GO Create Procedure FindProductID @id int=Null Output,@productname nvarchar(40) AS Begin Tran IF Exists(Select @id=ProductID From Products Where ProductName=@productname) begin IF @@rowcount<>1 begin Set @id=0 Rollback Tran Return end Else Print 'Not exists' end Commit Tran GO ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.11.2002, 20:52:12 |
|
||
|
Create Procedure
|
|||
|---|---|---|---|
|
#18+
Я так понимаю транзакцию вы используете для блокировки таблицы на время выполнения запроса ? Код: plaintext 1. 2. 3. 4. 5. 6. 7. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.11.2002, 21:12:36 |
|
||
|
Create Procedure
|
|||
|---|---|---|---|
|
#18+
А потупее нельзя ? :-) Create Procedure FindProductID @id int=Null Output,@productname nvarchar(40) AS begin select @id=ProductID From Products Where ProductName=@productname if isnull(@id,0)=0 begin Print 'Not exists' end end ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.11.2002, 21:15:16 |
|
||
|
|

start [/forum/topic.php?desktop=1&fid=46&tid=1818552]: |
0ms |
get settings: |
6ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
65ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
38ms |
get tp. blocked users: |
1ms |
| others: | 229ms |
| total: | 370ms |

| 0 / 0 |
