Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Salesforce.com:  How to find all tables and columns?  (like SQL sys.tables, sys.columns)

Posted on 2014-11-04
2
891 Views
Last Modified: 2016-02-17
Hi All

I've inherted an SSIS package where the data source is salesforce.com, using the Pragmatic Works controls TFSalesForce Source / Destination.

Ten tables, some of these tables have 700+ columns, and my client tells me that these change every once in awhile.

Question:  What's the salesforce.com SOQL to 'find all tables and columns', similar to SQL Server sys.tables and sys.columns?

Thanks in advance.
Jim
0
Comment
Question by:Jim Horn
2 Comments
 
LVL 39

Assisted Solution

by:lcohan
lcohan earned 200 total points
ID: 40421672
I'm a beginner in this "cloud" of the "cloud" as well and looks like Salesforce.com is the most "secretive" of all that actually share the same "database" infrastructure and architecture on the backend << http://www.dbms2.com/2011/09/15/database-architecture-salesforce-com-force-com-and-database/ >>

and here's what I use to learn and dig in the background:

http://developer.force.com/cookbook/recipe/retrieve-a-list-of-objects-using-apex
0
 
LVL 65

Accepted Solution

by:
Jim Horn earned 0 total points
ID: 40457708
Answered when I asked the question here:

There's so such equivalent in salesforce. Fields and tables are exposed through metadata describe calls, not through the platform's query language. However, there are app exchange apps that can convert metadata into custom tables that you can query normally. Note that this is essentially cached data, so you'll have to periodically run a process that updates this cache.

Edit:

App Exchange Apps are apps hosted on the site http://appexchange.salesforce.com/, which can be installed by administrators into any organization that the package supports, possibly for an additional one-time or per-month fee.

The query you could use would be dependent on the package being used, but it would probably look something like this:

SELECT PKG__FieldType__c, PKG__FieldLength__c, PKG__DefaultValue__c, ... FROM PKG__Field__c
The exact semantics will vary by type, so you'll have to read the documentation or look at the data structures installed post-installation.

Updating the cache also varies by package. For example, one such app I tested had a Visualforce page with a button that a user could click to kick off the process. Other apps might use some scheduled process to update records every night or use some other process.

The first solution was not something that I could impliment.
Either way, lowering points / accepting for the effort.

Thanks.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question