Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

Sunday, March 25, 2012

(MS Access) FIRST command equivalent in SQL Server

Is there an equivalent to the command FIRST from MS Access for SQL Server?
The command 'Top 1' doesn't seem to be the same...
:confused:What functionality do you need ?

(how frequent) in SQL Server?!

I have used Base SAS for analysis for a while and it was really great.. everything is easy just with a simple command.. I am sure it's not the same in SQL Server but I need some help on how to start with the following:

I have a field called call_country and another field called call_minute. Each call will be saved with the destination country and the total number of minutes..

and I want to run a query to see what are the TOP frequent destinations in this format:

United States - Count: 420 - Total Minues: 12,345

It should be easy in SQL too.

SELECT call_country, COUNT(call_minutes) AS tCount, SUM(call_minutes) AS TotalMinutes

FROM calltable

GROUP BY call_country

|||

If you want use the top, you can do this:

--1.based on total minutes

SELECT TOP (1) call_country, COUNT(call_minutes) AS tCount, SUM(call_minutes) AS TotalMinutes

FROM calltable

GROUP BY call_country

ORDER BY TotalMinutes DESC

--2. based on total count

SELECT TOP (1) call_country, COUNT(call_minutes) AS tCount, SUM(call_minutes) AS TotalMinutes

FROM calltable

GROUP BY call_country

ORDER BY tCount DESC

--3.based on total count and use total minutes as tie break.

SELECT TOP (1) call_country, COUNT(call_minutes) AS tCount, SUM(call_minutes) AS TotalMinutes

FROM calltable

GROUP BY call_country

ORDER BY tCount DESC, TotalMinutes DESC

--4.based on total minutes and use total count as tie break.

SELECT TOP (1) call_country, COUNT(call_minutes) AS tCount, SUM(call_minutes) AS TotalMinutes

FROM calltable

GROUP BY call_country

ORDER BY TotalMinutes DESC, tCount DESC

Thursday, March 22, 2012

(GUID problem) What is wrong with this code ?

Hi, just learning SQL2000.
I have this code:
mSQL = "UPDATE Contactpersonen SET Naam=? WHERE ContactpersoonID=?"
Command = New SqlClient.SqlCommand(mSQL, C_CP)
Command.Parameters.Add("Naam", txtNaam.Text)
Command.Parameters.Add("CPID", SqlDbType.UniqueIdentifier).Value = m_CP_ID

where m_CP_ID is defined as a GUID in:
Public Property m_CP_ID() As Guid
Get
If Not viewstate("m_CP_ID") Is Nothing Then
Return viewstate("m_CP_ID")
End If
'Return 0
End Get
Set(ByVal Value As Guid)
viewstate("m_CP_ID") = Value
End Set
End Property

When running the app I got this error:
Server Error in '/4D' Application.
------------------------

Line 1: Incorrect syntax near 'Naam'. Line 1: Incorrect syntax near '?'.(points to mSQL above)
I know it has something to do with the GUID, but I cannot guess what.
Help is appreciated, Ger.


Try this:
mSQL = "UPDATE Contactpersonen SETNaam=@.Naam WHEREContactpersoonID=@.CPID"
Command = New SqlClient.SqlCommand(mSQL, C_CP)
Command.Parameters.Add("@.Naam", txtNaam.Text)
Command.Parameters.Add("@.CPID", SqlDbType.UniqueIdentifier).Value = m_CP_ID
|||Hey SonuKapoor, that works !!!!!!
Thanks a lot, every day I learn more and more... thanks to guys as you,
regards from the North Sea,
Ger.

Tuesday, March 20, 2012

"Visual Studio 2005 Command Prompt" missing from SQL Server 2005 Express Toolkit insta

The program shortcut "Visual Studio 2005 Command Prompt" seems to be mising from the "Visual Studio 2005 Command Prompt" Start menu added by the current Microsoft SQL Server 2005 Express Edition Toolkit. Where is it? How to workaround?

I am trying to do Download details SQL Server 2005 Samples and Sample Databases (April 2006) -> GettingStartedWithSQLSamples.htm which says "a. Open a Microsoft Visual Studio 2005 command prompt. Click Start, point to All Programs, point to Microsoft Visual Studio 2005, point to Visual Studio Tools, and then click Visual Studio 2005 Command Prompt." but I can find no such command prompt within "Visual Studio Tools", only "Visual Studio 2005 Remote Debugger{, Configuration Wizard}".

What's wrong? How to fix or workaround? I'd install .NET SDK 2.0 to get it's Command Prompt but that's about 570MB merely for a command prompt!

Thanks for your help, -Mike Parker

I believe that the toolkit does not come with the command prompt and the instructions for the samples were written before Advanced was shipped.

What are you trying to do with the samples? If you don't have a copy of VS installed its going to be pretty hard to do anything with them. If you just want accesst to the SQL Server samples I don't think you need a command prompt.

Saturday, February 25, 2012

"Command text was not set for the command object" Error

Hi. I am writing a program in C# to migrate data from a Foxpro database to an SQL Server 2005 Express database. The package is being created programmatically. I am creating a separate data flow for each Foxpro table. It seems to be doing it ok but I am getting the following error message at the package validation stage:

Description: An OLE DB Error has occured. Error code: 0x80040E0C.

An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E0C Description: "Command text was not set for the command object".

.........

Description: "component "OLE DB Destination" (22)" failed validation and returned validation status "VS_ISBROKEN".

This is the first time I am writing such code and I there must be something I am not doing correct but can't seem to figure it out. Any help will be highly appreciated. My code is as below:

private bool BuildPackage()

{

// Create the package object

oPackage = new Package();

// Create connections for the Foxpro and SQL Server data

Connections oPkgConns = oPackage.Connections;

// Foxpro Connection

ConnectionManager oFoxConn = oPkgConns.Add("OLEDB");

oFoxConn.ConnectionString = sSourceConnString; // Created elsewhere

oFoxConn.Name = "SourceConnectionOLEDB";

oFoxConn.Description = "OLEDB Connection For Foxpro Database";

// SQL Server Connection

ConnectionManager oSQLConn = oPkgConns.Add("OLEDB");

oSQLConn.ConnectionString = sTargetConnString; // Created elsewhere

oSQLConn.Name = "DestinationConnectionOLEDB";

oSQLConn.Description = "OLEDB Connection For SQL Server Database";

// Add Prepare SQL Task

Executable exSQLTask = oPackage.Executables.Add("STOCK:SQLTask");

TaskHost thSQLTask = exSQLTask as TaskHost;

thSQLTask.Properties["Connection"].SetValue(thSQLTask, "oSQLConn");

thSQLTask.Properties["DelayValidation"].SetValue(thSQLTask, true);

thSQLTask.Properties["ResultSetType"].SetValue(thSQLTask, ResultSetType.ResultSetType_None);

thSQLTask.Properties["SqlStatementSource"].SetValue(thSQLTask, @."C:\LPFMigrate\LPF_Script.sql");

thSQLTask.Properties["SqlStatementSourceType"].SetValue(thSQLTask, SqlStatementSourceType.FileConnection);

thSQLTask.FailPackageOnFailure = true;

// Add Data Flow Tasks. Create a separate task for each table.

// Get a list of tables from the source folder

arFiles = Directory.GetFileSystemEntries(sLPFDataFolder, "*.DBF");

for (iCount = 0; iCount <= arFiles.GetUpperBound(0); iCount++)

{

// Get the name of the file from the array

sDataFile = Path.GetFileName(arFiles[iCount].ToString());

sDataFile = sDataFile.Substring(0, sDataFile.Length - 4);

oDataFlow = ((TaskHost)oPackage.Executables.Add("DTS.Pipeline.1")).InnerObject as MainPipe;

oDataFlow.AutoGenerateIDForNewObjects = true;

// Create the source component

IDTSComponentMetaData90 oSource = oDataFlow.ComponentMetaDataCollection.New();

oSource.Name = (sDataFile + "Src");

oSource.ComponentClassID = "DTSAdapter.OLEDBSource.1";

// Get the design time instance of the component and initialize the component

CManagedComponentWrapper srcDesignTime = oSource.Instantiate();

srcDesignTime.ProvideComponentProperties();

// Add the connection manager

if (oSource.RuntimeConnectionCollection.Count > 0)

{

oSource.RuntimeConnectionCollection[0].ConnectionManagerID = oFoxConn.ID;

oSource.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(oFoxConn);

}

// Set Custom Properties

srcDesignTime.SetComponentProperty("AccessMode", 0);

srcDesignTime.SetComponentProperty("AlwaysUseDefaultCodePage", true);

srcDesignTime.SetComponentProperty("OpenRowset", sDataFile);

// Re-initialize metadata

srcDesignTime.AcquireConnections(null);

srcDesignTime.ReinitializeMetaData();

srcDesignTime.ReleaseConnections();

// Create Destination component

IDTSComponentMetaData90 oDestination = oDataFlow.ComponentMetaDataCollection.New();

oDestination.Name = (sDataFile + "Dest");

oDestination.ComponentClassID = "DTSAdapter.OLEDBDestination.1";

// Get the design time instance of the component and initialize the component

CManagedComponentWrapper destDesignTime = oDestination.Instantiate();

destDesignTime.ProvideComponentProperties();

// Add the connection manager

if (oDestination.RuntimeConnectionCollection.Count > 0)

{

oDestination.RuntimeConnectionCollection[0].ConnectionManagerID = oSQLConn.ID;

oDestination.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(oSQLConn);

}

// Set custom properties

destDesignTime.SetComponentProperty("AccessMode", 2);

destDesignTime.SetComponentProperty("AlwaysUseDefaultCodePage", false);

destDesignTime.SetComponentProperty("OpenRowset", "[dbo].[" + sDataFile + "]");

// Create the path to link the source and destination components of the dataflow

IDTSPath90 dfPath = oDataFlow.PathCollection.New();

dfPath.AttachPathAndPropagateNotifications(oSource.OutputCollection[0], oDestination.InputCollection[0]);

// Iterate through the inputs of the component.

foreach (IDTSInput90 input in oDestination.InputCollection)

{

// Get the virtual input column collection

IDTSVirtualInput90 vInput = input.GetVirtualInput();

// Iterate through the column collection

foreach (IDTSVirtualInputColumn90 vColumn in vInput.VirtualInputColumnCollection)

{

// Call the SetUsageType method of the design time instance of the component.

destDesignTime.SetUsageType(input.ID, vInput, vColumn.LineageID, DTSUsageType.UT_READWRITE);

}

//Map external metadata to the inputcolumn

foreach (IDTSInputColumn90 inputColumn in input.InputColumnCollection)

{

IDTSExternalMetadataColumn90 externalColumn = input.ExternalMetadataColumnCollection.New();

externalColumn.Name = inputColumn.Name;

externalColumn.Precision = inputColumn.Precision;

externalColumn.Length = inputColumn.Length;

externalColumn.DataType = inputColumn.DataType;

externalColumn.Scale = inputColumn.Scale;

// Map the external column to the input column.

inputColumn.ExternalMetadataColumnID = externalColumn.ID;

}

}

}

// Add precedence constraints to the package executables

PrecedenceConstraint pcTasks = oPackage.PrecedenceConstraints.Add((Executable)thSQLTask, oPackage.Executables[0]);

pcTasks.Value = DTSExecResult.Success;

for (iCount = 1; iCount <= (oPackage.Executables.Count - 1); iCount++)

{

pcTasks = oPackage.PrecedenceConstraints.Add(oPackage.Executables[iCount - 1], oPackage.Executables[iCount]);

pcTasks.Value = DTSExecResult.Success;

}

// Validate the package

DTSExecResult eResult = oPackage.Validate(oPkgConns, null, null, null);

// Check if the package was successfully executed

if (eResult.Equals(DTSExecResult.Canceled) || eResult.Equals(DTSExecResult.Failure))

{

string sErrorMessage = "";

foreach (DtsError pkgError in oPackage.Errors)

{

sErrorMessage = sErrorMessage + "Description: " + pkgError.Description + "\n";

sErrorMessage = sErrorMessage + "HelpContext: " + pkgError.HelpContext + "\n";

sErrorMessage = sErrorMessage + "HelpFile: " + pkgError.HelpFile + "\n";

sErrorMessage = sErrorMessage + "IDOfInterfaceWithError: " + pkgError.IDOfInterfaceWithError + "\n";

sErrorMessage = sErrorMessage + "Source: " + pkgError.Source + "\n";

sErrorMessage = sErrorMessage + "Subcomponent: " + pkgError.SubComponent + "\n";

sErrorMessage = sErrorMessage + "Timestamp: " + pkgError.TimeStamp + "\n";

sErrorMessage = sErrorMessage + "ErrorCode: " + pkgError.ErrorCode;

}

MessageBox.Show("The DTS package was not built successfully because of the following error(s):\n\n" + sErrorMessage, "Package Builder", MessageBoxButtons.OK, MessageBoxIcon.Information);

return false;

}

// return a successful result

return true;

}

