Wednesday, March 7, 2012

copying data accross databases for backup

I am not an expert in SQL
I am faced with the task of copying certain attributes froma table in a
database to create a table in another database to have a sort of refined
backup database.I have to do it through a script to run in Sqlserver query
analyser I have created a query of sort ->
select attrib1, attrib2. into back_up_database_table From
Actual_database..Actual_table where <some condition>
I am logged to query analyser using the backup_database
I am promted to use the command sp_addlinkedserver for the actual database
however still i am getting the error SQLserver doesnot exist or access denie
d
How can I use an accross databes script
Can any help
Thanks in advance
AbhishekWhat kind of a DB are you copying from? Is it a SQL to SQL or access to SQL
?
"adg" wrote:

> I am not an expert in SQL
> I am faced with the task of copying certain attributes froma table in a
> database to create a table in another database to have a sort of refined
> backup database.I have to do it through a script to run in Sqlserver query
> analyser I have created a query of sort ->
> select attrib1, attrib2. into back_up_database_table From
> Actual_database..Actual_table where <some condition>
> I am logged to query analyser using the backup_database
> I am promted to use the command sp_addlinkedserver for the actual database
> however still i am getting the error SQLserver doesnot exist or access den
ied
> How can I use an accross databes script
> Can any help
> Thanks in advance
> Abhishek
>|||When selecting from a table on a linked SQL Server, keep in mind that the
server name prefix and object owner (typically DBO) are required. For
example, if you have a linked server called SERVERNAME:
select attrib1, attrib2. into back_up_database_table From
SERVERNAME.Actual_database.DBO.Actual_table where <some condition>
"adg" <u17748@.uwe> wrote in message news:5a7c9fe20d792@.uwe...
>I am not an expert in SQL
> I am faced with the task of copying certain attributes froma table in a
> database to create a table in another database to have a sort of refined
> backup database.I have to do it through a script to run in Sqlserver query
> analyser I have created a query of sort ->
> select attrib1, attrib2. into back_up_database_table From
> Actual_database..Actual_table where <some condition>
> I am logged to query analyser using the backup_database
> I am promted to use the command sp_addlinkedserver for the actual database
> however still i am getting the error SQLserver doesnot exist or access
> denied
> How can I use an accross databes script
> Can any help
> Thanks in advance
> Abhishek|||I was copying a sqlserver databases Thanks JT giving the fullname of the
database has solved the problem.Its working fine.
Thanks again
JT wrote:
>When selecting from a table on a linked SQL Server, keep in mind that the
>server name prefix and object owner (typically DBO) are required. For
>example, if you have a linked server called SERVERNAME:
>select attrib1, attrib2. into back_up_database_table From
>SERVERNAME.Actual_database.DBO.Actual_table where <some condition>
>
>[quoted text clipped - 13 lines]
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Forum...amming/200601/1

No comments:

Post a Comment