【发布时间】:2017-02-04 15:34:34
【问题描述】:
我有以下存储过程,我正在寻找正确的语法,以便我可以在评论列中播放评论值,前端有 N Unicode 的值我需要保存俄语字符值
所以目前 cmets 值是这样传递的
@cmets
我想做
N@cmets 但不工作
ALTER PROCEDURE [dbo].[spInsertContactUs]
(
@title VARCHAR(20) = default,
@forename VARCHAR(100) = default,
@surname VARCHAR(100) = default,
@gender VARCHAR(50) = default,
@address1 VARCHAR(100) = default,
@address2 VARCHAR(100) = default,
@city VARCHAR(50) = default,
@county VARCHAR(50) = default,
@country INT = default,
@zipcode VARCHAR(50) = default,
@email VARCHAR(200) = default,
@comments NVARCHAR(MAX) = default,
@mailinglist BIT = default,
@address3 VARCHAR(100) = default,
@dateOfBirth datetime = default
)
AS
SET NOCOUNT ON
INSERT INTO tblContactUs (
dateAdded,
title,
forename,
surname,
gender,
address1,
address2,
city,
county,
country,
zipcode,
email,
comments,
mailinglist,
address3,
dateOfBirth)
VALUES (
getdate(),
@title,
@forename,
@surname,
@gender,
@address1,
@address2,
@city,
@county,
@country,
@zipcode,
@email,
@comments,
@mailinglist,
@address3,
@dateOfBirth
)
SET NOCOUNT OFF
RETURN
;
【问题讨论】:
-
顺便说一句,在 SQL Server 中使用“sp***”命名存储过程是一个坏主意,因为查询分析器总是搜索具有该命名约定的系统存储过程。
-
@JNK 有这种行为的是
sp_而不是sp。 -
@Martin - 我以为它只需要 SP ......但你是对的!
-
好吧,很高兴知道!
-
我已经更新了我的答案。 stackoverflow.com/questions/1856239/…
标签: sql unicode asp-classic