So the OLE-DB Destination is not happy and I cannot see anything obvious. A better way to debug this would be to just add a Save method before validation to save your package to disk. You can then open it in Visual Studio/BIDS, and enjoy the full GUI experience to help find the problem. I've found this method very useful for just checking packages when building programmatically.

|||

I have inserted code to save the package just before the validation but it throws an exception. And I don't find the help in MSDN very useful!! I want to save the package in the folder C:\LPFMigrate and call it Package.dtsx. The code is as follows:

oApp = new Microsoft.SqlServer.Dts.Runtime.Application();

oApp.SaveToDtsServer(oPackage, null, @."C:\LPFMigrate\Package", "MARS");

Any idea why an exception is being thrown? The exception message is:

The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

Friday, February 24, 2012

"C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\setup.exe" finished and retu

Hello,

We are running Windows Server 2003 SP 1 and trying to upgrade SQL 2000 SP 4 to SQL 2005 using the command line.

The process finishes in under ten minutes. Summary.txt file we have this information:

Log File : C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files\SQLSetup_<ServerName>_SQL.log
Last Action : ValidateUpgrade
Error String : The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed
Error Number : 2259

In the log file named SQLSetup_ServerName_Core.log I found the following:

Error: Action "LaunchLocalBootstrapAction" threw an exception during execution. Error information reported during run:
"C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\setup.exe" finished and returned: 1627
Aborting queue processing as nested installer has completed
Message pump returning: 1627

After receiving this info, I can navigate to the setup.bat for the SQL 2005 upgrade and complete the upgrade without error. We are planning on 500 of these, so manual updates is a very ugly concept.

I'd appreciate any and all ideas on where to go from here.

Most Sincerely.

Could you search inside the *_SQL.log for the string mentioned in summary.txt:

"The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed"

When you find the string, could you copy the lines above and below so we could see the context around the error? Hopefully you could include all the logging statements associated with the ValidateUpgrade action. It should start with a line like this:

<Func Name='ValidateUpgrade'>

Thanks!

|||

Dear R.Green,

I appreciate your help. The results of your request follows. Please let me know if I can help in any other way.

Thanks,

Bill

