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.
| Author |
Topic |
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2005-12-22 : 09:09:15
|
| i have addeda column to a tablein the middle of the table,when i did it and i run a view which is total independet of the new column i got wrong result!when i open the view made a space (with the space bar) andsaved it again everything worked agin fine! (klike i made some sort of refresh!)why is that?how can i avoid this problem?thnaks in advancepelegIsrael -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-12-22 : 09:15:30
|
it doesn't matter where in the table you added a column.so your problem is elsewhere.Go with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-12-22 : 09:26:12
|
| When you do changes via EnterPrise Manager you need to referesh the objects if you changed any. It is better to make use of Query AnalyserMadhivananFailing to plan is Planning to fail |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
|
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2005-12-25 : 01:54:49
|
| but what if the changed table is contains in 20 diffrent views?do i need then to sp_refreshview all of them?Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2005-12-25 : 10:18:54
|
| This is why you shouldn't SELECT * from a table in a view. |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-12-25 : 10:20:10
|
>>do i need then to sp_refreshview all of them?yesThese things may have avoided you problem:use an explicit column list to define your views (instead of "select *")Use query analyzer to alter tables. One reason to use QA is so that new columns are appended to the end of the table instead of inserted between existing columns.EDIT:merry x-mas!Be One with the OptimizerTG |
 |
|
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2005-12-25 : 14:31:04
|
| i didnt user select * anywhere!so wahat to do?and if i inserted it last it whpuld have avoided the problem of refresh?Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
 |
|
|
|
|
|