Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0SQL errorSQL error
Previous
 
Next
New Post
7/25/2008 12:04 AM
 

When installing a Module I created, I get the error below. I cant figure out what the problem is!

StartJob Start Sql execution: 01.00.00.SqlDataProvider file
Failure SQL Execution resulted in following Exceptions: System.Data.SqlClient.SqlException: Incorrect syntax near 'school'. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. 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 Stored Procedures **/ create procedure dbo.YourCompany_GetPGTs @ModuleId int as select ModuleId, ItemId, Content, CreatedByUser, CreatedDate state school schoolNS league sport subPrice subTerm1 subTerm2 singlePrice singleTerm1 singleTerm2 from YourCompany_PGT with (nolock) left outer join Users on YourCompany_PGT.CreatedByUser = Users.UserId where ModuleId = @ModuleId System.Data.SqlClient.SqlException: Invalid column name 'state'. Invalid column name 'school'. Invalid column name 'schoolNS'. Invalid column name 'league'. Invalid column name 'sport'. Invalid column name 'subPrice'. Invalid column name 'subTerm1'. Invalid column name 'subTerm2'. Invalid column name 'singlePrice'. Invalid column name 'singleTerm1'. Invalid column name 'singleTerm2'. 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.YourCompany_GetPGT @ModuleId int, @ItemId int as select ModuleId, ItemId, Content, CreatedByUser, CreatedDate, state, school, schoolNS, league, sport, subPrice, subTerm1, subTerm2, singlePrice, singleTerm1, singleTerm2 from YourCompany_PGT with (nolock) left outer join Users on YourCompany_PGT.CreatedByUser = Users.UserId where ModuleId = @ModuleId and ItemId = @ItemId System.Data.SqlClient.SqlException: Incorrect syntax near '@state'. Must declare the scalar variable "@UserID". 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.YourCompany_AddPGT @ModuleId int, @Content ntext, @UserID int @state string @school string @schoolNS string @league string @sport string @subPrice string @subTerm1 string @subTerm2 string @singlePrice string @singleTerm1 string @singleTerm2 string as insert into YourCompany_PGT ( ModuleId, Content, CreatedByUser, CreatedDate, state, school, schoolNS, league, sport, subPrice, subTerm1, subTerm2, singlePrice, singleTerm1, singleTerm2 ) values ( @ModuleId, @Content, @UserID, @state, @school, @schoolNS, @league, @sport, @subPrice, @subTerm1, @subTerm2, @singlePrice, @singleTerm1, @singleTerm2, getdate() ) System.Data.SqlClient.SqlException: Incorrect syntax near '@state'. Must declare the scalar variable "@UserID". 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.YourCompany_UpdatePGT @ModuleId int, @ItemId int, @Content ntext, @UserID int @state string @school string @schoolNS string @league string @sport string @subPrice string @subTerm1 string @subTerm2 string @singlePrice string @singleTerm1 string @singleTerm2 string as update YourCompany_PGT set Content = @Content, CreatedByUser = @UserID, CreatedDate = getdate() where ModuleId = @ModuleId and ItemId = @ItemId System.Data.SqlClient.SqlException: Incorrect syntax near '@state'. Must declare the scalar variable "@ItemId". 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.YourCompany_DeletePGT @ModuleId int, @ItemId int @state string @school string @schoolNS string @league string @sport string @subPrice string @subTerm1 string @subTerm2 string @singlePrice string @singleTerm1 string @singleTerm2 string as delete from YourCompany_PGT where ModuleId = @ModuleId and ItemId = @ItemId
EndJob End Sql execution: 01.00.00.SqlDataProvider file
 
 
New Post
7/25/2008 4:29 AM
 

you have to follow naming conventions, i.e. names can consist of single words only.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
7/25/2008 3:22 PM
 

When I use the default database sql generated by the Starter kit, I have no problem. But when I try to use sql I generated my self, i get sql errors.

The sql I generated runs fine on the SQL Query Analyzer, but does not run in the DNN SQL window.

Have you try to run your sql directly in the SQL Query Analyzer instead of using the DNN module installer to setup the data?

Is there another thread that post a solution to this?

 
New Post
7/26/2008 1:04 AM
 

Look at your SQL 
as select ModuleId, ItemId, Content, CreatedByUser, CreatedDate state school schoolNS league sport subPrice subTerm1 subTerm2 singlePrice singleTerm1 singleTerm2 from YourCompany_PGT with (nolock)

there is no comma after CreatedDate, state, ............ - Not sure how you're running this in any database without errors...
Sanjay


AcuitiDP - Oracle Data Provider for DotNetNuke
 
New Post
7/31/2008 11:49 AM
 

RDO did u solve your problem? If yes, what was wrong?

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0SQL errorSQL error


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out