Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Script to import data from SqlServer database - Script di importazione dati da database SqlServer

I wanted to know the basis for the script to import data from a databse (SqlServer) that is present on another machine but within the subnet. Also if you require a driver to be able to connect to the database?

thanks


----------------------------------

Volevo sapere lo script base per poter importare dati da un databse(SqlServer) che è presente su un'altra macchina ma all'interno della sottorete. Inoltre se richiede un driver per potersi connettere al database?

Grazie

7 Replies
Gysbert_Wassenaar

Yes, you need an odbc or oledb driver for SQL server installed on the system where Qlikview is installed. In the script editor in Qlikview you can click on the Connect button the create a connection string for your database. Next you click on the Select button to create select statements to load data from your SQL server into Qlikview. Once you've added these load/select statements you can click the Reload button to load the data.


talk is cheap, supply exceeds demand
Not applicable
Author

ok, the process connection wizard does not allow me to be able to specify the path to get to another machine. I'm asking if someone could kindly postarmi the script on the database connection locally but not on another machine (PC).
thanks

Gysbert_Wassenaar

When connection to a SQL Server database it does not matter if SQL Server is installed locally or on another machine. You connect to SQL Server, not to database files. The SQL Server will process your requests. If you don't know how to connect to a SQL Server instance using OLEDB perhaps you can ask your local friendly DBA to help you. Or search the internet for one of hundreds of tutorials.


talk is cheap, supply exceeds demand
Not applicable
Author

In the steps to make the connection to the database is required for the database user and psw and up to here everything is fine, then asks the database instance that obviously being on another PC I can not see it among those available.
My question is how do I pass the instance with which you want to connect?qlik import.png
Thanks

Gysbert_Wassenaar

That's the ODBC Dialog. For ODBC you first need to define an ODBC Data Source using the ODCB Admin utility. One issue with ODBC is that on a 64-bit system there are two ODBC Admin utilities and connections defined in 32-bit won't show up in the 64-bit version and vice-versa. You can find both in the Tools menu in the script editor in Qlikview.  In Qlikview on a 64-bit OS you also need to check the option Force 32 Bit if you need to use a 32-bit driver. I suggest you use OLEDB instead.


talk is cheap, supply exceeds demand
maxgro
MVP
MVP

la procedura è guidata; ci sono varie possibilità (oledb, odbc, 32, 64, ...), prova con oledb 32 come da immagine e segui il wizard (ti chiederà ip o nome dell'altra macchina, database, eventuale utenza/pwd sql server se non usi l'autenticazione integrata)

1.png

ed alla fine otterrai nell'editor una stringa simile a quella sotto; server per la connessione al db quando effettui il reload; in bold i parametri variabili; in teoria, se hai il driver 32 bit (OLE DB provider for Sql Server), basterebbe copiarsi la stringa e cambiare i parametri

OLEDB CONNECT32 TO [Provider=SQLOLEDB.1;Persist Security Info=True;User ID=user;Initial Catalog=database;Data Source=10.0.99.116;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False;Password=pwd];

Not applicable
Author

Grazie per i consigli.

Sono riuscito a fare qualche passo in avanti in quanto sono riuscito a importare dei dati da un db residente su un 'altra macchina. Adesso volevo provare a collegarlo a un DB Progress pero' con i driver che dispongo non ci riesco (che sono quelli che si possono vedere nellimmagine riportata sotto).

Sapete aiutarmi dove poter scaricare il driver OleDb per Progress?

Inoltre come faccio ad associare i dati e le tabelle una volta che le ho importate?

GraziedriverQlik.png