I have run into an issue where if a stored proc has a concatenation operator in it the installation fails. If I run the script in the SQL adminstrative window it compiles / installs ok.
Has anyone else run into this?
-------------------------------------- SAMPLE STORED PROC (Doesnt install but does compile)-------------------------------------------
/* Module Installation Test */
if exists (select * from {databaseOwner}sysobjects where id = object_id(N'{databaseOwner}{objectQualifier}ConcatProc') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure {databaseOwner}{objectQualifier}ConcatProc
GO
CREATE PROCEDURE {databaseOwner}{objectQualifier}ConcatProc
(
@stringOne varchar(6),
@stringTwo varchar(6)
)
AS
DECLARE @stringResult varchar(100)
Set @stringResult = 'Literal1'+@stringOne+'Literal2'+@stringTwo+'Literal3'
RETURN
GO
-------------------------------------- Error produced from install -----------------------------------------
SQL Execution resulted in following Exceptions: System.Data.SqlClient.SqlException: Incorrect syntax near '@stringOne'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE PROCEDURE dbo.ConcatProc ( @stringOne varchar(6), @stringTwo varchar(6) ) AS DECLARE @stringResult varchar(100) Set @stringResult = 'Literal1'@stringOne'Literal2'@stringTwo'Literal3' RETURN