
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vishwarath,
Good Morning.
The script code that you have provided is working. Thanks for your help.
Regards,
Krunal. Shaholia

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!!?
