Incorrect syntax near the keyword 'view'.
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vwTbllog]') and OBJECTPROPERTY(id, N'IsView') = 1)
begin
create view vwTbllog as
(select id,datecreated,errorcode as code,level,category,source,message,exception,stacktrace,userid from tbllog)
end
go
执行上述 sql时出现错误如下:
Server: Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'view'.
使用的是SqlServer2000数据库,
目的很简单,就是判断是否存在 xxx视图,
不存在的话,则创建。
相关推荐
SQL SERVER先判断视图是否存在然后再创建视图的语句
SQL SERVER中先判断视图是否存在,使用IF NOT EXISTS,然后再创建视图,使用create view,整个过程如下
ThinkPHP2.0读取MSSQL提示Incorrect syntax near the keyword 'AS'的解决方法
主要介绍了ThinkPHP2.0读取MSSQL提示Incorrect syntax near the keyword 'AS'的解决方法,需要的朋友可以参考下
ThinkPHP2.0读取MSSQL提示Incorrect syntax near the keyword AS的解决方法
问题代码如下: <?php class IndexAction extends Action{ public function index(){ /* $Model = new Model(); $test = $Model->query('select top 10 * from f_city'); dump($test); */ $CityModel = M('city'); $CityModel->find(); dump($CityModel); } } ?> 出现的情况是使用 query 可以正确读取到数据,
php mssql 日期出现中文字符的解决方法
比如:2005-12-23 读出以后页面会显示为:2005 十二月 23 ,这样给程序处理带来很多不便。查找了一些资料发现是php.ini默认了日期处理功能。 解决方法为: 第一个方法:php文档开头定义ini_set(”mssql.datetimeconvert”,”0″); 第二个方法:修改php.ini,找到;mssql.datetimeconvert = On ,去掉前面的分号,修改on为off,重启apache即可 第三个方法:用SQL的 convert()函数转换,如: SELECT id, title, convert(char(10),news_time,102) as pub
如何写简历
主要讲解如何撰写简历,帮助软件开发学员如何更好地写出好的简历!


应用实例
