简体   繁体   中英

Visual Studio Database Project - Post deployment script problems with German letters

We have created a database project in VS2013. We added database structure. It works fine to publish and compare database.

Now on publish we want to automatically load several tables with default data which includes german letters for example;

insert into @ReportGruppe1 values(507,'ID_507','Flüssigkeitsbilanz (24 Stunden)','CC_1_LeerVordrucke_A4_Hoch.lst', 'AP;PP', 1,  10, 1)

What happens; ü and other German letters are replaced with some strange characters like "?" in black square while the post deployment script is running.

When I run the same script directly in SQL Server Management Studio everything works perfectly so it must be some problem with the project. Any ideas? How to handle this situation?

If you can insert those characters via mgmt console the columns should presumably be of type nvarchar .

To insert your data via script you need to mark your string input values als unicode by prefixing them with N :

N'Flüssigkeitsbilanz (24 Stunden)'

Your sample insert statement should look like this:

insert into @ReportGruppe1 values(507,'ID_507', N'Flüssigkeitsbilanz (24 Stunden)', N'CC_1_LeerVordrucke_A4_Hoch.lst', 'AP;PP', 1,  10, 1)

Check the data types of your columns and handle input for those accepting nvarchar (or nchar and other unicode types) accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM