Re: [WiX-users] When trying to execute a SQL script there are garbage characters

2014-08-06 Thread Keith.Douglas
Looks like it shouldn't be Unicode encoded ...



Keith Douglas
Statistics Canada | 170 Tunney's Pasture Driveway, Ottawa ON K1A 0T6
Statistique Canada | 170, promenade Tunney's Pasture, Ottawa ON K1A 0T6
keith.doug...@statcan.gc.ca
Telephone | Téléphone 613-854-5589
Facsimile | Télécopieur 613-951-4674
Government of Canada | Gouvernement du Canada 


-Original Message-
From: garymonk [mailto:g...@gurudental.com] 
Sent: August-05-14 8:16 PM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] When trying to execute a SQL script there are garbage 
characters

I am trying to execute an SQL script that creates a database and when I do I 
receive the following errors...

Error 26204. Error -2147217900: failed to execute SQL string, error detail:
Incorrect syntax near '»'., SQL key: CreateDatabase SQL string: USE [master] 

The CreateDatabase.sql code is...

USE [master]
GO

DECLARE @data_path nvarchar(256);

DECLARE @debug_message nvarchar(2048)
SET @debug_message = '' 

IF NOT EXISTS(SELECT NAME FROM SYSDATABASES WHERE NAME = 'MVDB') AND @data_path 
= ' '
BEGIN
SET @data_path = (SELECT SUBSTRING(filename, 1, 
CHARINDEX('master.mdf',
LOWER(filename)) - 1)
  FROM master.dbo.sysdatabases
  WHERE name = 'master');
SET @data_path = @data_path + 'mvdb.mdf';

IF NOT EXISTS(SELECT NAME FROM SYSDATABASES WHERE NAME = 'MVDB')
BEGIN
CREATE DATABASE [mvdb]
IF @@ERROR = 0
BEGIN
EXEC dbo.sp_dbcmptlevel @dbname='mvdb', 
@new_cmptlevel=100

IF (1 = 
FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
BEGIN
EXEC 
[mvdb].[dbo].[sp_fulltext_database] @action = 'enable'
END

ALTER DATABASE [mvdb] SET ANSI_NULL_DEFAULT OFF 
ALTER DATABASE [mvdb] SET ANSI_NULLS OFF 
ALTER DATABASE [mvdb] SET ANSI_PADDING OFF 
ALTER DATABASE [mvdb] SET ANSI_WARNINGS OFF 
ALTER DATABASE [mvdb] SET ARITHABORT OFF 
ALTER DATABASE [mvdb] SET AUTO_CLOSE ON 
ALTER DATABASE [mvdb] SET 
AUTO_CREATE_STATISTICS ON 
ALTER DATABASE [mvdb] SET AUTO_SHRINK OFF 
ALTER DATABASE [mvdb] SET 
AUTO_UPDATE_STATISTICS ON 
ALTER DATABASE [mvdb] SET 
CURSOR_CLOSE_ON_COMMIT OFF 
ALTER DATABASE [mvdb] SET CURSOR_DEFAULT  
GLOBAL 
ALTER DATABASE [mvdb] SET 
CONCAT_NULL_YIELDS_NULL OFF 
ALTER DATABASE [mvdb] SET NUMERIC_ROUNDABORT 
OFF 
ALTER DATABASE [mvdb] SET QUOTED_IDENTIFIER OFF 
ALTER DATABASE [mvdb] SET RECURSIVE_TRIGGERS 
OFF 
ALTER DATABASE [mvdb] SET  READ_WRITE 
ALTER DATABASE [mvdb] SET RECOVERY SIMPLE 
ALTER DATABASE [mvdb] SET  MULTI_USER 
END
END
END

As you can see there are no garbage characters ( ) at the beginning of the 
procedure.

Do I have to embed the code for each procedure or is there a way to use an 
external file?

Thanks,
Gary



--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/When-trying-to-execute-a-SQL-script-there-are-garbage-characters-tp7596247.html
Sent from the wix-users mailing list archive at Nabble.com.

--
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071iu=/4140/ostg.clktrk
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
--
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071iu=/4140/ostg.clktrk
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] When trying to execute a SQL script there are garbage characters

