Skip to content
Advertisement

Tag: sql-server

Connect to SQL Server in Python with ReadOnly

I am trying to connect to the SQL server in python using pyodbc. I am unable to connect because my database is ReadOnly. I tried the solutions provided at other link: But, I am still getting the following error: ProgrammingError: (‘42000’, “[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]The target database (‘PRMOperationalDB’) is in an availability group and is currently accessible for

How can I Insert multiple rows with one query

I made a code allowing me to GET data from an API and insert it into a database. But I encounter a problem my api contains about 20 million data and to insert everything in my database it will take me 43 days 🙂 I think the problem comes from the fact that I insert the data one by one.

How to apply max function in a join query?

I am new to SQL Server, I have 3 tables consider an employee table empid name location 1 abc USA 2 efg UK Another table named location-table location holidaycode uk uk1 usa usa1 And also holidaytable: holiday-code date type uk1 2022-01-01 LM uk1 2022-01-01 RMC Expected result is: empid location holidaycode date type 1 2 uk uk1 2022-01-01 RMC suppose

Same ID with multiple records to single row

I have two tables. Table A look like this. source ID Type_ID Error_info ABC 100 1 country column missing ABC 100 2 conversion factor missing decimals BCA 200 1 error value in height column BCA 200 2 convertion factor should be 0.001 Table B look like this. source ID Type_1_ID Error_info_1 Type_2_ID Error_info_2 ABC 100 BCA 200 I want to

Advertisement