I am attempting to create a table using the SQL script generated by DotNetNuke Dynamic Module template.
I added the following column "[Subject] [nvarchar(4000)] NOT NULL" and got the following.
System.Data.SqlClient.SqlException: Column, parameter, or variable #6: Cannot find data type nvarchar(4000). 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) /************************************************************/ /***** SqlDataProvider *****/ /***** *****/ /***** *****/ /***** Note: To manually execute this script you must *****/ /***** perform a search and replace operation *****/ /***** for dbo. and *****/ /***** *****/ /************************************************************/ /** Create Table **/ if not exists (select * from dbo.sysobjects where id = object_id(N'dbo.[DHW_AnonFeedback]') and OBJECTPROPERTY(id, N'IsTable') = 1) BEGIN CREATE TABLE dbo.[DHW_AnonFeedback] ( [ModuleID] [int] NOT NULL, [ItemID] [int] NOT NULL IDENTITY(1, 1), [Content] [ntext] NOT NULL, [CreatedByUser] [int] NOT NULL, [CreatedDate] [datetime] NOT NULL, [Subject] [nvarchar(4000)] NOT NULL ) ALTER TABLE dbo.[DHW_AnonFeedback] ADD CONSTRAINT [PK_DHW_AnonFeedback] PRIMARY KEY CLUSTERED ([ItemID]) CREATE NONCLUSTERED INDEX [IX_DHW_AnonFeedback] ON dbo.[DHW_AnonFeedback] ([ModuleID]) ALTER TABLE dbo.[DHW_AnonFeedback] WITH NOCHECK ADD CONSTRAINT [FK_DHW_AnonFeedback_Modules] FOREIGN KEY ([ModuleID]) REFERENCES dbo.[Modules] ([ModuleID]) ON DELETE CASCADE NOT FOR REPLICATION END System.Data.SqlClient.SqlException: Incorrect syntax near '@Subject'. 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.DHW_AddAnonFeedback @ModuleId int, @Content ntext, @UserID int, @Subject nvarchar(4000) as insert into DHW_AnonFeedback ( ModuleId, Content, CreatedByUser, CreatedDate, Subject ) values ( @ModuleId, @Content, @UserID, getdate() @Subject )
Thanks for any help,