| |

VerySource

 Forgot password?
 Register
Search
Author: ggggex

Ask someone to write a .NET stored procedure. I don't know where to start ...

[Copy link]

0

Threads

23

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-6-19 22:45:01
| Show all posts
The stored procedure does not matter C# and VB, both are SQL SERVER
Write successfully, call with C#

Do it with a name

create proc proc1
@prod_id varchar(10)
as
if exists(select prod_id from prod where prod_id = @prod_id)
--Perform update operation
begin
update prod set num = num + 1
end
else
- Perform an insert operation
begin
insert into prod(prod_id,num) values
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-6-20 01:45:01
| Show all posts
Run the above stored procedure in query analysis and call it in .cs
Reply

Use magic Report

4

Threads

24

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

 Author| Post time: 2020-6-21 13:30:02
| Show all posts
Ah `Go crazy!

Mine is ms Sql Server ManageMent Studio
I wrote `Such a paragraph` in query analysis
CREATE PROCEDURE searchkey @key varchar(50) output AS
IF (SELECT * FROM aspnet_HotSearch WHERE KEY = @key) BEGIN
    UPDATE aspnet_HotSearch
     SET Count = Count + 1
     WHERE KEY = @key END ELSE BEGIN
                                INSERT
                                 INTO aspnet_HotSearch(KEY, Count)
VALUES (@key, 1) END GO

When the result is validated in the grammar, the query containing the function cannot be verified
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list