Showing posts with label bit. Show all posts
Showing posts with label bit. Show all posts

Tuesday, March 27, 2012

Error installing SQL Server 2005 Express with command prompt

I just started using SQL 2005 and having a bit of struggle.

I'm having difficulty trying to use the .ini file to install sql express. This is the command I use in Command Prompt:

start /wait express\setup.exe /settings setup.ini /qn
echo %errorlevel%

Then I get an error level of ‘-204’, which I couldn’t find the meaning on the internet or anywhere else.

But when I move the parameters from the .ini file to the batch file and the process worked. SQL started installing, until it comes to the SQL Server Database Services component. Then I get the following error message:

SQL Server Setup could not validate the service accounts. Either the service accounts have not been provided for all of the services being installed, or the specified username or password is incorrect. For each service, specify a valid username, password, and domain, or specify a built-in system account.

Here is how my batch file looks with parameters:

start /wait express\setup.exe /qb

INSTANCENAME=”EXAMPLE”

ADDLOCAL=All SAPWD="difficult"

INSTALLSQLDIR="C:\Program Files\MS\"

INSTALLSQLDATADIR="C:\Program Files\MS\Data"

SECURITYMODE="SQL" SQLACCOUNT="user"

SQLPASSWORD="password"

AGTACCOUNT="user"

AGTPASSWORD="password"

SQLBROWSERACCOUNT="user"

SQLBROWSERPASSWORD="password"

Please, can anyone help? I don't know what to do anymore.

Thanks.

Regards,

Akwest

Take a look at the template.ini file that is included with the setup media. For these *ACCOUNT parameters, you need to supply a domain/system account. Here is the info:

;--
; The services for SQL Server and Analysis Server are set auto start. To use the *ACCOUNT settings
; make sure to specify the DOMAIN, e.g. SQLACCOUNT=DOMAINNAME\ACCOUNT
; NOTE: When installing SQL_Engine 3 accounts are REQUIRED: SQLACCOUNT, AGTACCOUNT and SQLBROWSERACCOUNT.

; SQLACCOUNT Examples:
; SQLACCOUNT=<domain\user>
; SQLACCOUNT="NT AUTHORITY\SYSTEM"
; SQLACCOUNT="NT AUTHORITY\NETWORK SERVICE"
; SQLACCOUNT="NT AUTHORITY\LOCAL SERVICE"


; Note: To install localized versions of SQL Server, refer to the Localized Service Names table in the SQL Server Books Online topic "Setting Up Windows Service Accounts"


; Note that if SQLBrowser is already installed, SQLBROWSERACCOUNT and SQLBROWSERPASSWORD are ignored.

SQLBROWSERACCOUNT=
SQLBROWSERPASSWORD=

SQLACCOUNT=
SQLPASSWORD=

AGTACCOUNT=
AGTPASSWORD=

ASACCOUNT=
ASPASSWORD=

RSACCOUNT=
RSPASSWORD=

|||Thanks.

that did it...

Error installing SQL Server 2005 Express with command prompt

I just started using SQL 2005 and having a bit of struggle.

I'm having difficulty trying to use the .ini file to install sql express. This is the command I use in Command Prompt:

start /wait express\setup.exe /settings setup.ini /qn
echo %errorlevel%

Then I get an error level of ‘-204’, which I couldn’t find the meaning on the internet or anywhere else.

But when I move the parameters from the .ini file to the batch file and the process worked. SQL started installing, until it comes to the SQL Server Database Services component. Then I get the following error message:

SQL Server Setup could not validate the service accounts. Either the service accounts have not been provided for all of the services being installed, or the specified username or password is incorrect. For each service, specify a valid username, password, and domain, or specify a built-in system account.

Here is how my batch file looks with parameters:

start /wait express\setup.exe /qb

INSTANCENAME=”EXAMPLE”

ADDLOCAL=All SAPWD="difficult"

INSTALLSQLDIR="C:\Program Files\MS\"

INSTALLSQLDATADIR="C:\Program Files\MS\Data"

SECURITYMODE="SQL" SQLACCOUNT="user"

SQLPASSWORD="password"

AGTACCOUNT="user"

AGTPASSWORD="password"

SQLBROWSERACCOUNT="user"

SQLBROWSERPASSWORD="password"

Please, can anyone help? I don't know what to do anymore.

Thanks.

Regards,

Akwest

Take a look at the template.ini file that is included with the setup media. For these *ACCOUNT parameters, you need to supply a domain/system account. Here is the info:

;--
; The services for SQL Server and Analysis Server are set auto start. To use the *ACCOUNT settings
; make sure to specify the DOMAIN, e.g. SQLACCOUNT=DOMAINNAME\ACCOUNT
; NOTE: When installing SQL_Engine 3 accounts are REQUIRED: SQLACCOUNT, AGTACCOUNT and SQLBROWSERACCOUNT.

; SQLACCOUNT Examples:
; SQLACCOUNT=<domain\user>
; SQLACCOUNT="NT AUTHORITY\SYSTEM"
; SQLACCOUNT="NT AUTHORITY\NETWORK SERVICE"
; SQLACCOUNT="NT AUTHORITY\LOCAL SERVICE"


; Note: To install localized versions of SQL Server, refer to the Localized Service Names table in the SQL Server Books Online topic "Setting Up Windows Service Accounts"


; Note that if SQLBrowser is already installed, SQLBROWSERACCOUNT and SQLBROWSERPASSWORD are ignored.

SQLBROWSERACCOUNT=
SQLBROWSERPASSWORD=

SQLACCOUNT=
SQLPASSWORD=

AGTACCOUNT=
AGTPASSWORD=

ASACCOUNT=
ASPASSWORD=

RSACCOUNT=
RSPASSWORD=

|||Thanks.

that did it...

Wednesday, March 7, 2012

Error in installation SQL 2005 SP2 on 64 Bit Cluster.

I receive the below mentioned error message each time I try to install SP2 on SQL 2005 64 Bit Cluster:

Using PrevRegRootPath: Software\Microsoft\Microsoft SQL Server\MSSQL.2

GetServiceUserGroup failed for PLMCWSM01, 5

Error Code: 0x800706fd (1789)

Windows Error Text: The trust relationship between this workstation and the primary domain failed.

Source File Name: sqlca\sqlcax.cpp

Compiler Timestamp: Fri Feb 9 22:35:02 2007

Function Name: SetInstanceProperty

Source Line Number: 1223

MSI (s) (78!08) [01:05:21:864]: Transforming table Error.

MSI (s) (78!08) [01:05:21:989]: Transforming table Error.

MSI (s) (78!08) [01:05:21:989]: Note: 1: 2262 2: Error 3: -2147287038

MSI (s) (78!08) [01:05:21:989]: Product: Microsoft SQL Server 2005 (64-bit) -- Error 29528. The setup has encountered an unexpected error while Setting Internal Properties. The error is: Fatal error during installation.

Error 29528. The setup has encountered an unexpected error while Setting Internal Properties. The error is: Fatal error during installation.

Any Help on this would be highly appreciated.

Thanks

Anurag

Hi Anurag,

did you check this workarount: http://support.microsoft.com/kb/925976/en-us?

CU

tosc

Wednesday, February 15, 2012

error handling and logging within a trigger - how much of this would work / would be

