Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SQL Server 2012 Tables

I downloaded and installed the trial version of SQL Server 2012. I added the database AdventureWorks2012

found at:

http://blog.sqlauthority.com/2012/03/15/sql-server-install-samples-database-adventure-works-for-sql-...

AdventureWorks2012 Data File  http://msftdbprodsamples.codeplex.com/releases/view/55330#DownloadId=165399

I followed the installation instructions using SQL Server Management Studio. I deleted the .ldf file from the Add Database

interface since it was not provided; the .ldf file was appropriately created and the AdventureWorks2012 added to SQL Server 2012.

I then created an ODBC connection to the AdventureWorks2012 DB.

When I Query the database from SQL Server Query in SQL Server Management Studio, for example:

use AdventureWorks2012

select * from Person.Address

data is returned, however when I create a QlikView ODBC connection to AdventureWorks2012 NO Tables are displayed.

If I check the checkbox for Show System Fields, the fields are displayed.

Am I missing something here? I had no difficulty working with an Excel Spreadsheet, but I just can't get this

ODBC connection to work in QlikView (Version 11.00.11282.0 SR1 64-bit Edition (x64).

See images Attached. Note that the table that I am viewing in SQLQuerys is: Person.Address

Thank you in advance for your assistance.

Frank

1 Solution

Accepted Solutions
garystrader
Partner - Creator III
Partner - Creator III

I understand your enhancement now.  That's a good idea.  Click on the "Ideas" button at the top of this page.  I can attest that QlikTech really does read and incorporate the ideas that people submit.

View solution in original post

8 Replies
garystrader
Partner - Creator III
Partner - Creator III

This isn't a QlikView issue.  When you attach an MDF file with SQL Server, it doesn't properly hook up security to your local users. Since that database was created somewhere else, it has a different user list with different SIDs.  You can probably query the table in SSMS because that user is a member of the sysadmin role.  The issue is likely that the user you're trying to connect with via ODBC doesn't have permission to view the schema or objects in the database that you just attached.  Is the user in ODBC different than the user you're connecting to with SSMS?

Not applicable
Author

OK. Still not working; let me tell you what I tried. In SSMS I viewed the data with the sa user so that is still working correctly. I deleted and recreated the ODBC source with the sa user. I checked the security properties on the database (mdf) and log file (ldf); users all had full permissions; I even added additonal users including Everyone, Owner and User and gave them full permissions. I again tried to view the tables in QlikView but am still getting the same result. I can see the system files, but not the tables in the database. I'm hoping that I understood your comment correctly; I'm very new to QlikView. So, in conclusion, I'm still in the same state as far as not being able to view the database tables via ODBC connection in the AdventureWorks2012 DB, though, as I mentioned I can see the system files when I check the checkbox.  Thanks in advance for any additional support.

garystrader
Partner - Creator III
Partner - Creator III

When you set up the ODBC source, are you testing the connection to make sure it works?

Have you set up a "default database" so that when the user connects, they are in the context of that database?  If not, you can always issue a "USE AdventureWorks2012" as the first statement in your SQL command.

By the way, those systems tables in your screenshot are QlikView internal system tables and have nothing to do with your data source.

I think I just realized what your issue is.  After your connect statement you have no "SQL select * from foo" load statement.  After you create the CONNECT statement, click on the "SELECT" button in the load script dialog.  That will build your select statement via a wizard.  You have to load data into QlikView before you can see it in the QlikView table/field dialogs.

Not applicable
Author

Not applicable
Author

For some reason this didn't end up in my reply to the email so I'm posting it again:

Yes, I did set the default database in the ODBC setup to    AdventureWorks2012.

   

    I finally got it working somewhat with the following script thanks    to your suggestions. The only thing I wonder is if there is a faster    way than to create each select statement individually. I'm not able    to multi-select the database tables (seems like that would be a good    enhancement), and SQL SELECT * FROM AdventureWorks2012.Person.*    doesn't work either.

   

    Since neither of those approaches worked I needed to select each    Person table individually; I'd have to do the same for the    Production.*, Purchasing.*, and Sales.* tables as well which could    be somewhat time consuming.

   

    Is there another way? Personally, I'd like to see a multi-select    list for the Database Tables.

   

    Thanks so much for your help!

   

    If you would, and anyone in this community is invited as well, to    connect with me on LinkedIn, you can do so at:

    http://www.linkedin.com/in/frankjgalan

    fgalan27@gmail.com (for purposes of LinkedIn connection only)

   

    Code that Finally Worked! tyvm:

    ODBC CONNECT TO AdventureWorks2012 (XUserId is AMFdaZFMXE, XPassword    is ZNBDHZMGHKYYGDBGXJVB);

   

    SQL SELECT *

    FROM AdventureWorks2012.Person.Address;

   

    SQL SELECT *

    FROM AdventureWorks2012.Person.AddressType;

   

    SQL SELECT *

    FROM AdventureWorks2012.Person.BusinessEntity;

   

    SQL SELECT *

    FROM AdventureWorks2012.Person.BusinessEntityContact;

   

    SQL SELECT *

    FROM AdventureWorks2012.Person.ContactType;

   

    SQL SELECT *

    FROM AdventureWorks2012.Person.CountryRegion;

   

    SQL SELECT *

    FROM AdventureWorks2012.Person.EmailAddress;

   

    SQL SELECT *

    FROM AdventureWorks2012.Person.Password;

   

    SQL SELECT *

    FROM AdventureWorks2012.Person.Person;

   

    SQL SELECT *

    FROM AdventureWorks2012.Person.PersonPhone;

   

    SQL SELECT *

    FROM AdventureWorks2012.Person.PhoneNumberType;

   

    SQL SELECT *

    FROM AdventureWorks2012.Person.StateProvince;

garystrader
Partner - Creator III
Partner - Creator III

What you're suggesting is not normally something that people do when building a QlikView data model, because some care has to be taken in building the data model.  It's because of the way the associative data model works, you can't just dump a bunch of tables into it.  You have to be careful in the way that you associate (join) the tables.

The other reason that won't work in QlikView is that everything after the SQL keyword is a pass-through query.  SQL SELECT * FROM AdventureWorks2012.Person.* is not interpreted by QlikView, it's passed directly to SQL Server, and that is not legitimate T-SQL syntax.

Not applicable
Author

Hi Gary,

Yes, understood, and thank you so much for your help. The test that I did for SQL SELECT * FROM AdventureWorks2012.Person.*, was simply that, a test to see if this would work as a way for me to get started with some tables in QlikView. If it actually worked, in some cases where there were only a few tables this might be useful, in the example above it was only useful as a test.

My enhancement suggestion for a multiselect listbox was more serious. What I envisioned here was to be able to select multiple rows in the Data Tables and as you say "care has to be taken in building the data model."  Multiple tables could be carefully selected in the Data Tables list box, separate SQL statements would then be generated as though one had chosen each table individually as it works currently. This enhancement would reduce the number of mouse clicks needed to select and generate the SQL for the tables of interest.

I'd like to suggest this enhancement to the QlikView development team. Do you know how to get in touch with them?

Thanks again for your help and advice; I greatly appreciate it.

Frank

garystrader
Partner - Creator III
Partner - Creator III

I understand your enhancement now.  That's a good idea.  Click on the "Ideas" button at the top of this page.  I can attest that QlikTech really does read and incorporate the ideas that people submit.