I'm able to connect to SQL Server using SQL database name but my requirement is that I need to connect to sql server without connecting to database.
I've the following information available with me Port no., Instance name, db user/password, IP address.
My current command is this
engine_handle = create_engine('mssql+pyodbc://sa:pass@<IP address>/master', echo=False)
Now I'm able to connect because i've given db name - master but if i remove db name and give instance name or leave it altogether. i'll get the following error.
"engine = create_engine('mssql+pyodbc://sa:pass@IP address', echo=True)"
return self.dbapi.connect(*cargs, **cparams) DBAPIError: (Error) ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)') None None
It is ok If i can connect using instance name instead of DB name.
any help is appreciated.