Hi,
a little bit of background info; the T-SQL I'm writing is against a
proprietary database schema, I have triggers which are being called
upon through events in a client application over which I have no
control and the schema can change because of patches/new functionality
The pseudo code below is a collation of things I'm contemplating on
doing in my code. The reason being that I want to provide our
application specialists with the possibility to determine what went
wrong where in our production environment, if and when it does, and the
possibility to test patches / new functionality of the properiaty
system by testing in the user interface against a copy of the
production database.
I'd appreciate any feedback on how much of this pseudo code would work
/ would be required?
create trigger trInserrorHandlingInTrigger on propTable for insert as
declare @.returnStatus int, @.aVar int, @.err int
if @.@.rowcount = 0 return
if @.@.rowcount > 1 return
set @.aVar = (select aVal from aTable)
insert into logTable (Nme, sqlStm, aBool, Val) values
('trInserrorHandlingInTrigger', '', 1, @.aVar)
if @.aVar is null return
save transaction lastResort
EXEC @.returnStatus = sp_1_InsertRecords @.aVar = @.aVar
EXEC @.returnStatus = sp_2_InsertRecordsOrRollbackSpOne @.aVar = @.aVar,
@.returnStatus = @.returnStatus
EXEC @.returnStatus = sp_3_UpdateRecordsOrRollback @.aVar = @.aVar,
@.returnStatus = @.returnStatus
select @.err = @.@.error
if @.err <> 0 rollback transaction lastResort
if @.returnStatus <> 0 rollback transaction lastResort
commit transaction
go
create procedure sp_1_InsertRecords
@.aVar int
as
declare
@.err int
insert into wTable (aVal) values (@.aVar)
select @.err = @.@.error
if @.err <> 0
begin
insert into logTable (Nme, sqlStm, aBool, Val) values
('sp_2_InsertRecordsOrRollbackSpOne','lb
l One', 0, @.aVar)
return 1
end
else insert into logTable (Nme, sqlStm, aBool, Val) values
('sp_2_InsertRecordsOrRollbackSpOne','lb
l One', 1, @.aVar)
go
create procedure sp_2_InsertRecordsOrRollbackSpOne
@.aVar int, @.returnStatus int
as
declare
@.err int
if @.returnStatus = 0
begin
-- lbl One
insert into xTable (aVal) values (@.aVar)
select @.err = @.@.error
if @.err <> 0
begin
insert into logTable (Nme, sqlStm, aBool, Val) values
('sp_2_InsertRecordsOrRollbackSpOne','lb
l One', 0, @.aVar)
return 1
end
else insert into logTable (Nme, sqlStm, aBool, Val) values
('sp_2_InsertRecordsOrRollbackSpOne','lb
l One', 1, @.aVar)
end
else
-- lbl Two
delete from wTable where aVal = @.aVar
select @.err = @.@.error
if @.err <> 0
begin
insert into logTable (Nme, sqlStm, aBool, Val) values
('sp_2_InsertRecordsOrRollbackSpOne','lb
l Two', 0, @.aVar)
return 1
end
else insert into logTable (Nme, sqlStm, aBool, Val) values
('sp_2_InsertRecordsOrRollbackSpOne','lb
l Two', 1, @.aVar)
go
create procedure sp_3_UpdateRecordsOrRollback
@.aVar int, @.returnStatus int
as
declare
@.err int
if @.returnStatus = 0
begin
-- lbl One
update yTable set aVal = @.aVar
select @.err = @.@.error
if @.err <> 0
begin
insert into logTable (Nme, sqlStm, aBool, Val) values
('sp_3_UpdateRecordsOrRollback','lbl One', 0, @.aVar)
return 1
end
else insert into logTable (Nme, sqlStm, aBool, Val) values
('sp_3_UpdateRecordsOrRollback','lbl One', 1, @.aVar)
end
else
-- lbl Two
delete from aTable where aVal = @.aVar
select @.err = @.@.error
if @.err <> 0
begin
insert into logTable (Nme, sqlStm, aBool, Val) values
('sp_3_UpdateRecordsOrRollback','lbl Two', 0, @.aVar)
return 1
end
else insert into logTable (Nme, sqlStm, aBool, Val) values
('sp_3_UpdateRecordsOrRollback','lbl Two', 1, @.aVar)
-- lbl Three
delete from wTable where aVal = @.aVar
select @.err = @.@.error
if @.err <> 0
begin
insert into logTable (Nme, sqlStm, aBool, Val) values
('sp_3_UpdateRecordsOrRollback', 'lbl Three', 0, @.aVar)
return 1
end
else insert into logTable (Nme, sqlStm, aBool, Val) values
('sp_3_UpdateRecordsOrRollback','lbl Three', 1, @.aVar)
go
regards,
GerardGerard (g.doeswijk@.gmail.com) writes:
> create trigger trInserrorHandlingInTrigger on propTable for insert as
> declare @.returnStatus int, @.aVar int, @.err int
>
> if @.@.rowcount = 0 return
> if @.@.rowcount > 1 return
> set @.aVar = (select aVal from aTable)
Would be from inserted, not just any table.

> save transaction lastResort
> EXEC @.returnStatus = sp_1_InsertRecords @.aVar = @.aVar
> EXEC @.returnStatus = sp_2_InsertRecordsOrRollbackSpOne @.aVar = @.aVar,
> @.returnStatus = @.returnStatus
> EXEC @.returnStatus = sp_3_UpdateRecordsOrRollback @.aVar = @.aVar,
> @.returnStatus = @.returnStatus
>
> select @.err = @.@.error
> if @.err <> 0 rollback transaction lastResort
> if @.returnStatus <> 0 rollback transaction lastResort
>
> commit transaction
First, the sp_ prefix is reserved for system procedures, don't use it
for your own code. There could be nasty surprises.
This appears to be a bit overkill. And flat out wrong as for the COMMIT
part.
This is the scoop: if an error occurs when you are in a trigger, including
a stored procedure called by a trigger, the entire batch is aborted, and
the current transaction is rolled back. So this savepoint thing is not
likely to work.
And what's wrong with the COMMIT? If a trigger exits with a lower trancount
that it was entered with, that too aborts the batch, and rolls back any
transaction. The idea is that a rollback in a trigger should roll back
the batch, but if you COMMIT the same thing happens.|||Thanks for the feedback, BOL was not particularly clear for me on the
SAVE TRAN and COMMIT PART. I had sort of thought that there was some
possibility to persist some data outside the scope of the trigger by
giving this commit. I think we just have to start living with the idea
in any case.