[Netizen asked] How do I extract
I chose 2, 3, the generated SQL is SELECT * from Table Where FieldName in ('2', '3')
[User asked] If you need a stored procedure, if you need a stored procedure, you have no problem when you select a project in the list, but there will be a problem with two or more: Microsoft OLE DB Provider for SQL Server error '80040e14' Pass the number of parameters 2, and pass the following parameters in the form of '@Name = value'. Once the '@Name = value' form is used, all subsequent parameters must be passed in the form of '@Name = value'. In the use of stored procedures Select * from table where @fieldname = ('"& replace (" SELECT "),", ",", "", ",", ",", ",", ",", ",", the reason is @fieldname can not assign multiple values to the variables in the stored procedure once, only a single given. At this time, you may need to save multiple selected list values as a variable or array? But how to achieve? Please help again Solution, okay?!
[GRIEFFORYOU AX] 1. Treatment of numeric fields a. Stored Procedure Create Procedure SP_TEST (@ID varchar (1000)) AS
Declare @sql nvarchar (2000)
Set @ SQL = N'SELECT * from Book Where ID in (' @ID ') '- Generate SQL Statement EXEC SP_EXECUTESQL @ SQLGOB.ASP Program <% DIM Connstrdim CN, CMD, RSDIM ID
If Request.form ("Action") <> "" THEN "acquires the query condition ID = Replace (" SELECT "),", ",", ","), is not plus single query. Connection string connStr = "provider = sqloledb.1; password = sa; persist security info = true; user id = sa; initial catalog = book; data source = (local)" Creating Connection object set cn = server.createObject "Adodb.connection") 'connection database cn.open connStr' connection Command object set cmd = server.createObject ("adoDb.command") 'Sets the connection cmd.activeConnection = CN' setting command type for the Command Object ("AdoDb.command") 'Setting the command type for storedurecmd.commandType = 4 'Specify stored procedure name cmd.commandtext = "sp_test" set stored procedure parameters cmd.parameters.Append cmd.createParameter ("@ ID", 200, 1, 1000) cmd ("@ ID") = ID' Direct Assignment to the stored procedure parameter 'Execute a storage process Return record set SET RS = cmd.executeWhile Not Rs.eof response.write RS ("BookName" & "& RS (" Writer ") &"
"RS .MOVENEXTWENDRS.CLOSESET RS = NothingSet cmd = NothingCn.Closset CN = Nothingend IF
%>