Search
 
SCRIPT & CODE EXAMPLE
 

SQL

connect to ssms with python

import pyodbc 
conn = pyodbc.connect('Driver={SQL Server};'
                      'Server=server_name;'
                      'Database=database_name;'
                      'Trusted_Connection=yes;')

cursor = conn.cursor()
cursor.execute('SELECT * FROM database_name.table')

for row in cursor:
    print(row)
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql select tables with name like 
Sql :: oracle sql merge 
Sql :: convert sql to relational algebra 
Sql :: date_part mysql 
Sql :: psql get table data types 
Sql :: mysql alter table add column first 
Sql :: replace string value in sql 
Sql :: create table postgresql foreign key 
Sql :: postgresql create query 
Sql :: login to mysql database 
Sql :: get date from timestamp oracle 
Sql :: apex set debug level 
Sql :: create table in microsoft sql server 
Sql :: phpmyadmin reset root password 
Sql :: t-sql delete view if exists 
Sql :: mysql replace string in table 
Sql :: mysql regexp_replace remove html tag 
Sql :: Postgresql get diff between two dates in Months 
Sql :: replace null in sql 
Sql :: postgresql check privileges on schema 
Sql :: read all columns of a table sql 
Sql :: update table from another table 
Sql :: laravel general error 2006 mysql server has gone away 
Sql :: postgresql combine values in one field 
Sql :: check index sql server 
Sql :: mysql add column to table 
Sql :: update one column from another column in same table 
Sql :: PSQL use LIKE with timestamps 
Sql :: sql server date format yyyy-MM-ddThh:mm:ss 
Sql :: mysql declare variable 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =