I want to create a database in the installation process using WiX 3.6. I followed many tutorials, but I think there is something I am doing wrong.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension">
<Product Id="{A704CA9E-2833-4276-A8A8-148F1047332F}" Name="DbInstallerTest" Language="1033" Version="1.0.0.0" Manufacturer="Microsoft" UpgradeCode="2de42bd8-acc2-48bf-b3c6-09745d3a2ea4">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="DbInstallerTest" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="DbInstallerTest" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="CMPDbInsatller"
Guid="{1749E57D-9CE4-42F8-924C-2A2E368B51E4}">
<CreateFolder Directory="INSTALLFOLDER"/>
<util:User Id="SqlUser"
Name="sa"
Password="Abc123@"/>
</Component>
<Component Id="cmp2"
Guid="{C3596364-61A0-4628-9153-1BA11DB4B778}">
<CreateFolder Directory="INSTALLFOLDER"/>
<sql:SqlDatabase Id="Id_db"
Database="TestDatabase1"
Server="(local)SQLExpress"
CreateOnInstall="yes"
User="SqlUser"
DropOnUninstall="yes">
</sql:SqlDatabase>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
The above code gives the following error.
Error -2147467259: failed to create SQL database: TestDatabase1. error detail: Unknown error.
Here is the log content,
=== Logging started: 2/18/2013 11:00:59 ===
Action 11:00:59: INSTALL.
Action start 11:00:59: INSTALL.
Action 11:00:59: FindRelatedProducts. Searching for related applications
Action start 11:00:59: FindRelatedProducts.
Action ended 11:00:59: FindRelatedProducts. Return value 1.
Action 11:00:59: LaunchConditions. Evaluating launch conditions
Action start 11:00:59: LaunchConditions.
Action ended 11:00:59: LaunchConditions. Return value 1.
Action 11:00:59: ValidateProductID.
Action start 11:00:59: ValidateProductID.
Action ended 11:00:59: ValidateProductID. Return value 1.
Action 11:00:59: CostInitialize. Computing space requirements
Action start 11:00:59: CostInitialize.
Action ended 11:00:59: CostInitialize. Return value 1.
Action 11:00:59: FileCost. Computing space requirements
Action start 11:00:59: FileCost.
Action ended 11:00:59: FileCost. Return value 1.
Action 11:00:59: CostFinalize. Computing space requirements
Action start 11:00:59: CostFinalize.
Action ended 11:00:59: CostFinalize. Return value 1.
Action 11:00:59: MigrateFeatureStates. Migrating feature states from related applications
Action start 11:00:59: MigrateFeatureStates.
Action ended 11:00:59: MigrateFeatureStates. Return value 0.
Action 11:00:59: ExecuteAction.
Action start 11:00:59: ExecuteAction.
Action start 11:01:01: INSTALL.
Action start 11:01:01: FindRelatedProducts.
Action ended 11:01:01: FindRelatedProducts. Return value 0.
Action start 11:01:01: LaunchConditions.
Action ended 11:01:01: LaunchConditions. Return value 1.
Action start 11:01:01: ValidateProductID.
Action ended 11:01:01: ValidateProductID. Return value 1.
Action start 11:01:01: CostInitialize.
Action ended 11:01:01: CostInitialize. Return value 1.
Action start 11:01:01: FileCost.
Action ended 11:01:01: FileCost. Return value 1.
Action start 11:01:01: CostFinalize.
Action ended 11:01:01: CostFinalize. Return value 1.
Action start 11:01:01: MigrateFeatureStates.
Action ended 11:01:01: MigrateFeatureStates. Return value 0.
Action start 11:01:01: InstallValidate.
Action ended 11:01:01: InstallValidate. Return value 1.
Action start 11:01:01: RemoveExistingProducts.
Action ended 11:01:01: RemoveExistingProducts. Return value 1.
Action start 11:01:01: InstallInitialize.
Action ended 11:01:01: InstallInitialize. Return value 1.
Action start 11:01:01: ProcessComponents.
Action ended 11:01:01: ProcessComponents. Return value 1.
Action start 11:01:01: UnpublishFeatures.
Action ended 11:01:01: UnpublishFeatures. Return value 1.
Action start 11:01:01: UninstallSqlData.
Action ended 11:01:02: UninstallSqlData. Return value 1.
Action start 11:01:02: RemoveFiles.
Action ended 11:01:02: RemoveFiles. Return value 0.
Action start 11:01:02: RemoveFolders.
Action ended 11:01:02: RemoveFolders. Return value 1.
Action start 11:01:02: CreateFolders.
Action ended 11:01:02: CreateFolders. Return value 1.
Action start 11:01:02: ConfigureUsers.
Action start 11:01:02: CreateUserRollback.
Action ended 11:01:02: CreateUserRollback. Return value 1.
Action start 11:01:02: CreateUser.
Action ended 11:01:02: CreateUser. Return value 1.
Action ended 11:01:02: ConfigureUsers. Return value 1.
Action start 11:01:02: InstallFiles.
Action ended 11:01:02: InstallFiles. Return value 1.
Action start 11:01:02: InstallSqlData.
Action start 11:01:19: CreateDatabase.
Action ended 11:01:19: CreateDatabase. Return value 1.
Action ended 11:01:19: InstallSqlData. Return value 1.
Action start 11:01:19: RegisterUser.
Action ended 11:01:19: RegisterUser. Return value 1.
Action start 11:01:19: RegisterProduct.
Action ended 11:01:19: RegisterProduct. Return value 1.
Action start 11:01:19: PublishFeatures.
Action ended 11:01:19: PublishFeatures. Return value 1.
Action start 11:01:19: PublishProduct.
Action ended 11:01:19: PublishProduct. Return value 1.
Action start 11:01:19: InstallFinalize.
CreateDatabase: Error 0x80004005: failed to create to database: 'TestDatabase1', error:
unknown error
Error 26201. Error -2147467259: failed to create SQL database: TestDatabase1, error detail:
unknown error.
MSI (s) (94!44) [11:01:47:973]: Product: DbInstallerTest -- Error 26201. Error -2147467259:
failed to create SQL database: TestDatabase1, error detail: unknown error.
CustomAction CreateDatabase returned actual error code 1603 (note this may not be 100%
accurate if translation happened inside sandbox)
Action ended 11:01:47: InstallFinalize. Return value 3.
Action ended 11:01:48: INSTALL. Return value 3.
Action ended 11:01:48: ExecuteAction. Return value 3.
Action ended 11:01:48: INSTALL. Return value 3.
=== Logging stopped: 2/18/2013 11:01:48 ===
MSI (c) (C0:94) [11:01:48:208]: Product: DbInstallerTest -- Installation failed.
MSI (c) (C0:94) [11:01:48:209]: Windows Installer installed the product. Product Name:
DbInstallerTest. Product Version: 1.0.0.0. Product Language: 1033. Manufacturer: Microsoft.
Installation success or error status: 1603.
What am I doing wrong here?
asked Feb 18, 2013 at 5:43
We chased this error around for a week before finally resolving it by going into the SQL Server Configuration Manager → SQL Server Network Configuration → Protocols for MSSQLSERVER (for us, the default instance) → Enabling Named Pipes and TCP/IP protocols.
answered Mar 31, 2014 at 18:22
I was also facing this exact issue, and I browsed a lot of forums to get that solved. This was the only thing which worked for me. On my computer, SQL Server Express Edition database creation failed with
-2147467259: failed to create SQL database:
After days of hacking I finally found the solution! All you need to do
is use .sqlexpress instead of localhostsqlexpress or
127.0.0.1sqlexpress in your connection string. I think (and I might be terribly wrong here) when you use .sqlexpress in connection string
installer uses Shared Memory instead of Named Pipes or TCP/IP.
Source: Solution to -2147467259: failed to create SQL database
answered Apr 24, 2014 at 15:43
Soman DubeySoman Dubey
3,7894 gold badges22 silver badges31 bronze badges
Err 26201 is more useful. You should also see more information in the event logs.
Your code indicates that you are using mixed mode on the SQL instance and authenticating as a SQL login. This indicates that the problem is likely that your SQL service account doesn’t have permissions to create the MDF and LDF files in the default locations.
See this thread for more info:
Error 26201. Error -2147467259: failed to create SQL database
answered Feb 18, 2013 at 14:34
So I am also getting an error in my WiX installer logs also, however slightly different.
Environment:
- WebServer = Windows 2008 R2
- SQLServer = Windows 2008 32-bit with SQL Server 2008 R2 Standard
- Mixed Mode Authentication
- Default SQL Instance
Error:
ExecuteSqlStrings: Entering ExecuteSqlStrings in
C:WindowsInstallerMSI1EC7.tmp, version 3.6.3303.0ExecuteSqlStrings: Error 0x80004005: failed to connect to database:
‘DatabaseNameBla’Error 26203. Failed to connect to SQL database.
(-2147467259 DatabaseNameBla ) MSI (s) (20!30) [10:16:32:225]:
Product: Bla Services — Error 26203. Failed to connect to SQL
database. (-2147467259 DatabaseNameBla )
Research:
- Instance DB seems to have only 1.6 GB left on the hard drive. << this might be bad…
- My user is sysadmin
- Access Through SQL Management Tools has no problems with the same user.
- SLQ Logs have nothing in them to assist with the error. Just noise.
My Solution:
- VM has a D drive with 50 GB free
- New Database Instance on D Drive
- New Instance Set to Mixed Mode
- Reinstalled. Success!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Summary:
So after hours of trying to figure out what the deal was. In the instance of this error, it was related to the hard drive free space size. Since the SQL Server was in production we were unable to expand the C drive to see if that fixed the default instance.
answered Apr 11, 2014 at 15:48
OmzigOmzig
8611 gold badge12 silver badges20 bronze badges
- Remove From My Forums
-
Question
-
I’m trying to get SQL Server to send an email. The test email works fine; basically DBMail works properly. The thing is, if a human runs it, everything is fine. If I schedule it using Sql Server Agent Job, nothing works. I think this
has something to do with a proxy, or some such thing. Any thoughts on what could be wrong?As I know, the security features are much different than those from earlier versions.
I’m using SQL Server Developer Edition 2014.
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.
Answers
-
So it is a T-SQL jobstep from where you execute the sp_send_dbmail procedure? And if you execute exactly the same code in a query window it work fine?
If so, check the history for the job, define and check the output file and also check the log for Database Mail. Between these three you should be able to find error message(s) that help you hunt down the root of this problem.
Tibor Karaszi, SQL Server MVP |
web | blog-
Proposed as answer by
Monday, November 3, 2014 8:45 PM
-
Marked as answer by
Saeid Hasani
Monday, November 3, 2014 9:23 PM
-
Proposed as answer by
This error is generated when you attempt to update a field with a value that is outside the range of acceptable values. It can also be generated if you attempt to create a new record that would result in a duplicate. You can tell more about what caused the error by looking at the last part of the description.
Negative Value Not Allowed
[TimberlineODBC][TimberlineODBCEngine ODBC Driver][DRM File Library]NNUME21: Negative value not allowed. This error is from an example where the user attempted to write a negative number to a field that only accepts positive numbers.
Invalid Entry
[Timberline][ODBC Driver][DLL]Invalid entry.This error indicates that an unacceptable value was supplied for a field that is normally displayed in a drop down list. For example, writing Giant to the Vendor Type field when there is no such vendor type.
Illegal duplicate key.
[TimberlineODBC][TimberlineODBCEngine ODBC Driver][DRM File Library]Illegal duplicate key.This error can be generated when you try to create a new record when a record with the same key already exists. For example, you might accidentally run into this error when creating a GL budget based on last year’s budget if you forget to increment the year before writing the data.
I’m trying to update some maintenance plans to make use of Ola Hallengren’s IndexOptimize,
but also mail the result of the operation using msdb.dbo.sp_send_dbmail.
Old T-SQL:
declare @indexQuery nvarchar(1000);
set @indexQuery = 'USE [MyDB];
SELECT i.index_id, i.name, s.avg_fragmentation_in_percent
FROM sys.dm_db_index_physical_stats (
DB_ID(),
OBJECT_ID(N''MyTable''),
DEFAULT, DEFAULT, DEFAULT) s, sys.indexes i
WHERE s.object_id = i.object_id
AND s.index_id = i.index_id;';
exec msdb.dbo.sp_send_dbmail
@profile_name = 'Local Mail Profile'
,@recipients = 'someone@somewhere.co.uk'
,@subject = 'Re-index Started'
,@query = @indexQuery
,@attach_query_result_as_file = 1
,@query_attachment_filename = 'Reindex BEFORE.txt'
…and this works perfectly fine.
But if I modify @indexQuery thusly:
set @indexQuery = 'IndexOptimize ''MyDB''';
…to make use of the IndexOptimize procedure, the result is:
Failed to initialize sqlcmd library with error number -2147467259.
I can’t seem to find anything related to the error number anywhere to work out what the problem is.
Can anyone please shed any light on it for me?
Could not connect to the SQL database. (-2147467259 master ). This can be caused by insufficient permissions. Indirect permissions through Windows group memberships may not work as expected when User Account Control (UAC) is turned on.
Hi all,
During Installation of NAV 2009 & Later, sometime we come across an error which says —
Could not connect to the SQL database. (-2147467259 master ). This can be caused by insufficient permissions. Indirect permissions through Windows group memberships may not work as expected when User Account Control (UAC) is turned on.
This error can be occured due to multile Reasons, so there are mutiple resoultion for the same.
Resolutions —
1) Did u Run installer as Administrator (If Operating system is Windows 7)?
If not then try intalling using Run as Administrator.
2) Go to services.msc from RUN and check that SQL Server service is running or not. If not start the service and try intalling again.
3) Your Windows does not have sufficient priviledges on the SQL Server. Set up your account with the sysadm server role. Note, that you cannot rely on indirect permissions through Windows group memberships when Vista User Access Control (UAC) is turned on. Try seraching UAC in Control Panel.
4) A previous installation has left the database files (mdf+ldf) sitting in the Program FilesMicrosoft Dynamics NAV60Database folder and the SQL Server has been reinstalled. This will result in the installer trying to attach an orphaned database. If this is the case, then you should just delete the files or Rename the Database, run the installation once where you select to remove the database components, and run the installation once again where you select to install the demo database.
These are the comman resolutions in this case i was able to find it. I hope someone might be helpfull and it resolve someones issues.
Thanks & Regards,
Saurav Dhyani
Popular posts from this blog
Hi All, In this article we will discuss the new introduced member of Dynamics Family. Yes you heard it correctly, one more new member with Name «Microsoft Dynamics 365» . #ProjectMadeira #Dynamics365
Hi all, We have seen how to save a report into PDF and how to send mail to a customer. Let’s link these two post in one i.e. Mailing statement to a customer into PDF Format. This article is part of the Series. Please Refer Table of Content here . If you have the old objects set let me brief you what I will be changing —
Hi Readers, We have already talked about the number of steps for upgrading to Business Central on Premises from different NAV versions. After that article, I received multiple requests for an article which list down steps for Data Migration. In this article, we will discuss steps of data migration to MSDYN365BC (on-Prem) from NAV 2017. For this article, I am considering a Cronus Demo Database without any customization. For an actual upgrade project, we will have to complete object merge using compare and Merge process. After the Merge Process, the next step is data migration. Let’s discuss those steps. Direct Upgrade to Microsoft Dynamics 365 Business Central (on-Prem) is from following versions — 1. NAV 2015. 2. NAV 2016. 3. NAV 2017. 4. NAV 2018.

