Hi
In stored procedure i pass parameter as nvarchar,for testing purpose i add Print,below this i get error in SP
-- Exec SPDelFile N'รู้จักกับ Dreamweaver.docx', N'รู้จักกับw',N'รู้จักกับ Dreamweaver.docx',N'รู้จักกับ\รู้จักกับ\รู้จักกับ Dreamweaver.docx',N'รู้จักกับw\รู้จักกับ\รู้จักกับ',N'รู้จักกับ\รู้จักกับ\รู้จักกับ Dreamweaver.docx',N'รู้จักกับw\รู้จักกับ\รู้จักกับ\รู้จักกับ Dreamweaver.docx',N'รู้จักกับw'
After execut SP,below i get Print result
Delete from [รู้จักกับw] where [File Name] = รู้จักกับ Dreamweaver.docx and [File Path] = รู้จักกับ\รู้จักกับ\รู้จักกับ Dreamweaver.docx
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'Dreamweaver'.
This is my SP and in same window for testing i execute using Exec
USE [Employee]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[SPDelFile]
@TblName nvarchar(256),
@FileName1 nvarchar(256),
@FilePath1 nvarchar(256),
@TblNameIndx nvarchar(256)
AS
Declare @DelTblPos nvarchar(max);
SET @DelTblPos = 'Delete from ['+ @TblName +'] where [File Name] = '+ @FileName1 +' and [File Path] = ' + @FilePath1 ;
Print @DelTblPos;
EXEC (@DelTblPos);
Declare @DelIndexing nvarchar(max);
SET @DelIndexing = 'Delete from [FTIndexing] where [Filename] = '+ @FileName1 +' and [Filepath] = ' + @FilePath1 + ' and [Database] = ' + @TblNameIndx ;
Print @DelIndexing;
EXEC (@DelIndexing);
RETURN
All parameters declare as nvarchar.
Pls reply me how to solve this.
The above values are Thai language,if all are in English then no problem
Note:if file name like this รู้จักกับ Dreamweaver.docx --- > Problem
if like this Dreamweaver.docx--> no Problem
Regards
Aravind
What I have tried:
Note:if file name like this รู้จักกับ Dreamweaver.docx --- > Problem
if like this Dreamweaver.docx--> no Problem