Function=SAPasswordPolicyCheck
Skipping Action: SAPasswordPolicyCheck (Condition is false)
<EndFunc Name='LaunchFunction' Return='0' GetLastError='0'>
MSI (s) (A4:94) [11:38:44:323]: Doing action: ValidateUpgrade.D20239D7_E87C_40C9_9837_E70B8D4882C2
Action ended 11:38:44: SAPasswordPolicyCheck.D20239D7_E87C_40C9_9837_E70B8D4882C2. Return value 1.
MSI (s) (A4:2C) [11:38:44:339]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI11F.tmp, Entrypoint: ValidateUpgrade
Action start 11:38:44: ValidateUpgrade.D20239D7_E87C_40C9_9837_E70B8D4882C2.
<Func Name='LaunchFunction'>
Function=ValidateUpgrade
<Func Name='SetCAContext'>
<EndFunc Name='SetCAContext' Return='T' GetLastError='0'>
Doing Action: ValidateUpgrade
PerfTime Start: ValidateUpgrade : Tue Nov 14 11:38:44 2006
<Func Name='ValidateUpgrade'>
<Func Name='updateFeatureSellection'>
<Func Name='SqlComponentUpgrade'>
<Func Name='SetCAContext'>
<EndFunc Name='SetCAContext' Return='T' GetLastError='0'>
<Func Name='ProcessHeaderTable'>
<Func Name='ProcessScriptTable'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='ProcessScriptTable'>
<Func Name='GetFileTargetPath'>
MSI (s) (A4!B0) [11:38:44:464]: Note: 1: 2205 2: 3: _sqlSqlUpgradeSequence
MSI (s) (A4!B0) [11:38:44:464]: Note: 1: 2228 2: 3: _sqlSqlUpgradeSequence 4: CREATE TABLE `_sqlSqlUpgradeSequence` (`Action` CHAR(255) NOT NULL, `Sequence` INT NOT NULL, `Param` CHAR(0), `Retryable` INT NOT NULL, `Fatal` INT NOT NULL PRIMARY KEY `Action`, `Sequence`)
MSI (s) (A4!B0) [11:38:44:464]: Note: 1: 2262 2: _sqlSqlUpgradeSequence 3: -2147287038
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Adding Sql_sqlSqlUpgradeSequence property. Its value is '15000000'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '15000000'. Its new value: '30000000'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '30000000'. Its new value: '30040000'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '30040000'. Its new value: '30050000'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '30050000'. Its new value: '30150000'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '30150000'. Its new value: '100150000'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '100150000'. Its new value: '230871400'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '230871400'. Its new value: '245871400'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '245871400'. Its new value: '275871400'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '275871400'. Its new value: '275971400'.
<Func Name='GetFileTargetPath'>
<EndFunc Name='SqlComponentUpgrade' Return='0' GetLastError='0'>
Added FTE to SqlUpgrade property
Added REPL to SqlUpgrade property
<Func Name='updateFeatureSellection'>
MSI (s) (A4!B0) [11:38:44:636]: skipping installation of assembly component: {7F618CB9-9BCE-4C1E-9E33-59E8A564E456} since the assembly already exists
To perform upgrade setting feature SQL_Replication to be indtalled locally.
To perform upgrade setting feature SQL_FullText to be indtalled locally.
Running:
CollectInstallCases
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 44.44


Complete:
CollectInstallCases
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 44.44
, returned
true


Running:
DefineFeatureActionRules
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 44.44


Complete:
DefineFeatureActionRules
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 44.44
, returned
true


Running:
DefineInstallActionRules
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 44.44


Complete:
DefineInstallActionRules
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45
, returned
true


Running:
AddInstallCaseActions
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45


Complete:
AddInstallCaseActions
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45
, returned
true


Loaded DLL:
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\sqlboot.dll
Version:
2005.90.1399.0


Action "
languageUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "differentLanguage_with_1033_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Loaded DLL:
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\sqlboot.dll
Version:
2005.90.1399.0


Action "
maintenance_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "sameVersion_as_9.0.139906_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Loaded DLL:
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\sqlboot.dll
Version:
2005.90.1399.0


Action "
skuUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "NOT_sameSKU_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Loaded DLL:
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\sqlboot.dll
Version:
2005.90.1399.0


Action "
virtualization_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "virtualization_NotSupported_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Action "
warningPatchLevel_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "diffInstancePatchLevel_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Action "
warningSPLevel_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "diffInstanceSPLevel_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Action "
warningUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "warningUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Running:
versionUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45


Complete:
versionUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45
, returned
true


Running:
AddFeatureCase_versionUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45


Complete:
AddFeatureCase_versionUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45
, returned
true


Running:
FeaturePhaseAction
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45


Complete:
FeaturePhaseAction
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45
, returned
true


Action "
add_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER_SQL_Engine
" will be skipped due to the
following restrictions:


Condition "noFeatureConflict_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER_SQL_Engine" returned false.
Condition "NOT_featureInstalled_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER_SQL_Engine" returned false.
Condition "installActionAvailable_maintenance_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER_SQL_Engine" returned false.

Action "
remove_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER_SQL_Engine
" will be skipped due to the
following restrictions:


MSI (s) (A4!B0) [11:38:45:839]: PROPERTY CHANGE: Deleting AGTACCOUNT property. Its current value is 'CEDNetLive\Roamer'.
MSI (s) (A4!B0) [11:38:45:839]: PROPERTY CHANGE: Deleting AGTPASSWORD property. Its current value is '**********'.
Condition "installActionAvailable_maintenance_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER_SQL_Engine" returned false.

Attempt to start service when it is already running
SQL service MSSQLSERVER started successfully waiting for SQL service to accept client connections
Loaded DLL:
C:\WINDOWS\system32\Odbc32.dll
Version:
3.526.1830.0


SQL_SUCCESS_WITH_INFO (1) in OdbcConnection::connect
sqlstate=01000, level=-1, state=-1, native_error=5701, msg=[Microsoft][SQL Native Client][SQL Server]Changed database context to 'master'.
sqlstate=01000, level=-1, state=-1, native_error=5703, msg=[Microsoft][SQL Native Client][SQL Server]Changed language setting to us_english.

