久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

drop table 附近的語法不正確

Incorrect syntax near drop table(drop table 附近的語法不正確)
本文介紹了drop table 附近的語法不正確的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我想編寫以下 SQL 查詢,但是 drop table @temp 和創建表@temp,這是為什么呢?(使用 SQL Server 2015)

I want to write the following SQL query, however there are incorrect syntax errors with drop table @temp and create table @temp, why is it that? (Using SQL Server 2015)

DECLARE @temp NVARCHAR(10)
SET @temp='sth'
IF OBJECT_ID(@temp, 'U') IS NOT NULL 
DROP TABLE  @temp
CREATE TABLE @temp

推薦答案

要回答 WHY 的問題,這是很久以前的句法約定.
DROP 語句是這樣的:

To answer the question WHY, it is a syntactic convention from days long past.
The DROP statement goes like this:

    DROP TABLE MyTable

不是像這樣:

    DROP TABLE 'MyTable'

MyTable 是一個標識符,SQL 中的標識符不加引號.并且因為它不使用引號,所以它不接受變量.

MyTable is an identifier, and identifiers in SQL are not quoted. And because it uses no quotes, it does not accept variables.

也與 WHERE 子句比較:

    WHERE MyCol = 'abc'
    -- MyCol is not quoted because it is an identifier.
    -- 'abc' is quoted because it is a value, and so it can be replaced by a variable.

這篇關于drop table 附近的語法不正確的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Modify Existing decimal places info(修改現有小數位信息)
The correlation name #39;CONVERT#39; is specified multiple times(多次指定相關名稱“CONVERT)
T-SQL left join not returning null columns(T-SQL 左連接不返回空列)
remove duplicates from comma or pipeline operator string(從逗號或管道運算符字符串中刪除重復項)
Change an iterative query to a relational set-based query(將迭代查詢更改為基于關系集的查詢)
concatenate a zero onto sql server select value shows 4 digits still and not 5(將零連接到 sql server 選擇值仍然顯示 4 位而不是 5)
主站蜘蛛池模板: 久久久久国产一区二区三区四区 | 国产成人久久久 | 欧美理论片在线观看 | 亚洲精品国产综合区久久久久久久 | 国产精品91视频 | 欧美日韩国产精品激情在线播放 | 成人免费一区二区三区视频网站 | 久久精品色欧美aⅴ一区二区 | 国产精品精品视频 | 国产精品激情 | 国产日韩欧美一区二区在线播放 | 91资源在线播放 | 久久久精品综合 | 香蕉一区 | 亚洲精品99999 | 欧美在线| 亚洲一区二区不卡在线观看 | 国产日韩欧美激情 | 日本三级网站在线 | 国产欧美一区二区三区另类精品 | 久久精品亚洲精品国产欧美 | 一区二区三区免费 | 一区二区视频 | 亚洲美女网站 | 天天天操天天天干 | 一级欧美 | 精品国产乱码久久久久久丨区2区 | 瑟瑟激情| 日本高清视频在线播放 | 一级欧美日韩 | 亚洲精品久久久久中文字幕欢迎你 | 日韩欧美在线不卡 | 久久久精品久 | 亚洲一区二区av | 欧美成ee人免费视频 | 欧美福利 | 超级碰在线 | 红色av社区 | 91视频精选 | 一区二区三区国产精品 | 日韩中文在线视频 |