OLEDB CONNECT32 TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=xxxx;Data Source=xxxx;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=xxx;Use Encryption for Data=False;Tag with column collation when possible=False];
and then select the table or view:
SQL SELECT * from tttt;
Even you can use EXEC to execute store procedures.
When you fetch data from SQL supported database, you usually use SQL Select after establishing the db connectivity; you can't load it directly from db using Load like: Load field from <SQL/Oracle/...database>. Once the data is loaded using SQL Select you can use qlikview functions to transform the data on the loaded data (Preceding Load/Rsident Load) using Load statement. Now your question might be about usability the detailing SQL commands in qlikview. To answer that, let's have a scenario where you have two tables in the database with billions of data and you are actually bothered about few hundreads of data that is the resultant JOIN of these two tables. One way is to fetch all(billions) data from these tables into qlikview and then do the filter and join in qlikvew using load. Second way could be fetching the resulttant few hundreads of source data into qv and then operate on it. The first option is obviously not suggested. Hence, to go with better optimized option you have to apply the filter and join statement during the data load from source itselfwhich is possible only using SQL Select statement. Therefore you write like: