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.0Fails registering ModulesFails registering Modules
Previous
 
Next
New Post
5/11/2006 4:00 PM
 

Its throws an exception when I try to execute this

if not exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Telekom_Xtree]') and OBJECTPROPERTY(id, N'IsTable') = 1)

BEGIN

CREATE TABLE {databaseOwner}[{objectQualifier}Telekom_Xtree]

(

[ModuleID] [int] NOT NULL,

[ItemID] [int] NOT NULL IDENTITY(1, 1),

[Content] [ntext] NOT NULL,

[CreatedByUser] [int] NOT NULL,

[CreatedDate] [datetime] NOT NULL

)

ALTER TABLE {databaseOwner}[{objectQualifier}Telekom_Xtree] ADD CONSTRAINT [PK_{objectQualifier}Telekom_Xtree] PRIMARY KEY CLUSTERED ([ItemID])

CREATE NONCLUSTERED INDEX [IX_{objectQualifier}Telekom_Xtree] ON {databaseOwner}[{objectQualifier}Telekom_Xtree] ([ModuleID])

ALTER TABLE {databaseOwner}[{objectQualifier}Telekom_Xtree] WITH NOCHECK ADD CONSTRAINT [FK_{objectQualifier}Telekom_Xtree_{objectQualifier}Modules] FOREIGN KEY ([ModuleID]) REFERENCES {databaseOwner}[{objectQualifier}Modules] ([ModuleID]) ON DELETE CASCADE NOT FOR REPLICATION

END

GO


System.Data.SqlClient.SqlException: Incorrect syntax near 'GO'. 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 Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) if not exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Telekom_Xtree]') and OBJECTPROPERTY(id, N'IsTable') = 1) BEGIN CREATE TABLE dbo.[Telekom_Xtree] ( [ModuleID] [int] NOT NULL, [ItemID] [int] NOT NULL IDENTITY(1, 1), [Content] [ntext] NOT NULL, [CreatedByUser] [int] NOT NULL, [CreatedDate] [datetime] NOT NULL ) ALTER TABLE dbo.[Telekom_Xtree] ADD CONSTRAINT [PK_Telekom_Xtree] PRIMARY KEY CLUSTERED ([ItemID]) CREATE NONCLUSTERED INDEX [IX_Telekom_Xtree] ON dbo.[Telekom_Xtree] ([ModuleID]) ALTER TABLE dbo.[Telekom_Xtree] WITH NOCHECK ADD CONSTRAINT [FK_Telekom_Xtree_Modules] FOREIGN KEY ([ModuleID]) REFERENCES dbo.[Modules] ([ModuleID]) ON DELETE CASCADE NOT FOR REPLICATION END GO

 

 
New Post
5/11/2006 5:04 PM
 

did you save your script UTF-8 encoded?

ensure, that there is no whitespace behind the go statement.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
7/5/2006 12:51 PM
 
I had a similar problem and discovered it was because the last line of my file was "GO" and I had not put an EOF character (i.e. pressing enter) afterwards.  Once I put an extra return line at the end of the file, it worked perfectly.

See http://forums.asp.net/thread/1097223.aspx for a thread where I found this answer.
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Fails registering ModulesFails registering Modules


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