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?
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.
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?
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.