473,388 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

columns refered to in view

I have created a view with this query:

CREATE VIEW testview AS SELECT table.column AS col1, table2.column AS
coll2 FROM table, table2;

Later on, i want to get the table and column name that a field refers
to in this view. In other words i want to get the table and column that
the column 'col1' refers to. Im looking for 'table.column'. How can i
get this information?

thanks!
--
Alexander Cohen
http://www.toomuchspace.com
(819) 348-9237
(819) 432-3443
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
1 1221
On Wednesday 14 April 2004 14:59, Alexander Cohen wrote:
I have created a view with this query:

CREATE VIEW testview AS SELECT table.column AS col1, table2.column AS
coll2 FROM table, table2;

Later on, i want to get the table and column name that a field refers
to in this view. In other words i want to get the table and column that
the column 'col1' refers to. Im looking for 'table.column'. How can i
get this information?


If you're using 7.4, you can look in the information-schema:

SELECT * FROM information_schema.view_column_usage
WHERE view_name = 'foo_view';

This only lists columns that "show through" not calculated columns (AFAIK).
--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: Rich | last post by:
I'm sure it sounds kinda nutty to display 200 columns and 500,000 rows of data. But I have been pulling data from a Lotus Notes database into Sql Server for a while now, but Lotus Notes is...
2
by: Gary DeRousse | last post by:
Hello, Using SQL Server 2000, I'm trying to put together a query that will tell me the following information about a view: The View Name The names of the View's columns The names of the source...
5
by: Morten Mikkelsen | last post by:
Hi, On my SQL Server 2000, I have a table of data (tblAllData) containing a number of columns, some of which are 'secret'. I have to let some users access the database using ODBC from an Excel...
1
by: S. van Beek | last post by:
Dear reader, I try to switch between to columns in a form showing as datasheet view. The idée is to show one of the two columns in a datasheet. The problem is that the property visible...
3
by: BartMan | last post by:
Greetings, I have a gridview which is sitting on a multi view control (witin a view), and it is bound to a dataset which I dynamically apply to the control within asp.net page. The problem is...
9
by: serge | last post by:
/* Subject: How to build a procedure that returns different numbers of columns as a result based on a parameter. You can copy/paste this whole post in SQL Query Analyzer or Management Studio...
4
by: Mike | last post by:
I encountered this problem for the first time today while trying to add some columns to a query from a linked DBASEIII file. The new columns that I added on the design grid do not show up on the...
2
by: Ryan Liu | last post by:
Hi, If I have a very big view in database, it covers 15 tables, each table has 1000 columns. When I issue select * from view, the database will give error -- too many columns. Can I use a...
8
by: Sham | last post by:
I am trying to perform the following query on a table that has been indexed using Full Text Search. The table contains multiple columns than have been indexed. (Below, all xml columns are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.