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
 Error on New View Creation

Author  Topic 

Bubsa
Starting Member

1 Post

Posted - 2006-02-01 : 07:41:02
Afternoon All

Hoping someone will be able to give me a little advice. I accidently delted a view from one of our application databases (Like you do!!).

I actually repliacated the database 2 month ago onto another server to do some testing. Me thinking I was clever decided to go to the copied database and copy the "syntax" for creating the view and then run it on the database I deleted the view but I get the following message I can't for the life of me work out what the problem is.

Has anyone seen this before ??

Server: Msg 207, Level 16, State 3, Procedure VP_TIMESHTPUNV42, Line 2
Invalid column name 'NAME'.
Server: Msg 207, Level 16, State 1, Procedure VP_TIMESHTPUNV42, Line 2
Invalid column name 'NAME'.

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2006-02-01 : 07:46:58
It's trying to create a column called NAME which you obviously no longer have in your tables..
Go to Top of Page

JustinBigelow
SQL Gigolo

1157 Posts

Posted - 2006-02-01 : 17:52:43
Just a shot in the dark but name is a reserved word for SQL Server, have you tried surrounding it in []? Square brackets allow the (unadvised) use of reserved words for column and table naming.

Edit: Scratch that, I just tried creating the view without the [] and that isn't the problem. Listen to Rick
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-02-02 : 01:53:34
To rescue your View you could restore a backup, from before the accidental Drop of the View, to a temporary database, script out the view, run that on the "live" database, and then drop the temporary database.

That's assuming you do take backups of course!!

Kristen
Go to Top of Page
   

- Advertisement -