| Author |
Topic |
|
kashyapsid
Yak Posting Veteran
78 Posts |
Posted - 2010-04-07 : 01:56:09
|
| Hi,My question is how can i change the name of a table for exm:- empbonus as emp.bonusKaShYaP |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2010-04-07 : 02:04:16
|
| sp_rename empbonus ,[emp.bonus]Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-04-07 : 02:05:15
|
use sp_renameare you sure you want to use name containing dot ? emp.bonusyou will need to enclose the name in bracket when you reference the table [emp.bonus] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
kashyapsid
Yak Posting Veteran
78 Posts |
Posted - 2010-04-07 : 02:18:34
|
| Mr.Khtan Is there any problem occurs by using a dot between themKaShYaP |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-04-07 : 02:26:30
|
quote: Originally posted by kashyapsid Mr.Khtan Is there any problem occurs by using a dot between themKaShYaP
Yes. Special characters as re not allowed. If you use them use withing []MadhivananFailing to plan is Planning to fail |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-04-07 : 02:27:48
|
not really a problem it is just you need to use the bracket [ ] with the table nameselect *from [emp.bonus] instead of just select *from emp_bonus KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
kashyapsid
Yak Posting Veteran
78 Posts |
Posted - 2010-04-07 : 02:33:20
|
| select * from [emp.bonus] select*from emp_bonus in both cases the output will be same?KaShYaP |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-04-07 : 02:36:30
|
quote: Originally posted by kashyapsid select * from [emp.bonus] select*from emp_bonus in both cases the output will be same?KaShYaP
In my last post, i am giving an example of using a table name without the dot but underscore emp_bonus instead of emp.bonusif your table name is emp_bonus, you can reference the table name without using the []. If the table name is emp.bonus, you can't do a "select * from emp.bonus". you will need to use the [] "select * from [emp.bonus]" KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
kashyapsid
Yak Posting Veteran
78 Posts |
Posted - 2010-04-07 : 03:29:57
|
| MR.khtanA sincere Thanks to you for consideringKaShYaP |
 |
|
|
|