我有这个 INSERT 语句:
INSERT INTO TBL_VIDEOS (
TBL_VIDEOS.ID,
TBL_VIDEOS.TITLE,
TBL_VIDEOS.V_DESCRIPTION,
TBL_VIDEOS.UPLOAD_DATE,
TBL_VIDEOS.V_VIEWS,
TBL_VIDEOS.USERNAME,
TBL_VIDEOS.RATING,
TBL_VIDEOS.V_SOURCE,
TBL_VIDEOS.FLAG
)
VALUES
('Z8MTRH3LmTVm',
'Why Creativity is the New Economy',
'Dr Richard Florida, one of the world's leading ...
this stuff does not matter, it is just wasted space',
CURRENT_TIMESTAMP,
0,
1,
0,
'http://www.youtube.com/watch?v=VPX7gowr2vE&feature=g-all-u'
,0)
但我收到此错误消息:
Invalid object name 'TBL_VIDEOS'
最佳答案
您需要在描述中转义单引号:“世界领先的专家之一”
在这种情况下,我认为表的名称不是问题,但它们是多余的。
以下将起作用:
create table TBL_VIDEOS (
ID nvarchar(100), TITLE nvarchar(100), V_DESCRIPTION nvarchar(2000), UPLOAD_DATE nvarchar(100), V_VIEWS nvarchar(100), USERNAME nvarchar(100), RATING nvarchar(100), V_SOURCE nvarchar(100), FLAG nvarchar(100)
)
INSERT INTO TBL_VIDEOS (
TBL_VIDEOS.ID, TBL_VIDEOS.TITLE, TBL_VIDEOS.V_DESCRIPTION, TBL_VIDEOS.UPLOAD_DATE, TBL_VIDEOS.V_VIEWS, TBL_VIDEOS.USERNAME, TBL_VIDEOS.RATING, TBL_VIDEOS.V_SOURCE, TBL_VIDEOS.FLAG)
VALUES
('Z8MTRH3LmTVm', 'Why Creativity is the New Economy', 'Dr Richard Florida, one of the world' + CHAR(39) + 's leading experts on economic competitiveness, demographic trends and cultural and technological innovation shows how developing the full human and creative capabilities of each individual, combined with institutional supports such as commercial innovation and new industry, will put us back on the path to economic and social prosperity.
Listen to the podcast of the full event including audience Q&A: http://www.thersa.org/events/audio-and-past-events/2012/why-creativity-is-the-new-economy
Our events are made possible with the support of our Fellowship. Support us by donating or applying to become a Fellow.
Donate: http://www.thersa.org/support-the-rsa Become a Fellow: http://www.thersa.org/fellowship/apply', CURRENT_TIMESTAMP, 0, 1, 0, 'http://www.youtube.com/watch?v=VPX7gowr2vE&feature=g-all-u' ,0)
关于sql - 插入 sql server 错误 : invalid object name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12610787/