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 |
|
TheCurved
Starting Member
3 Posts |
Posted - 2011-08-24 : 00:43:10
|
Hello forum people, I hope someone out there can help me out with an issue I'm having. I've tried googling the problem but no luck.I am adding a new column to a table using the alter table syntax. This is updating all of the views that reference that table. The problem I am having is related to the views that use both the updated table and is joined to another table and has all of the updated tables columns referenced.What happens is that all of the columns that is listed in the view after the newly add column has an alias added but the alias references the previous column! So in .NET, using the example in the image I've attached, the code errors because returning the column "store" would actually give me the newly added column "accountemailaddress".The reason this is such an issue is because I have to update all the views (annoying) and there are hundreds of them. This is a major pain.Any help would be wonderful. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
TheCurved
Starting Member
3 Posts |
Posted - 2011-08-24 : 00:55:25
|
| Thanks for replying, the * is used in the views to return all of the columns. I am not the original coder so I do not know why the views are coded this way.Do you know of a way I can alter the table and not add the new column to theses views?There are far too many views to have to change each and everyone to not select *. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
TheCurved
Starting Member
3 Posts |
Posted - 2011-08-24 : 01:08:43
|
| Again, thanks. So then, is there a way to stop having an alias assigned to the columns? |
 |
|
|
|
|
|