Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to save Unicode text using stored procedure in SQL Server 2008
    text
    copied!<p>I am working on an multilingual web application being developed in VS 2010 - ASP.Net (C#).</p> <p>I can insert it without any problem if I use a simple insert statement without stored procedure for example</p> <pre><code>Insert INTO Test (E,A) VALUES('Some English Text',N'الرَّحْمَٰنِ الرَّحِيمِاللَّهِ الرَّحْمَٰنِ الرَّحْمَٰنِ الرَّحِيمِاللَّهِ الرَّحْمَٰنِ الرَّحْمَٰنِ الرَّحِيمِاللَّهِ الرَّحْمَٰنِ الرَّحْمَٰنِ الرَّحِيمِاللَّهِ الرَّحْمَٰنِ') </code></pre> <p>It works fine when I add N for unicode data. My question is how can I add this 'N' in stored procedure so that it can save data without any issues. I tried to put N in different way but stored procedure give syntax error</p> <p>Below is the example of stored procedure I am using.</p> <pre><code>ALTER PROCEDURE [dbo].[usp_AddNewPageDetails] -- Add the parameters for the stored procedure here @PageNameEnglish varchar(100), @PageNameArabic nvarchar(300), @PageTitleEnglish varchar(300), @PageTitleArabic nvarchar(900), @PageDescEnglish varchar(400), @PageDescArabic nvarchar(1200), @PageKeywordsEnglish varchar(120), @PageKeywordsArabic nvarchar(400), @PageBodyEnglish varchar(MAX), @PageBodyArabic nvarchar(MAX), @PageLinkPosition int, AS -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; BEGIN INSERT INTO pg_Pages( PageNameEnglish,PageNameArabic,PageTitleEnglish,PageTitleArabic,PageDescEnglish, PageDescArabic,PageKeywordsEnglish,PageKeywordsArabic,PageBodyEnglish, PageLinkPosition,PageLayoutPosition,PageBannerImageEnglish,) VALUES (@PageNameEnglish,@PageNameArabic,@PageTitleEnglish,@PageTitleArabic,@PageDescEnglish, @PageDescArabic,@PageKeywordsEnglish,@PageKeywordsArabic,@PageBodyEnglish,) END </code></pre> <p>Reply is appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload