Incorrect syntax near the keyword 'AND'.
Hvorfor kommer denne feil? Den virker på en annen sql server?? Hmmmmmm noen som kan hjelpe?Declare @sp_DocID int
Declare @sp_DocWPLanguageID int
Declare @sp_Instance varchar(50)
SET @sp_DocID = '1'
SET @sp_DocWPLanguageID = '1'
SET @sp_Instance = 'DemoDotWPDotNo'
EXEC ('SELECT DocTitle,DocContent,DocProperties,DocCreated,TImagetop,TImagetopHeight,TImagetopWidth,TImagebottom,TImagebottomHeight,TImagebottomWidth,FullName,UEmail,FKLayoutID FROM [' + @sp_Instance + 'Documents],[' + @sp_Instance + 'Template],[' + @sp_Instance + 'ImagesTemplate],[' + @sp_Instance + 'Users] WHERE DocID=' + @sp_DocID + ' AND DocFKWPLanguageID=' + @sp_DocWPLanguageID + ' AND DocDeleted=0 AND TID=DocCatTemplate AND TImageID=TImage AND DocCreatedBy=UserID')