Executing External Command
Message type: Progress
10
Message type: Component
Database Engine
Message type: Status
Checking for SQL Connectivity...
Message type: Status
Starting analysis...
Message type: Status
Analyzing 1%
Message type: Status
Analyzing 5%
Message type: Status
Analyzing 15%
Message type: Status
Analyzing 16%
Message type: Status
Analyzing 17%
Message type: Status
Analyzing 18%
Message type: Status
Analyzing 20%
Message type: Status
Analyzing 21%
Message type: Status
Analyzing 30%
Message type: Status
Analyzing 33%
Message type: Status
Analyzing 34%
Message type: Status
Analyzing 35%
Message type: Status
Analyzing 38%
Message type: Status
Analyzing 50%
Message type: Status
Analyzing 51%
Message type: Status
Analyzing 55%
Message type: Status
Analyzing 66%
Message type: Status
Analyzing 67%
Message type: Status
Analyzing 68%
Message type: Status
Analyzing 71%
Message type: Status
Analyzing 83%
Message type: Status
Analyzing 84%
Message type: Status
Analyzing 85%
Message type: Status
Analyzing 88%
Message type: Status
Analyzing 90%
Message type: Status
Analyzing 100%
Message type: Status
Creating report
Message type: Status
Creating report
Message type: Progress
Info 100.100
<Func Name='SqlComponentUpgrade'>
<Func Name='SetCAContext'>
<EndFunc Name='SetCAContext' Return='T' GetLastError='0'>
<Func Name='ProcessHeaderTable'>
<Func Name='ProcessScriptTable'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='ProcessScriptTable'>
<Func Name='GetFileTargetPath'>
MSI (s) (A4!B0) [11:39:18:558]: Note: 1: 2259 2: 3: 4:
<Func Name='GetFileTargetPath'>
Error Code: 0x8007065b (1627)
Windows Error Text: Function failed during execution.
Source File Name: darlib\viewinstaller.cpp
Compiler Timestamp: Mon Jun 13 14:19:43 2005
Function Name: sqls::ViewInstaller::modify
Source Line Number: 137

- Context --


Setting status of unmanaged components and removing unmanaged resources
Failed to modify installer view
1: 2259 2: 3: 4:

Error Code: 1627
MSI (s) (A4!B0) [11:39:18:745]: Product: Microsoft SQL Server 2005 -- Error 2259. The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed

Error 2259. The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed
<Failure Type='Fatal' Error='1627'>
<EndFunc Name='LaunchFunction' Return='1627' GetLastError='0'>
Action ended 11:39:18: ValidateUpgrade.D20239D7_E87C_40C9_9837_E70B8D4882C2. Return value 3.
Action ended 11:39:18: INSTALL. Return value 3.
Property(S): ProductCode = {130A3BE1-85CC-4135-8EA7-5A724EE6CE2C}
Property(S): ProductLanguage = 1033
Property(S): Manufacturer = Microsoft Corporation
Property(S): ProductVersion = 9.00.1399.06
Property(S): MEDIAPACKAGEPATH = \Setup\

|||

Thank you for the follow up, we are still looking into this internally to see if we have any ideas. I'm wondering how you are installing SQL Server 2005. Is it from removable media, a network location, or from the hard drive? Did the media come from a download or was it burned from ISO?

The error message is strange because it should list the query that was attempted, but it looks to be an empty string. I'm just wondering if there is a possibility that the point of installation has a corrupt MSI database in some way.

|||

Hi,

Thanks for your efforts. We have a volume license agreement with Microsoft. I copied the two CDs we received under that agreement to an IDE drive on the server that is being upgraded. My template.ini file is pointing to that drive. We are running from the hard drive because we will push this upgrade to the field using LanDesk. To say it another way, we are not sending media to our hundred plus sites.

Please let me know if I didn't answer the correct question. (Something I do more and more as I get older.)

Thanks,

Bill

|||

Hi,

Any word on this? I need to keep this moving.

Thanks,

Bill

|||

Hi BaldManDBA

Any resolution? This is also a SQL Server 2005 Express edition issue too

see: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1663937&SiteID=1

Extract of my log:

- Context --


Setting status of unmanaged components and removing unmanaged resources
Failed to modify installer view
1: 2259 2: 3: 4:

Error Code: 1627
MSI (s) (9C!2C) [21:36:21:171]: Product: Microsoft SQL Server 2005 Express Edition -- Error 2259. The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed

Error 2259. The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed
<Func Name='SetCAContext'>
<EndFunc Name='SetCAContext' Return='T' GetLastError='203'>
Doing Action: ValidateUpgrade
PerfTime Start: ValidateUpgrade : Tue May 29 21:36:21 2007
<Func Name='ValidateUpgrade'>
<Func Name='updateFeatureSellection'>
<Func Name='SqlComponentUpgrade'>
<Func Name='SetCAContext'>
<EndFunc Name='SetCAContext' Return='T' GetLastError='203'>
<Func Name='ProcessHeaderTable'>
<Func Name='ProcessScriptTable'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>

In my case, it was simply a case of leave all the defaults during the SS2005 SP2 install, except the instance where (_) default instance had to be ticked instead of a named instance

Please let us know ... (as your solution may be related to all other SQL Server 2005 version/situations)

Alain

|||

Hi,

The server that generated that error was the only one to encounter the error. So, for that one server, we reinstalled SQL Server. All was OK after that. I hope this helps.

Thanks,

BaldManDBA.

"C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\setup.exe" finished and

Hello,

We are running Windows Server 2003 SP 1 and trying to upgrade SQL 2000 SP 4 to SQL 2005 using the command line.

The process finishes in under ten minutes. Summary.txt file we have this information:

Log File : C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files\SQLSetup_<ServerName>_SQL.log
Last Action : ValidateUpgrade
Error String : The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed
Error Number : 2259

In the log file named SQLSetup_ServerName_Core.log I found the following:

Error: Action "LaunchLocalBootstrapAction" threw an exception during execution. Error information reported during run:
"C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\setup.exe" finished and returned: 1627
Aborting queue processing as nested installer has completed
Message pump returning: 1627

After receiving this info, I can navigate to the setup.bat for the SQL 2005 upgrade and complete the upgrade without error. We are planning on 500 of these, so manual updates is a very ugly concept.

I'd appreciate any and all ideas on where to go from here.

Most Sincerely.

Could you search inside the *_SQL.log for the string mentioned in summary.txt:

"The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed"

When you find the string, could you copy the lines above and below so we could see the context around the error? Hopefully you could include all the logging statements associated with the ValidateUpgrade action. It should start with a line like this:

<Func Name='ValidateUpgrade'>

Thanks!

|||

Dear R.Green,

I appreciate your help. The results of your request follows. Please let me know if I can help in any other way.

Thanks,

Bill

Function=SAPasswordPolicyCheck
Skipping Action: SAPasswordPolicyCheck (Condition is false)
<EndFunc Name='LaunchFunction' Return='0' GetLastError='0'>
MSI (s) (A4:94) [11:38:44:323]: Doing action: ValidateUpgrade.D20239D7_E87C_40C9_9837_E70B8D4882C2
Action ended 11:38:44: SAPasswordPolicyCheck.D20239D7_E87C_40C9_9837_E70B8D4882C2. Return value 1.
MSI (s) (A4:2C) [11:38:44:339]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI11F.tmp, Entrypoint: ValidateUpgrade
Action start 11:38:44: ValidateUpgrade.D20239D7_E87C_40C9_9837_E70B8D4882C2.
<Func Name='LaunchFunction'>
Function=ValidateUpgrade
<Func Name='SetCAContext'>
<EndFunc Name='SetCAContext' Return='T' GetLastError='0'>
Doing Action: ValidateUpgrade
PerfTime Start: ValidateUpgrade : Tue Nov 14 11:38:44 2006
<Func Name='ValidateUpgrade'>
<Func Name='updateFeatureSellection'>
<Func Name='SqlComponentUpgrade'>
<Func Name='SetCAContext'>
<EndFunc Name='SetCAContext' Return='T' GetLastError='0'>
<Func Name='ProcessHeaderTable'>
<Func Name='ProcessScriptTable'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='ProcessScriptTable'>
<Func Name='GetFileTargetPath'>
MSI (s) (A4!B0) [11:38:44:464]: Note: 1: 2205 2: 3: _sqlSqlUpgradeSequence
MSI (s) (A4!B0) [11:38:44:464]: Note: 1: 2228 2: 3: _sqlSqlUpgradeSequence 4: CREATE TABLE `_sqlSqlUpgradeSequence` (`Action` CHAR(255) NOT NULL, `Sequence` INT NOT NULL, `Param` CHAR(0), `Retryable` INT NOT NULL, `Fatal` INT NOT NULL PRIMARY KEY `Action`, `Sequence`)
MSI (s) (A4!B0) [11:38:44:464]: Note: 1: 2262 2: _sqlSqlUpgradeSequence 3: -2147287038
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Adding Sql_sqlSqlUpgradeSequence property. Its value is '15000000'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '15000000'. Its new value: '30000000'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '30000000'. Its new value: '30040000'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '30040000'. Its new value: '30050000'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '30050000'. Its new value: '30150000'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '30150000'. Its new value: '100150000'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '100150000'. Its new value: '230871400'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '230871400'. Its new value: '245871400'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '245871400'. Its new value: '275871400'.
MSI (s) (A4!B0) [11:38:44:480]: PROPERTY CHANGE: Modifying Sql_sqlSqlUpgradeSequence property. Its current value is '275871400'. Its new value: '275971400'.
<Func Name='GetFileTargetPath'>
<EndFunc Name='SqlComponentUpgrade' Return='0' GetLastError='0'>
Added FTE to SqlUpgrade property
Added REPL to SqlUpgrade property
<Func Name='updateFeatureSellection'>
MSI (s) (A4!B0) [11:38:44:636]: skipping installation of assembly component: {7F618CB9-9BCE-4C1E-9E33-59E8A564E456} since the assembly already exists
To perform upgrade setting feature SQL_Replication to be indtalled locally.
To perform upgrade setting feature SQL_FullText to be indtalled locally.
Running:
CollectInstallCases
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 44.44


Complete:
CollectInstallCases
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 44.44
, returned
true


Running:
DefineFeatureActionRules
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 44.44


Complete:
DefineFeatureActionRules
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 44.44
, returned
true


Running:
DefineInstallActionRules
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 44.44


Complete:
DefineInstallActionRules
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45
, returned
true


Running:
AddInstallCaseActions
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45


Complete:
AddInstallCaseActions
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45
, returned
true


Loaded DLL:
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\sqlboot.dll
Version:
2005.90.1399.0


Action "
languageUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "differentLanguage_with_1033_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Loaded DLL:
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\sqlboot.dll
Version:
2005.90.1399.0


Action "
maintenance_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "sameVersion_as_9.0.139906_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Loaded DLL:
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\sqlboot.dll
Version:
2005.90.1399.0


Action "
skuUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "NOT_sameSKU_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Loaded DLL:
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\sqlboot.dll
Version:
2005.90.1399.0


Action "
virtualization_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "virtualization_NotSupported_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Action "
warningPatchLevel_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "diffInstancePatchLevel_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Action "
warningSPLevel_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "diffInstanceSPLevel_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Action "
warningUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
" will be skipped due to the
following restrictions:


Condition "warningUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER" returned false.

Running:
versionUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45


Complete:
versionUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45
, returned
true


Running:
AddFeatureCase_versionUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45


Complete:
AddFeatureCase_versionUpgrade_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45
, returned
true


Running:
FeaturePhaseAction
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45


Complete:
FeaturePhaseAction
at:
Info 2006.2006
/
10
/
14
11
:
Info 38.38
:
Info 45.45
, returned
true


