CodeSmith Community
Your Code. Your Way. Faster!

Error in SQL provider when generating

rated by 0 users
This post has 3 Replies | 2 Followers

Not Ranked
Posts 9
Points 315
StantonR Posted: 10-07-2008 5:26 AM

Hi There

I keep getting the following error when generating my codesmith project.

I created a custom stored procedure then started getting the error.
When I removed the custom proc I still got the error.

I have also tried parsing all the Stored procs and there is no syntax errors

Error while execution Sql file. System.Data.SqlClient.SqlException: Incorrect syntax near ')'.
   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 MoM.Templates.CommonSqlCode.ExecuteSqlInFile(String pathToScriptFile, String connectionString) in c:\Documents and Settings\Stanton\My Documents\CodeSmith\Samples\v4.1\Templates\NetTiers\TemplateLib\CommonSqlCode.cs:line 4589
   at _CodeSmith.NetTiers_cst.Go() in c:\Documents and Settings\Stanton\My Documents\CodeSmith\Samples\v4.1\Templates\NetTiers\NetTiers.cst:line 1504
Top 10 Contributor
Posts 1,401
Points 51,130

Hello,

From the looks of it, it appears that you are using a really old version of .netTiers. I would download the latest build and see if this fixes the errors. If it doesn't then please attach your SQL Schema and I will take a look at it.

Thanks
-Blake Niemyjski

Blake Niemyjski

CodeSmith Tools, LLC. Software Development Engineer

Blog: http://windowscoding.com/blogs/blake/

----------------------------------------------------------------------
 Member of the .NetTiers team | Visit http://www.nettiers.com
----------------------------------------------------------------------

  • | Post Points: 35
Not Ranked
Posts 9
Points 315

Thanks

I am a bit weary of using the latest build now as we are about to go live .

Everything still seems to be building correctly in visual studio and any database changes are reflected.

It is just giving the error.

Is there no error log so that I can see wich stored proc is giving the problem.

Also its the first time I have written a custom stored proc where a parameter is a text field,could this be causing the problem.

 

Thanks

Stanton

  • | Post Points: 35
Top 10 Contributor
Posts 1,401
Points 51,130

Hello,

The latest version is just a maintenance release. However. after looking at your exception again, I noticed that its throwing the error while trying to execute the sql after generation. Try setting the ExecuteSQL property to false and execute the file manually.

Thanks
-Blake Niemyjski

Blake Niemyjski

CodeSmith Tools, LLC. Software Development Engineer

Blog: http://windowscoding.com/blogs/blake/

----------------------------------------------------------------------
 Member of the .NetTiers team | Visit http://www.nettiers.com
----------------------------------------------------------------------

  • | Post Points: 5
Page 1 of 1 (4 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems