I am trying to run sqlcmd.exe in order to setup a new database from command line. I am using SQL SERVER Express 2012 on Windows 7 64 bits.
Here's the command I use:
SQLCMD -S .\MSSQLSERVER08 -V 17 -E -i %~dp0\aqualogyDB.sql -o %~dp0\databaseCreationLog.log
And here's a pieceof the sql file creation script:
CREATE DATABASE aqualogy COLLATE Modern_Spanish_CI_AS WITH TRUSTWORTHY ON, DB_CHAINING ON; GO use aqualogy GO CREATE TABLE [dbo].[BaseLayers] ( [Code] nchar(100) NOT NULL , [Geometry] nvarchar(MAX) NOT NULL , [IsActive] bit NOT NULL DEFAULT ((1)) ) EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'Capas de cartografía base de la aplicaicón. Consideramos en Galia Móvil la cartografía(...)' , @level0type = 'SCHEMA', @level0name = N'dbo' , @level1type = 'TABLE', @level1name = N'BaseLayers'
Well, please check that there are some accents on the words; which is the table's description . The database is created with no problems. 'Collate' is understood by the script, as you can see in the attached screenshot. Despite of this, accents are not properly shown when examining the table.
I'd really appreciate any help. Thank you very much.
[Edit]: Hi all. Changing the SQL file encoding using Notepad++ worked fine! Thank you very much for you help: I learned something interesting with this problem!