Re: Incorrect syntax near the keyword 'open'.
- From: "Tibor Karaszi" <tibor_please.no.email_karaszi@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 11 Aug 2007 10:11:59 +0200
You can't have code in a view. A view is limited to a SELECT statement, nothing else. Consider a stored procedure or a multi-statement table-valued user defined function.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Rogers" <naissani@xxxxxxxxxxx> wrote in message news:Of11ty32HHA.5796@xxxxxxxxxxxxxxxxxxxxxxx
ALTER VIEW [dbo].[VW_OutBreak]
AS
open symmetric key CIS_Symmetric_Key decryption by certificate CISCertificate;
SELECT
cast(DecryptByKey(OB_PersonCompleting)AS varchar(100)) AS PersonCompleting,
cast(DecryptByKey(OB_PersonTitle) AS varchar(100)) AS PersonTitle,
cast(DecryptByKey(OB_Phone) AS varchar(100)) AS Phone,
FROM BreakOut
GOT ERROR:
Msg 156, Level 15, State 1, Procedure VW_OutBreak, Line 4
Incorrect syntax near the keyword 'open'.
Any idea how can I resolve
Thanks
.
- References:
- Incorrect syntax near the keyword 'open'.
- From: Rogers
- Incorrect syntax near the keyword 'open'.
- Prev by Date: Incorrect syntax near the keyword 'open'.
- Next by Date: Re: Changing Object Explorer Details Window
- Previous by thread: Incorrect syntax near the keyword 'open'.
- Index(es):