Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Inserting the data in DESC column

Author  Topic 

skas502
Starting Member

6 Posts

Posted - 2007-10-17 : 22:18:31
I have a column name "DESC" in SQL Server table and I am getting an error when trying to insert data into this column. I cannot rename this column as it's not in my hand.

Please anybody reply me with good solution I am new to SQL.

Thanks

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-10-17 : 22:31:40
use brackets - [DESC]
looks like a reserved word issue..

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

Zoroaster
Aged Yak Warrior

702 Posts

Posted - 2007-10-17 : 22:31:56
Please provide the error, you are probably having difficulty due to the fact that DESC is a reserved word. Typically you just need to put [ ] around the column name to resolve this. For example:

INSERT TABLE([DESC])
VALUES ('Test')




Future guru in the making.
Go to Top of Page

skas502
Starting Member

6 Posts

Posted - 2007-10-17 : 22:40:54
Wow very quick replies! It worked! Thanks!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-18 : 05:27:11
Also aovid using reserved words and spaces in the object names

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -