以下为存储过程和python代码:
PROCEDURE GCname
AS
BEGIN
SET NOCOUNT ON;
declare @FG nvarchar(30)
SET @FG=''
select * from table where name1=@FG
END
PYTHON:
with connection.cursor() as cur:
cur.execute("exec GCname @FG='MARY'")
query_list = cur.fetchall()
cur.close()
Exception Value:
('42000', '[42000] [Microsoft][SQL Server Native Client 10.0][SQL Server]过程 GCname 没有参数,但却为该过程提供了参数。 (8146) (SQLExecDirectW)')