Skip to main content

Python

Connecting to SQL databse and inseting the data using Python



# Azure SQL Database connection details
server = 'ServrerName'
database = 'DatabaseName'  # Replace with your database name
username = 'UserId'
password = 'Password'
driver = 'ODBC Driver 17 for SQL Server'

# Create the connection string
connection_string = f'mssql+pyodbc://{username}:{password}@{server}/{database}?driver={driver}'

# Create the SQLAlchemy engine
engine = create_engine(connection_string)

# Insert the data into the Azure SQL Database

partspec_insert.to_sql('Part', con=engine,schema='LSQ', if_exists='append', index=False)








Comments

Popular posts from this blog

Convex Lens Vs Concave Lens

What is a Lens A lens is a transparent object that transmits light across it, and its working principle depends on the   law of refraction (Snell’s law) . Applications: Concave Lens help with Far-Sight Convex Lens help with Near-Sight

Herbal Plants

Herbal plants to grow in home Different types of keerai ----- http://www.indiandietrecipes.com/2016/03/pictures-of-various-types-of-greens-or.html Pirandai ----good for bone joins---- https://youtu.be/k2DGubyXLAE Valarai Keerai Benifits ----- https://youtu.be/33HIfLJKTqA Sesma seeds ---- https://easyayurveda.com/2011/02/24/sesame-and-sesame-oil-benefits-total-ayurveda-details/

What is Verbal and Non-Verbal communication

TYPES OF COMMUNICATIONS: