I'd liked to dynamically create a view in a procedure, but haven't been able to find the right syntax (SQL Server 7).
Here's the code :
CREATE PROCEDURE ChangeViewCleanCharacters_For_Table1Field1
IF EXISTS (SELECT name FROM sysobjects
WHERE name = 'CleanCharacters' AND type = 'V')
DROP VIEW CleanCharacters
Create view CleanCharacters as
And here are the error messages :
Server: Msg 170 ...
Line 8: Incorrect syntax near 'CleanCharacters'.
Server: Msg 156 ...
Line 4 : Incorrect syntax near the keyword 'END'.
If I delete the keywords GO, I have now :
Server: Msg 156...
LIne 10 : Incorrect syntax near the keyword 'view'.
Thanks for the help,