Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.
If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.
When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:
You may also want to review the installation or upgrading documentation.
As part of setting up a new website we want to run t-sql scripts to create few custom tables and stored procedures. There is no associated feature but just running the SQL scripts during the installation Tried to create a dummy folder as below and embedded sql script in the config file as below
but this doesn't seem to create the tables and stored process.
Can you help us point the right way of doing this.
This situation may not be just during the first installation but could also be post installation. Some thing like we re-run the setup and install the scripts on existing mojoportal site to create the custom tables and stored procs.
I've just done a test scenario as you've described, and it's working exactly as expected. When you're re-running [yourmojosite]/setup/default.aspx, does your extra script show up as seen here?
Thanks I see it going through setup process. but now there is a different exception in running the T-script itself. The sql script gets initiated by setup however it complains that there is error in running the script while probably creating the table or inserting data. Where as the same script when I run on sql server 2008 it runs flawlessly and creates the tables, stored procs and inserts initial records.
Is there something we need to take special precautions while embedding the t-sql script in the mojoportal setup config file?
The way I got the T-sql script created was through using the option generate script wizard in sql server 2008.
Any pointers are appreciated.
If you'd like to share the error msg., it would help with diagnosing the exact nature of why the script isn't running correctly. Does your script have the standard "if it's already there, don't try to re-create it" segment?
Below given is the error message:
Running script deals - 0.0.0.5 - 00:00:03.8378460
System.Data.SqlClient.SqlException (0x80131904): Unclosed quotation mark after the character string ''. 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() 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 mojoPortal.Data.SqlHelper.ExecuteNonQuery(SqlTransaction transaction, CommandType commandType, String commandText, Int32 commandTimeout, SqlParameter commandParameters) in C:\mojoportal\source\mojoPortal.Data.MSSQL\SqlHelper.cs:line 154 at mojoPortal.Data.SqlHelper.ExecuteNonQuery(SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter commandParameters) in C:\mojoportal\mojo\source\mojoPortal.Data.MSSQL\SqlHelper.cs:line 113 at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(String script, String overrideConnectionInfo) in C:\mojoportal\source\mojoPortal.Data.MSSQL\dbPortal.cs:line 711 at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(FileInfo scriptFile, String overrideConnectionInfo) in C:\mojoportal\source\mojoPortal.Data.MSSQL\dbPortal.cs:line 644 at mojoPortal.Business.DatabaseHelper.RunScript(Guid applicationId, FileInfo scriptFile, String overrideConnectionInfo) in C:\mojoportal\source\mojoPortal.Business\DatabaseHelper.cs:line 327 - 00:00:04.5242900
Also I am surprised to see the local development file path
in the error msg when it is already deployed on the server
Can you post your sql? It says there is a missing quote.
As Joe mentioned, it would help to see your SQL - it sounds like a single/double-quote mixup.
Something else; if you're running your test script on a host server, have you confirmed where your connection string is pointed?
Never mind. Got it working. Looks like there was an issue with identity setting and also a select statement. So what I did was to go through each one of the sql statements and resolved the issue.