|
|
|
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?fid=46&fpage=3371&tid=1818552]: |
0ms |
get settings: |
8ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
52ms |
get topic data: |
8ms |
get forum data: |
3ms |
get page messages: |
39ms |
get tp. blocked users: |
2ms |
| others: | 192ms |
| total: | 322ms |

| 0 / 0 |
