Madhivanan (ma************@gmail.com) writes:
I get the error
Server: Msg 4512, Level 16, State 3, Procedure myview, Line 2
Cannot schema bind view 'myview' because name 'mytable' is invalid for
schema binding. Names must be in two-part format and an object cannot
reference itself.
Oops! I tested, got an error messages, was contented with that. I failed
to read the error message, though. OK, try this then:
CREATE TABLE mytable (a int NOT NULL)
go
CREATE VIEW myview WITH SCHEMABINDING AS
SELECT a FROM dbo.mytable
go
DROP TABLE mytable -- Fails
--
Erland Sommarskog, SQL Server MVP,
es****@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp