Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SQL Server Error 3041 with BACKUP SERVER statement #299

Open
Assignees
sumitmsft
Labels
triage neededFor new issues, not triaged yet.
@gordthompson

Description

@gordthompson

Describe the bug

The following known issue with pyodbc also exists with mssql-python

mkleehammer/pyodbc#1431

To reproduce

importmssql_pythonmssql_python.setup_logging()cnxn=mssql_python.connect("SERVER=192.168.0.199;""DATABASE=master;""UID=scott;PWD=tiger^5HHH;""TrustServerCertificate=yes;")cnxn.setautocommit(True)crsr=cnxn.cursor()fordb_namein ["test","test2","test3"]:ifnotcrsr.execute("select name from sys.databases where name = ?",db_name).fetchval():sql=f"CREATE DATABASE{db_name}"print(sql)crsr.execute(sql)crsr.execute("ALTER SERVER CONFIGURATION SET SUSPEND_FOR_SNAPSHOT_BACKUP = ON;")crsr.execute("BACKUP SERVER TO DISK = '/var/opt/mssql/backup/metadata/backup_1.bkm' WITH METADATA_ONLY, FORMAT;")

Expected behavior

The backup should succeed, as it does with ADODB (VBScript). For details, see

mkleehammer/pyodbc#1431 (comment)

Further technical details

Python version: 3.13
SQL Server version: SQL Server 2022
Operating system: Windows 11

Additional context
Client-side log:

mssql_python_trace_20251018_090446_10824.log

Server-side errorlog:

errorlog.txt

Metadata

Metadata

Assignees

Labels

triage neededFor new issues, not triaged yet.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp