[This topic is migrated from our old forums. The original author name has been removed]
Microsoft SQL Server 2008 and above - When exporting SQL scripts (data into INSERT statements) I need for the NVARCHAR fields to have the NVARCHAR indicator in front of the data. For example, if the table is:
CREATE TABLE
[IPP_SUPPORT].[DBO].[AlerterEmailTemplates]
(
[cultureCode] VARCHAR(25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[emailType] VARCHAR(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[emailSubject] NVARCHAR(500) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[emailBody] NVARCHAR(MAX) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
);
If if use DBViz to export, I get
INSERT INTO dbo.AlerterEmailTemplates (cultureCode, emailType, emailSubject, emailBody) VALUES ('en-US', 'the type', 'the subject', 'thebody');
but I need
INSERT INTO dbo.AlerterEmailTemplates (cultureCode, emailType, emailSubject, emailBody) VALUES ('en-US', 'the type', N'the subject', N'thebody');
Is there a way to do this? I haven't been able to figure it out if there is. If not I'd like to add it as a feature suggestion.
Hi Jack,
Thanks for the report. Unfortunately there is no way to get this prefix added automatically today, but we have an open ticket on this so I will add your vote for it.
For now, you need to add it manually in the generated script.
Best Regards,
Hans
a
anonymous
said
almost 10 years ago
[This reply is migrated from our old forums. The original author name has been removed]
Re: Generated SQL needs NVARCHAR indicator
OK, thanks - at least I'll stop poking around looking for a way to do it.
anonymous