| |

VerySource

 Forgot password?
 Register
Search
Author: zuoshou

Please give me ideas

[Copy link]

3

Threads

15

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2020-5-18 18:15:02
| Show all posts
I wrote it like this:
string [] ary = this.ViewState ["卡号"] .ToString (). Split (',');
What should Sql write?
Reply

Use magic Report

0

Threads

14

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-5-19 22:45:01
| Show all posts
CREATE PROCEDURE Test
    @idString NVARCHAR (1000)
AS
    DECLARE @sql NVARCHAR (2000)
    --If the card number is a string
    set @idString = '' '' + replace (@idString, ',', '' ',' '') + '' ''

    SET @sql = 'select * from Users where card number in (' + @idString + ')'
    exec @sql
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