Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select

Status
Not open for further replies.

danalynn

Programmer
Jun 12, 2001
25
0
0
US
i am using my select statement to find my prop number in my data base, it won't let me call it prop number in my select statement but that is the name of the column, how do i call it or how do i fix it so i can call it propnumber?

thanks

dana
 
Hi Dana.
Its bad practice to have column names that include spaces but if that is what you are forced to work with the following syntax should work:

select [prop number]
from table

If you want to change your column names, you can do so in Enterprise Manager. Right click on your table and select 'Design table'. You can change the column names here.
 
thank you so much worked like a charm

dana
 
well i am using a database from access that was created a long time ago, and just imported it to sql, so wasn't my choice. is there anyway that i can go in and fix the column names?

dana
 
Sure. If you have access to Enterprise Manager, you can easily change the column names. Keep in mind, SQL will allow you to use spaces - as long as you use brackets - I just find it to be extra work.

To change a column name,
1. Open Enterprise Manager
2. Register your server (if this has not already been done)
3. Expand the server and database directories and click on 'Tables'
4. Right click on the appropriate table and select 'Design Table'
5. Change your column names

Just be careful to take note of any dependent objects such as Views and Stored Procedures. These objects will not be automatically updated so you may want to analyze the amount of work this will include before taking on a 'renaming' task.

Good luck.
Michelle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top