Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Connect to SQL DB and get Row Count of a Table

Hi Guys,

Good Morning.

I am new to QlikView. I want to connect to a MS SQL Server Database and get the total rows count of a particular table through scripting in QlikView.

In SQl I would do it Like this  : Select count(*) From Table1 . This returns the total no.of rows in Table1.

Thanks in advance for the help..

Regards,

Krunal. Shaholia

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Did you install your ODBC driver using system DSN for your sql server db? Once you establish ODBC you can just run the script in your Qlikview like below:

TotalRowCnt:

LOAD *;

SQL Select Count(*) AS TotalRows

         From Table1;

View solution in original post

4 Replies
vishsaggi
Champion III
Champion III

Did you install your ODBC driver using system DSN for your sql server db? Once you establish ODBC you can just run the script in your Qlikview like below:

TotalRowCnt:

LOAD *;

SQL Select Count(*) AS TotalRows

         From Table1;

Anonymous
Not applicable
Author

Dear Vishwarath,

Good Morning.

Thanks for all your help. I script code that you have sent is working fine and that is what I was looking for.

Thanks & Regards,

Krunal.Shaholia.

Anonymous
Not applicable
Author

Hi Vishwarath,

Good Morning.

The script code that you have provided is working. Thanks for your help.

Regards,

Krunal. Shaholia

Manish_Kumar_
Creator
Creator

hi@vishsaggi  

Your solution works perfect!

I have further question that-

Will this count function in SQL take same time to execute as it will take to load entire table with just one field to get the row count!!?

Manish Kumar, Senior Business Analyst