Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
RichardLee
Creator
Creator

Can you load a Table with out the Data and just Column Names

I would like to Load the Tables from a program and List all the columns in the Tables. I know How to list the Columns from all the Tables Loaded in the View but what I would like to do is load the Tables with no Data so I just have the Column Names.

 

Is this possible.

Labels (1)
1 Solution

Accepted Solutions
NadiaB
Support
Support

Hi @RichardLee 

If you are getting this directly from a DB you will need to find the appropriate syntax, for example, for SQL Server  that uses Transact SQL it would be 

SELECT TOP 0 * From dbo.tablename

And there are similar depending of what data source you are getting the information from, so you could search fro the equivalent.

By any chance is there any reason that you are trying to get this? Maybe if we get more details about the business need we could provide other ideas/options. 

Hope it helps!

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm

View solution in original post

7 Replies
MartW
Partner - Specialist
Partner - Specialist

to only load empty tables you can do something like this: then just add this to a loop and make sure that you don't concatenate the tables if the header(column) names are the same.

TMP: 
first 1
LOAD *
FROM [lib://(storeageandfilename).qvd](qvd)
where 1 = 0
;

 

RichardLee
Creator
Creator
Author

Thanks for the reply but its not QVD files I will need to pull thins from its Direct from the dbo of the programs I will be using.

NadiaB
Support
Support

Hi @RichardLee 

If you are getting this directly from a DB you will need to find the appropriate syntax, for example, for SQL Server  that uses Transact SQL it would be 

SELECT TOP 0 * From dbo.tablename

And there are similar depending of what data source you are getting the information from, so you could search fro the equivalent.

By any chance is there any reason that you are trying to get this? Maybe if we get more details about the business need we could provide other ideas/options. 

Hope it helps!

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
RichardLee
Creator
Creator
Author

This is perfect. 

 

The reason I need this is to build Database Schema for multiple Systems from our new company acquisitions.

Each has a different software but I need to build an all in one report. So understanding each of them and how to pull the data is needed.

NadiaB
Support
Support

Hi @RichardLee 

If you just need to get table definition, the sys tables can be used, there are sys.tables and sys.columns tables for SQL, there are similar for other data sources, there are also pre defined Views and Stored Procedures that provide that information. 

Hope it helps!

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
RichardLee
Creator
Creator
Author

Is there any other way to do this as I've hit a stumbling block with Salesforce?