Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

SQL command needed to edit table data
I have an existing SQL 7 server named HHARBR. HHARBR has a database named
SPR with a table named "reportname" in it, the table has the name HHARBR
embedded the table data.

I migrated the HHARBR database SPR to a second server called HHARBR2. When I
look into the table in HHARBR2 I still see the name HHARBR in the data.

What command can I run on HHARBR2 to change the table entries of HHARBR to
the new server name of HHARBR2?

I prefer something I can run in the Query Analyzer

Source server: HHARBR
Source Database: SPR
Source Datbase Table: reportname

Destination Server: HHARBR2
Destination Databse: SPR
Destination Table: reportname

Summary:
Change wrong server name in destination server to reflect the destinations
server name



Report this thread to moderator Post Follow-up to this message
Old Post
News East
02-25-06 02:45 PM


Re: SQL command needed to edit table data
You didn't give us the column with the reportname table.  It'll go something
like:

update reportname
set
MyCol = 'HHARBR2'
where
MyCol = 'HHARBR'

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON   Canada
www.pinpub.com
.
"News East" <Methu969@yahoo.com> wrote in message
news:cX7Lf.171257$WH.96105@dukeread01...
I have an existing SQL 7 server named HHARBR. HHARBR has a database named
SPR with a table named "reportname" in it, the table has the name HHARBR
embedded the table data.

I migrated the HHARBR database SPR to a second server called HHARBR2. When I
look into the table in HHARBR2 I still see the name HHARBR in the data.

What command can I run on HHARBR2 to change the table entries of HHARBR to
the new server name of HHARBR2?

I prefer something I can run in the Query Analyzer

Source server: HHARBR
Source Database: SPR
Source Datbase Table: reportname

Destination Server: HHARBR2
Destination Databse: SPR
Destination Table: reportname

Summary:
Change wrong server name in destination server to reflect the destinations
server name



Report this thread to moderator Post Follow-up to this message
Old Post
Tom Moreau
02-25-06 02:45 PM


Re: SQL command needed to edit table data
News East (Methu969@yahoo.com)  writes:
> I have an existing SQL 7 server named HHARBR. HHARBR has a database named
> SPR with a table named "reportname" in it, the table has the name HHARBR
> embedded the table data.
>
> I migrated the HHARBR database SPR to a second server called HHARBR2. When
I
> look into the table in HHARBR2 I still see the name HHARBR in the data.
>
> What command can I run on HHARBR2 to change the table entries of HHARBR to
> the new server name of HHARBR2?
>
> I prefer something I can run in the Query Analyzer
>
> Source server: HHARBR
> Source Database: SPR
> Source Datbase Table: reportname
>
> Destination Server: HHARBR2
> Destination Databse: SPR
> Destination Table: reportname
>
> Summary:
> Change wrong server name in destination server to reflect the destinations
> server name

Rather than having the servername in a table, you could @@servername.
As a compromise you could change the column to a computed column:

col AS @@servername


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Report this thread to moderator Post Follow-up to this message
Old Post
Erland Sommarskog
02-25-06 02:45 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 05:40 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006