Я получаю эту ошибку при вызове хранимой процедуры, которая принимает возвращающие табличное значение параметры. Я использую библиотеку pyms sql Python для подключения к серверной БД ms SQL. Вот фрагмент кода.
query = '''
DECLARE @coltvp1 AS ColType;
INSERT INTO @coltvp1 (columnName)
SELECT 'Language' UNION SELECT 'Browser'
DECLARE @FilterTVP1 AS filterType;
INSERT INTO @FilterTVP1 (tblname,colname ,value )
SELECT 'Geo', 'Country','japan' UNION SELECT 'Geo', 'Country','Malaysia' UNION SELECT `'Geo', 'Country','South Korea' UNION SELECT 'Pov', 'PurposeOfVisitHierarchyLevel2','Account' UNION SELECT 'Pov', 'PurposeOfVisitHierarchyLevel2','Purchase' UNION SELECT 'Segment', 'Segment','All' UNION SELECT 'Site', 'SiteLevel2','Dell EMC' UNION SELECT 'Site', 'SiteLevel2','Dell Technologies Cloud' UNION SELECT 'Site', 'SiteLevel2','Dell Technologies Other'`
Declare @Process_Name VARCHAR(4000) = 'CSAT'
,@PageNumber INT = 1
,@PageSize INT = 100
,@Start_Date DATETIME = '2018-01-01 00:00:00'
,@End_Date DATETIME = '2018-01-10 00:59:59'
,@Attribute_List NVARCHAR(MAX) = '*'
,@TotalCount BIGINT
exec API_Extract @coltvp1,
@FilterTVP1,
@Process_Name,
@PageNumber,
@PageSize,
@Start_Date,
@End_Date,
@Attribute_List,
@TotalCount OUTPUT
select @TotalCount as TotalCount
'''
conn = pymssql.connect(host, user, password, database, as_dict=True)
cursor = conn.cursor()
cursor.execute(query)
resultset = cursor.fetchall()
print(resultset)