473,549 Members | 3,099 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying SQL Database Column Names?

How might one go about this. I know how to select data records, but suppose
I wanted to fill a datagrid with the column names in a specified table? How
would I start?

TIA

Harry
Nov 15 '05 #1
3 10063
I'm sure there is some DataSet or DataTable object that will do this
for you. But since I haven't used any of those, here's a simple query
you can run to get the column info for a table.

select * from syscolumns
where id = object_id('Some Table')

Jonathan Schafer

On Thu, 7 Aug 2003 17:58:16 -0700, "Harry Whitehouse"
<ha***@envmgr.c om> wrote:
How might one go about this. I know how to select data records, but suppose
I wanted to fill a datagrid with the column names in a specified table? How
would I start?

TIA

Harry


Nov 15 '05 #2
Perfect Jonathan! Thanks so much!

Harry
Nov 15 '05 #3
You can query a database about pretty much anythinhg, tables, datatypes,
etc. How do you thing Toad or Erwin work?

"Harry Whitehouse" <ha***@envmgr.c om> wrote in message
news:Or******** ******@tk2msftn gp13.phx.gbl...
How might one go about this. I know how to select data records, but suppose I wanted to fill a datagrid with the column names in a specified table? How would I start?

TIA

Harry

Nov 15 '05 #4

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

Similar topics

1
1766
by: Rick | last post by:
I have the following stored procedure in SQL 2000 and would like to diplay the database name where data is drawn from. I'm using 4 databases db1, db2, db3, db4 which all have the same table (Table1) with identical column names (Surname, GivenNames). CREATE PROCEDURE . @varSurname VARChar(25) AS Select a.Surname, a.GivenNames From ..Table1...
13
3589
by: Aladdin | last post by:
I have an MS Access form on which I have a listbox listing tables in that database. I want to be able to click on any of those tables and view its contents on the same form using subforms or any grid control. I tried many grid controls (DBGrid, DataGrid, MSFlexGrid), the ADO Data Control and everything I can think of, with no success. Here...
7
14658
by: What-a-Tool | last post by:
Have an Access table loaded into a DataTable that was created at run time, and am displaying these contents in a data grid. Me.dgGames.DataSource = Me.DsGameInfo.Tables("Games") I would like to display only a selected few of the columns, rather than the whole table. Is this possible? Thanks - Sean
12
1554
by: Ben | last post by:
If I have have the table: create table foo ( a int references bar(id), b int references baz(id) ) .... how do I make sure one and only one of the columns a and b are non-null? Is it even reasonable?
6
14879
by: Marcel Hug | last post by:
Hi all ! I have a table in my database, which has 3 attributes. IDFailureControl, ControlDate and ControlVersion. In the following function I test, if the date of today allready exists. Then I would like to write the new ControlDate or Version into the database. First i update the dataset, then i create a Insertcommand and call the...
10
4264
by: shsandeep | last post by:
The ETL application loaded around 3000 rows in 14 seconds in a Development database while it took 2 hours to load in a UAT database. UAT db is partitioned. Dev db is not partitioned. the application looks for existing rows in the table...if they already exist then it updates otherwise inserts them. The table is pretty large, around 6.5...
4
83565
by: mailsumit | last post by:
I would like to know the SQL statement for displaying only the column names of a particular table. For eg. if I have a table by the name DETAILS and it has three columns FIRST_NAME, LAST_NAME and DT_OF_BIRTH, using what SQL statement can I display only the column names and not their content ?
10
5725
by: gnewsgroup | last post by:
I've googled and tried various approaches, but could not resolve this problem. The article at MSDN: Displaying Images in a GridView Column only presents a simple case where all data (including the images) of the gridview come from a single table/datasource. Here is my situation. In my web application, I need to display customer bills info...
1
4185
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being aligned to the top, along with the slideshow and link buttons, you have to scroll down to see the text - how can I make IE6 display correctly? ...
0
7520
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7956
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7470
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7809
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6041
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1936
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.