Structure tables and result query on sqlfiddle
我想使用查询:
INSERT INTO Firm('name', 'name_original', 'id_city', 'id_service', 'id_firm')
VALUES
('Ð ÐД-ÐВТО ООО', 'Ð ÐД-ÐВТО ООО', '73041', '2', '1429'),
('УМ-3 ЗÐО ', 'УМ-3 ЗÐО ', '73041', '2', '49806'),
('ООО West Hole', 'Ð ÐД-ÐВТО ООО', '73041', '2', '10004');
但我得到错误:
Parameters supplied for object 'Firm' which is not a function. If the parameters are intended as a table hint, a WITH keyword is required.:
INSERT INTO Firm('name', 'name_original', 'id_city', 'id_service', 'id_firm')
VALUES
('Ð ÐД-ÐВТО ООО', 'Ð ÐД-ÐВТО ООО', '73041', '2', '1429'),
('УМ-3 ЗÐО ', 'УМ-3 ЗÐО ', '73041', '2', '49806'),
('ООО West Hole', 'Ð ÐД-ÐВТО ООО', '73041', '2', '10004')
请告诉我为什么我会收到错误以åŠæ’入数æ®çš„æ£ç¡®æ€§ï¼Ÿ
ç”案 0 :(得分:5)
åˆ é™¤åˆ—å称周围的引å·ã€‚
INSERT INTO Firm(name, name_original, id_city, id_service, id_firm)
VALUES
('Ð ÐД-ÐВТО ООО', 'Ð ÐД-ÐВТО ООО', '73041', '2', '1429'),
('УМ-3 ЗÐО ', 'УМ-3 ЗÐО ', '73041', '2', '49806'),
('ООО West Hole', 'Ð ÐД-ÐВТО ООО', '73041', '2', '10004');
ç”案 1 :(得分:1)
æ‚¨æ— éœ€åœ¨INSERT INTO
è¯å¥ä¸å¯¹å—符串å称进行“å—符串化â€ã€‚列å是期望的ç†æƒ³è€…
致电
INSERT INTO Firm(name, name_original, id_city, id_service, id_firm)
使用您的VALUES将获得æˆåŠŸçš„结果
ç”案 2 :(得分:1)
例如:
Insert into TableName ( Name,ID ) THEN Values ( 'Joe',2).
注æ„:列åçš„æ•°æ®ç±»åž‹åº”与您è¦æ’入的数æ®åŒ¹é…。
ç”案 3 :(得分:0)
INSERT INTO Firm(name, name_original, id_city, id_service, id_firm)
VALUES ('Ð ÐД-ÐВТО ООО', 'Ð ÐД-ÐВТО ООО', '73041', '2', '1429')
INSERT INTO Firm(name, name_original, id_city, id_service, id_firm)
VALUES('УМ-3 ЗÐО ', 'УМ-3 ЗÐО ', '73041', '2', '49806')
INSERT INTO Firm(name, name_original, id_city, id_service, id_firm)
VALUES ('ООО West Hole', 'Ð ÐД-ÐВТО ООО', '73041', '2', '10004')
ç”案 4 :(得分:0)
DECLARE @Firm TABLE(name NVARCHAR(100), name_original NVARCHAR(100), id_city NVARCHAR(100)
, id_service NVARCHAR(100), id_firm NVARCHAR(100))
INSERT INTO @Firm(name, name_original, id_city, id_service, id_firm)
VALUES
(N'Ð ÐД-ÐВТО ООО', N'Ð ÐД-ÐВТО ООО', N'73041', N'1', N'1429'), --<-- Prefix with 'N'
('Ð ÐД-ÐВТО ООО', 'Ð ÐД-ÐВТО ООО', '73041', '2', '1429')
SELECT * FROM @Firm
â•”â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¦â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¦â•â•â•â•â•â•â•â•â•â•¦â•â•â•â•â•â•â•â•â•â•â•â•â•¦â•â•â•â•â•â•â•â•â•â•—
â•‘ name â•‘ name_original â•‘ id_city â•‘ id_service â•‘ id_firm â•‘
â• â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¬â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¬â•â•â•â•â•â•â•â•â•â•¬â•â•â•â•â•â•â•â•â•â•â•â•â•¬â•â•â•â•â•â•â•â•â•â•£
â•‘ Ð ÐД-ÐВТО ООО â•‘ Ð ÐД-ÐВТО ООО â•‘ 73041 â•‘ 1 â•‘ 1429 â•‘ --<-- with Prefix 'N'
â•‘ ???-???? ??? â•‘ ???-???? ??? â•‘ 73041 â•‘ 2 â•‘ 1429 â•‘ --<-- without Prefix 'N'
â•šâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•©â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•©â•â•â•â•â•â•â•â•â•â•©â•â•â•â•â•â•â•â•â•â•â•â•â•©â•â•â•â•â•â•â•â•â•â•
æ³¨æ„ unicodeå—符。
Do not forget to Prefix your passed strings with `N` as your strings contained
unicode characters.