Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

PBI TO SQL

#hide_output
import sqlalchemy


from sqlalchemy import create_engine, MetaData, Table, select


from six.moves import urllib


params = 

    urllib.parse.quote_plus('DRIVER=ODBC Driver 17 for SQL Server;SERVER=localhost;DATABASE=pbi;trusted_connection=yes'

                            )



engine = sqlalchemy.create_engine('mssql+pyodbc:///?odbc_connect=%s'

                                  % params, echo=False)


connection = engine.raw_connection()


dataset.to_sql(name='from_pbi2', con=engine, index=False,

               if_exists='append') // or 'replace'
Source by pawarbi.github.io #
 
PREVIOUS NEXT
Tagged: #PBI #TO #SQL
ADD COMMENT
Topic
Name
5+6 =