Action "
add_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER_SQL_Engine
" will be skipped due to the
following restrictions:


Condition "noFeatureConflict_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER_SQL_Engine" returned false.
Condition "NOT_featureInstalled_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER_SQL_Engine" returned false.
Condition "installActionAvailable_maintenance_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER_SQL_Engine" returned false.

Action "
remove_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER_SQL_Engine
" will be skipped due to the
following restrictions:


MSI (s) (A4!B0) [11:38:45:839]: PROPERTY CHANGE: Deleting AGTACCOUNT property. Its current value is 'CEDNetLive\Roamer'.
MSI (s) (A4!B0) [11:38:45:839]: PROPERTY CHANGE: Deleting AGTPASSWORD property. Its current value is '**********'.
Condition "installActionAvailable_maintenance_MSSQLSERVER SQL 8.0 SQL Server Standalone Product MSSQLSERVER_SQL_Engine" returned false.

Attempt to start service when it is already running
SQL service MSSQLSERVER started successfully waiting for SQL service to accept client connections
Loaded DLL:
C:\WINDOWS\system32\Odbc32.dll
Version:
3.526.1830.0


SQL_SUCCESS_WITH_INFO (1) in OdbcConnection::connect
sqlstate=01000, level=-1, state=-1, native_error=5701, msg=[Microsoft][SQL Native Client][SQL Server]Changed database context to 'master'.
sqlstate=01000, level=-1, state=-1, native_error=5703, msg=[Microsoft][SQL Native Client][SQL Server]Changed language setting to us_english.

Executing External Command
Message type: Progress
10
Message type: Component
Database Engine
Message type: Status
Checking for SQL Connectivity...
Message type: Status
Starting analysis...
Message type: Status
Analyzing 1%
Message type: Status
Analyzing 5%
Message type: Status
Analyzing 15%
Message type: Status
Analyzing 16%
Message type: Status
Analyzing 17%
Message type: Status
Analyzing 18%
Message type: Status
Analyzing 20%
Message type: Status
Analyzing 21%
Message type: Status
Analyzing 30%
Message type: Status
Analyzing 33%
Message type: Status
Analyzing 34%
Message type: Status
Analyzing 35%
Message type: Status
Analyzing 38%
Message type: Status
Analyzing 50%
Message type: Status
Analyzing 51%
Message type: Status
Analyzing 55%
Message type: Status
Analyzing 66%
Message type: Status
Analyzing 67%
Message type: Status
Analyzing 68%
Message type: Status
Analyzing 71%
Message type: Status
Analyzing 83%
Message type: Status
Analyzing 84%
Message type: Status
Analyzing 85%
Message type: Status
Analyzing 88%
Message type: Status
Analyzing 90%
Message type: Status
Analyzing 100%
Message type: Status
Creating report
Message type: Status
Creating report
Message type: Progress
Info 100.100
<Func Name='SqlComponentUpgrade'>
<Func Name='SetCAContext'>
<EndFunc Name='SetCAContext' Return='T' GetLastError='0'>
<Func Name='ProcessHeaderTable'>
<Func Name='ProcessScriptTable'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='ProcessScriptTable'>
<Func Name='GetFileTargetPath'>
MSI (s) (A4!B0) [11:39:18:558]: Note: 1: 2259 2: 3: 4:
<Func Name='GetFileTargetPath'>
Error Code: 0x8007065b (1627)
Windows Error Text: Function failed during execution.
Source File Name: darlib\viewinstaller.cpp
Compiler Timestamp: Mon Jun 13 14:19:43 2005
Function Name: sqls::ViewInstaller::modify
Source Line Number: 137

- Context --


Setting status of unmanaged components and removing unmanaged resources
Failed to modify installer view
1: 2259 2: 3: 4:

Error Code: 1627
MSI (s) (A4!B0) [11:39:18:745]: Product: Microsoft SQL Server 2005 -- Error 2259. The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed

Error 2259. The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed
<Failure Type='Fatal' Error='1627'>
<EndFunc Name='LaunchFunction' Return='1627' GetLastError='0'>
Action ended 11:39:18: ValidateUpgrade.D20239D7_E87C_40C9_9837_E70B8D4882C2. Return value 3.
Action ended 11:39:18: INSTALL. Return value 3.
Property(S): ProductCode = {130A3BE1-85CC-4135-8EA7-5A724EE6CE2C}
Property(S): ProductLanguage = 1033
Property(S): Manufacturer = Microsoft Corporation
Property(S): ProductVersion = 9.00.1399.06
Property(S): MEDIAPACKAGEPATH = \Setup\

|||

Thank you for the follow up, we are still looking into this internally to see if we have any ideas. I'm wondering how you are installing SQL Server 2005. Is it from removable media, a network location, or from the hard drive? Did the media come from a download or was it burned from ISO?

The error message is strange because it should list the query that was attempted, but it looks to be an empty string. I'm just wondering if there is a possibility that the point of installation has a corrupt MSI database in some way.

|||

Hi,

Thanks for your efforts. We have a volume license agreement with Microsoft. I copied the two CDs we received under that agreement to an IDE drive on the server that is being upgraded. My template.ini file is pointing to that drive. We are running from the hard drive because we will push this upgrade to the field using LanDesk. To say it another way, we are not sending media to our hundred plus sites.

Please let me know if I didn't answer the correct question. (Something I do more and more as I get older.)

Thanks,

Bill

|||

Hi,

Any word on this? I need to keep this moving.

Thanks,

Bill

|||

Hi BaldManDBA

Any resolution? This is also a SQL Server 2005 Express edition issue too

see: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1663937&SiteID=1

Extract of my log:

- Context --


Setting status of unmanaged components and removing unmanaged resources
Failed to modify installer view
1: 2259 2: 3: 4:

Error Code: 1627
MSI (s) (9C!2C) [21:36:21:171]: Product: Microsoft SQL Server 2005 Express Edition -- Error 2259. The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed

Error 2259. The installer has encountered an unexpected error. The error code is 2259. Database: Table(s) Update failed
<Func Name='SetCAContext'>
<EndFunc Name='SetCAContext' Return='T' GetLastError='203'>
Doing Action: ValidateUpgrade
PerfTime Start: ValidateUpgrade : Tue May 29 21:36:21 2007
<Func Name='ValidateUpgrade'>
<Func Name='updateFeatureSellection'>
<Func Name='SqlComponentUpgrade'>
<Func Name='SetCAContext'>
<EndFunc Name='SetCAContext' Return='T' GetLastError='203'>
<Func Name='ProcessHeaderTable'>
<Func Name='ProcessScriptTable'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>
<Func Name='GetFileTargetPath'>

In my case, it was simply a case of leave all the defaults during the SS2005 SP2 install, except the instance where (_) default instance had to be ticked instead of a named instance

Please let us know ... (as your solution may be related to all other SQL Server 2005 version/situations)

Alain

|||

Hi,

The server that generated that error was the only one to encounter the error. So, for that one server, we reinstalled SQL Server. All was OK after that. I hope this helps.

Thanks,

BaldManDBA.

Saturday, February 11, 2012

#of rows updated

Is there a command that will tell me the number of rows that are updated in a statement. I would like to put this in an Stored Procedure and pass the #rows updated back out.you can just look at @.@.ROWCOUNT after you do a statment and it will tell you how many rows were affected by the last SQL statement.

i.e., SELECT @.@.ROWCOUNT

or better yet, put it into a local variable such as:

DECLARE @.RowCountToReturn int

SELECT * FROM dbo.MyTable
SET @.RowCountToReturn = @.@.ROWCOUNTKeep in mind that pretty much EVERY SQL statement changes the value of @.@.ROWCOUNT, so you need to save it off if you have any code that may change it before you return it to your calling procedure.

Thursday, February 9, 2012

##tblTemp invisible for bcp

I did create #tblTemp on sql but can not use it with "outside" bcp routine
from command line:
Error = [Microsoft][ODBC SQL ...][SQL Server]Invalid object name '##tblTemp'.
Any idea why?
--
gokWhy do you want to BCP into a global temp table? If you are already in tsql
then why not use Bulk Insert instead? Not that I am recommending you use
temp tables but at least Bulk Insert can see a local temp table.
Andrew J. Kelly SQL MVP
"gok" <gok@.discussions.microsoft.com> wrote in message
news:A182DF5D-B64F-4E66-8F38-7A06EEFD6159@.microsoft.com...
>I did create #tblTemp on sql but can not use it with "outside" bcp routine
> from command line:
> Error = [Microsoft][ODBC SQL ...][SQL Server]Invalid object name
> '##tblTemp'.
> Any idea why?
> --
> gok
>|||I have a data file (from user verification in xsl) I need to import to sql.
the idea was to give client copy of bcp.exe and he will post data from his
machine to sql. In BULK INSERT I have to use shared folder to import data
from file, otherwise this file still "invisible" for sql (I was trying query
analyzer on non-sql machine).
What would be a correct way to append data from file?
"Andrew J. Kelly" wrote:

> Why do you want to BCP into a global temp table? If you are already in ts
ql
> then why not use Bulk Insert instead? Not that I am recommending you use
> temp tables but at least Bulk Insert can see a local temp table.
> --
> Andrew J. Kelly SQL MVP
>
> "gok" <gok@.discussions.microsoft.com> wrote in message
> news:A182DF5D-B64F-4E66-8F38-7A06EEFD6159@.microsoft.com...
>
>|||The correct way is dependant on your needs. But I would never want to give
a client direct permission to import a file with BCP to my production
server. Why not have them FTP it to a secure folder on your server or
somewhere the server can get to it. Then use Bluk Insert to load it.
Andrew J. Kelly SQL MVP
"gok" <gok@.discussions.microsoft.com> wrote in message
news:105F0D2F-92B5-427A-96FB-F17BEAABE17F@.microsoft.com...
>I have a data file (from user verification in xsl) I need to import to sql.
> the idea was to give client copy of bcp.exe and he will post data from his
> machine to sql. In BULK INSERT I have to use shared folder to import data
> from file, otherwise this file still "invisible" for sql (I was trying
> query
> analyzer on non-sql machine).
> What would be a correct way to append data from file?
> "Andrew J. Kelly" wrote:
>|||you'r right, no reason to give bcp to user. In my case it is hidden by
front-end .exe app.
Right now I dont see any advantages to use bcp (so BULK INSERT) to upsize
data: it is not secure, it cannt handle table relations and creating temp
tables on sql side has no benefits either. Better lets bring those tree-like
data directly to dbase and make sql to do all quality control checks!
"Andrew J. Kelly" wrote:

> The correct way is dependant on your needs. But I would never want to giv
e
> a client direct permission to import a file with BCP to my production
> server. Why not have them FTP it to a secure folder on your server or
> somewhere the server can get to it. Then use Bluk Insert to load it.
> --
> Andrew J. Kelly SQL MVP
>
> "gok" <gok@.discussions.microsoft.com> wrote in message
> news:105F0D2F-92B5-427A-96FB-F17BEAABE17F@.microsoft.com...
>
>