2014-08-06 Thread garymonk
Thanks Kieth, that was it. I changed the SQL scripts to use codepage 1252 and
everything worked!



--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/When-trying-to-execute-a-SQL-script-there-are-garbage-characters-tp7596247p7596258.html
Sent from the wix-users mailing list archive at Nabble.com.

--
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071iu=/4140/ostg.clktrk
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


[WiX-users] When trying to execute a SQL script there are garbage characters

2014-08-05 Thread garymonk
I am trying to execute an SQL script that creates a database and when I do I
receive the following errors...

Error 26204. Error -2147217900: failed to execute SQL string, error detail:
Incorrect syntax near '»'., SQL key: CreateDatabase SQL string: USE
[master] 

The CreateDatabase.sql code is...

USE [master]
GO

DECLARE @data_path nvarchar(256);

DECLARE @debug_message nvarchar(2048)
SET @debug_message = '' 

IF NOT EXISTS(SELECT NAME FROM SYSDATABASES WHERE NAME = 'MVDB') AND
@data_path = ' '
BEGIN
SET @data_path = (SELECT SUBSTRING(filename, 1, 
CHARINDEX('master.mdf',
LOWER(filename)) - 1)
  FROM master.dbo.sysdatabases
  WHERE name = 'master');
SET @data_path = @data_path + 'mvdb.mdf';

IF NOT EXISTS(SELECT NAME FROM SYSDATABASES WHERE NAME = 'MVDB')
BEGIN
CREATE DATABASE [mvdb]
IF @@ERROR = 0
BEGIN
EXEC dbo.sp_dbcmptlevel @dbname='mvdb', 
@new_cmptlevel=100

IF (1 = 
FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
BEGIN
EXEC 
[mvdb].[dbo].[sp_fulltext_database] @action = 'enable'
END

ALTER DATABASE [mvdb] SET ANSI_NULL_DEFAULT OFF 
ALTER DATABASE [mvdb] SET ANSI_NULLS OFF 
ALTER DATABASE [mvdb] SET ANSI_PADDING OFF 
ALTER DATABASE [mvdb] SET ANSI_WARNINGS OFF 
ALTER DATABASE [mvdb] SET ARITHABORT OFF 
ALTER DATABASE [mvdb] SET AUTO_CLOSE ON 
ALTER DATABASE [mvdb] SET 
AUTO_CREATE_STATISTICS ON 
ALTER DATABASE [mvdb] SET AUTO_SHRINK OFF 
ALTER DATABASE [mvdb] SET 
AUTO_UPDATE_STATISTICS ON 
ALTER DATABASE [mvdb] SET 
CURSOR_CLOSE_ON_COMMIT OFF 
ALTER DATABASE [mvdb] SET CURSOR_DEFAULT  
GLOBAL 
ALTER DATABASE [mvdb] SET 
CONCAT_NULL_YIELDS_NULL OFF 
ALTER DATABASE [mvdb] SET NUMERIC_ROUNDABORT 
OFF 
ALTER DATABASE [mvdb] SET QUOTED_IDENTIFIER OFF 
ALTER DATABASE [mvdb] SET RECURSIVE_TRIGGERS 
OFF 
ALTER DATABASE [mvdb] SET  READ_WRITE 
ALTER DATABASE [mvdb] SET RECOVERY SIMPLE 
ALTER DATABASE [mvdb] SET  MULTI_USER 
END
END
END

As you can see there are no garbage characters ( ) at the beginning of
the procedure.

Do I have to embed the code for each procedure or is there a way to use an
external file?

Thanks,
Gary



--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/When-trying-to-execute-a-SQL-script-there-are-garbage-characters-tp7596247.html
Sent from the wix-users mailing list archive at Nabble.com.

--
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071iu=/4140/ostg.clktrk
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users