Here are a couple queries that you might find useful to get you started; assuming you are using SQL Server 2k or greater:
<cfquery name="qTables" datasource="dsn"> SELECT * FROM INFORMATION_SCHEMA.TABLES ORDER BY table_name </cfquery> <cfquery name="qColumns" datasource="dsn"> SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '#tablename#' </cfquery> <cfquery name="qColumnConstraints" datasource="dsn"> SELECT * FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE WHERE TABLE_NAME = '#tablename#' </cfquery> -----Original Message----- From: David Gardner [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 10, 2007 10:17 AM To: SQL Subject: Need to Read SQL Data Structure using CFQuery I can't remote in to my web host because they've changed the password. While my folks work to get that fixed, I was wondering if there was a table I could query to get info on the data structure of the tables. I can FTP a CFM file up and use CFQuery to access the data. In Access, years ago, you could get info from the "SysObjects" table. Is there a counterpart in SQL Server? (Unfortunately, I don't know what version of SQL Server, but I'm thinking very recent.) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2861 Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6
