Author |
Topic |
ahson_u
Starting Member
12 Posts |
Posted - 2010-10-13 : 13:10:29
|
Have changed the name of the computer and am running the following query to drop the old name of the machine on which the sql server is sitting.OSQL -S.\STAX -E -icorrectservername.sql -oResult.txtI get the following error messageMsg 102, Level 15, State 1, Line 1Incorrect syntax near 'S'.Can someone kindly tell me how to correct this query |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
ahson_u
Starting Member
12 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-10-13 : 13:47:49
|
Where are you running this?OSQL is a windows executable, it should be running from the command prompt. From the error is sounds like you're running it from management studioTake a couple steps back, what are you trying to do?--Gail ShawSQL Server MVP |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
ahson_u
Starting Member
12 Posts |
Posted - 2010-10-13 : 16:07:17
|
quote: Originally posted by GilaMonster Where are you running this?OSQL is a windows executable, it should be running from the command prompt. From the error is sounds like you're running it from management studioTake a couple steps back, what are you trying to do?--Gail ShawSQL Server MVP
|
|
|
ahson_u
Starting Member
12 Posts |
Posted - 2010-10-13 : 16:11:33
|
You have hit the nail on the head. I am using Management Studio indeed and it is SQP Server 2005. Basically changed the name of the computer and tried running the following query to drop the old name of the machine on which the sql server is sitting.OSQL -S.\SAGETAX -E -icorrectservername.sql -oResult.txtThanks in advance for your help.Kind regardsAhsonquote: Originally posted by GilaMonster Where are you running this?OSQL is a windows executable, it should be running from the command prompt. From the error is sounds like you're running it from management studioTake a couple steps back, what are you trying to do?--Gail ShawSQL Server MVP
|
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
ahson_u
Starting Member
12 Posts |
Posted - 2010-10-14 : 07:49:24
|
Tara/Gail:Tried running from Management Studio the following-S%computername%\SAGETAX -E -icorrectservername.sql -oResult.txtstill get the error messageMsg 102, Level 15, State 1, Line 1Incorrect syntax near '-'.Basically Have changed the name of the computer and get an error message when I run an installation check. The error message is: ERROR: Server has been renamed, (EPTAX01\SQLEXPRESS) was called (A-72E5634C45B34\SQLEXPRESS)Can you kindly guide me on how to get rid of this error message. I was told the qeury would get rid of the message but the query does not tun.Kind regardsAhson |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-10-14 : 07:58:39
|
No, that's not what Tana meant. That command (with osql) something to be used at a dos command line, not in SQL.Tana meant open the file correctservername.sql in management studio, connect to the appropriate server and then just run it.--Gail ShawSQL Server MVP |
|
|
ahson_u
Starting Member
12 Posts |
Posted - 2010-10-15 : 07:17:53
|
Gail/Tara, thanks for your help. I have been able to run the stored procedures from the Management Studio. However I still get an error when I run the installation as follows:INFO: Established a SQL database session to MAIN01\SQLEXPRESSERROR: Server has been renamed, (MAIN01\SQLEXPRESS) was called (TRAIN01\SQLEXPRESS) Microsoft SQL Server 2005 - Express Edition RTM - 9.00.1399.06 (Intel X86) This error, I suspect, results in a Windows Registry error as follows:Ox0eedfade flags 0x00000001Can you kindly me correct this error?Thanks in advance for your kind help.Ahsonquote: Originally posted by GilaMonster No, that's not what Tana meant. That command (with osql) something to be used at a dos command line, not in SQL.Tana meant open the file correctservername.sql in management studio, connect to the appropriate server and then just run it.--Gail ShawSQL Server MVP
|
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-10-15 : 08:03:58
|
What installation are you running? Doesn't look like a SQL error.What was that stored proc that you were trying to run?--Gail ShawSQL Server MVP |
|
|
ahson_u
Starting Member
12 Posts |
Posted - 2010-10-15 : 09:58:57
|
It is Sage tax sofware which sits on top of SQL server. I don't know the name of the stored procedure but if you see it connects to SQL Server.INFO: Established a SQL database session to MAIN01\SQLEXPRESSERROR: Server has been renamed, (MAIN01\SQLEXPRESS) was called (TRAIN01\SQLEXPRESS)You don't think it is SQL Server Error?Kind regardsAhsonquote: Originally posted by GilaMonster What installation are you running? Doesn't look like a SQL error.What was that stored proc that you were trying to run?--Gail ShawSQL Server MVP
|
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-10-15 : 10:57:22
|
Um, I'm talking about the procedure that you ran (the one that's in that script file that you loaded in management studio and ran). What does that do?That is not a SQL Server error. SQL doesn't care if you rename it and it doesn't have the right format for a SQL error.--Gail ShawSQL Server MVP |
|
|
ahson_u
Starting Member
12 Posts |
Posted - 2010-10-15 : 13:24:51
|
That stored procedure was sp_dropserver 'old machinename/sqlexpresss' and the second command was sp_addserver 'new machinename/sqlexpresss'.It seems this error arises when the application connects to the sql server it is expecting old machone name but encounters a new name. It seems I have to figure out when does the application store the old machine name and change it? |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-10-15 : 13:41:14
|
Was it exactly like that? To the letter?If not, post the actual code.--Gail ShawSQL Server MVP |
|
|
ahson_u
Starting Member
12 Posts |
Posted - 2010-10-15 : 14:08:41
|
sp_dropserver 'TRAIN01\SQLEXPRESS'and the second command was sp_addserver 'MAIN01\SQLEXPRESS'.There are error messages which arise from the application. The first one isINFO: Established a SQL database session to MAIN01\SQLEXPRESSERROR: Server has been renamed, (MAIN01\SQLEXPRESS) was called (TRAIN01\SQLEXPRESS)and the second error the application throws up is:Checking master tablesOK: Master data path can be accessed from this machine.OK: Location : C:\Personal_Tax\Master\Data ERROR: Setting mismatch: SQL.MasterSettings (SQLServer=TRAIN01\SQLEXPRESS), expected (MAIN01\SQLEXPRESS)This is the actual code and errorsKind regardsAhson |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-10-15 : 15:57:12
|
The drop server is correct. The addserver should have beenEXEC sp_addserver 'MAIN01\SQLEXPRESS', 'local;Before you run that, what do the following two statement return?SELECT * from sys.serversSELECT @@ServerName--Gail ShawSQL Server MVP |
|
|
Next Page
|