Showing posts with label views. Show all posts
Showing posts with label views. Show all posts

Friday, February 24, 2012

Exporting views

I'm trying to export views from one server to another but
it exports views as tables...
Any suggestion?
Thanx in advance
MartynCould you explain what you're doing? SQL Server doesn't export views as
tables. What tool are you using?
Did yuo try to simply script the views using the Generate SQL Script option
from SQL Enterprise Manager?
--
Brian
"Martyn" <anonymous@.discussions.microsoft.com> wrote in message
news:047601c399d3$8a962230$a601280a@.phx.gbl...
> I'm trying to export views from one server to another but
> it exports views as tables...
> Any suggestion?
> Thanx in advance
> Martyn|||I used SQL Server2000 Enterprise mangaer.
From one server, I selected export data and copy tables
and views option. Then selected 4 views which lies in
view folder but it exported as table at the destination
server.
>--Original Message--
>Could you explain what you're doing? SQL Server doesn't
export views as
>tables. What tool are you using?
>Did yuo try to simply script the views using the
Generate SQL Script option
>from SQL Enterprise Manager?
>--
>Brian
>
>"Martyn" <anonymous@.discussions.microsoft.com> wrote in
message
>news:047601c399d3$8a962230$a601280a@.phx.gbl...
>> I'm trying to export views from one server to another
but
>> it exports views as tables...
>> Any suggestion?
>> Thanx in advance
>> Martyn
>
>.
>|||It sounds like you might be doing this using the DTS Export
Wizard. When the dialog box comes up to select what to copy
and you select the option for "copy table(s) and view(s)
from the source database, you will be copying data not
copying objects. If you need the views to be copied as views
- not just the data - you need to use the option for "copy
objects and data between SQL Server databases"
-Sue
On Thu, 23 Oct 2003 19:43:43 -0700, "Martyn"
<anonymous@.discussions.microsoft.com> wrote:
>I used SQL Server2000 Enterprise mangaer.
>From one server, I selected export data and copy tables
>and views option. Then selected 4 views which lies in
>view folder but it exported as table at the destination
>server.
>>--Original Message--
>>Could you explain what you're doing? SQL Server doesn't
>export views as
>>tables. What tool are you using?
>>Did yuo try to simply script the views using the
>Generate SQL Script option
>>from SQL Enterprise Manager?
>>--
>>Brian
>>
>>"Martyn" <anonymous@.discussions.microsoft.com> wrote in
>message
>>news:047601c399d3$8a962230$a601280a@.phx.gbl...
>> I'm trying to export views from one server to another
>but
>> it exports views as tables...
>> Any suggestion?
>> Thanx in advance
>> Martyn
>>
>>.

Friday, February 17, 2012

Exporting the data, views and stored procedures from a SQL 2005 db into a SQL 2000 db

I am trying to move a SQL 2005 db into a SQL 2000 db. I understand that I can not use a backup then restore as the backup file format has changed. I have had some success using the Export function on the SQL 2005 db to move the daata rows but I have not had any success in moving the views and stored procedures from the SQL 2005 db to the SQL 2000 db. If I have not been able to use the Import/Export on SQL 2000 at all.

How can I do this?

Thanks

Have you tried scripting them out to text files using SMO?

Here is a catalog query you can use to extract the SQL source text directly:

select definition + CHAR(13) + CHAR(10) + 'GO' + CHAR(13) + CHAR(10)
from sys.sql_modules as m
join sys.objects as o
on m.object_id=o.object_id
where o.type in ('P', 'V')
go

Regards

|||

I have an inconsistency problem regarding exporting the data from SQL 2k5 back to SQL 2k.

Let me give the details of the things ive done before exporting the data.

In 2k5, There is an existing database called Accounting database. Luckily i have the old copy of the same database which i can restore to 2k. I restore the old copy to my 2k.The important things for me is to transfer the tables from 2k5 to 2k without any changes in the data and from there i could move on.

In 2k , i restore the old copy and generate scripts from the tables itself for the drop and create the tables. The reason i do this is to remove the data completely from the tables.

In 2k5 i register the instance of my 2k.

From an instance of my 2k5 together with the registered instance of 2k, the export begins.

after exporting the data.

1. identity values of my tables was restarted to 1.

2. tmstamp colums is not allowing to export

Exporting data from 2k is never been easy.

Any guess whats goin on in here ?

Exporting the data, views and stored procedures from a SQL 2005 db into a SQL 2000 db

I am trying to move a SQL 2005 db into a SQL 2000 db. I understand that I can not use a backup then restore as the backup file format has changed. I have had some success using the Export function on the SQL 2005 db to move the daata rows but I have not had any success in moving the views and stored procedures from the SQL 2005 db to the SQL 2000 db. If I have not been able to use the Import/Export on SQL 2000 at all.

How can I do this?

Thanks

Have you tried scripting them out to text files using SMO?

Here is a catalog query you can use to extract the SQL source text directly:

select definition + CHAR(13) + CHAR(10) + 'GO' + CHAR(13) + CHAR(10)
from sys.sql_modules as m
join sys.objects as o
on m.object_id=o.object_id
where o.type in ('P', 'V')
go

Regards

|||

I have an inconsistency problem regarding exporting the data from SQL 2k5 back to SQL 2k.

Let me give the details of the things ive done before exporting the data.

In 2k5, There is an existing database called Accounting database. Luckily i have the old copy of the same database which i can restore to 2k. I restore the old copy to my 2k.The important things for me is to transfer the tables from 2k5 to 2k without any changes in the data and from there i could move on.

In 2k , i restore the old copy and generate scripts from the tables itself for the drop and create the tables. The reason i do this is to remove the data completely from the tables.

In 2k5 i register the instance of my 2k.

From an instance of my 2k5 together with the registered instance of 2k, the export begins.

after exporting the data.

1. identity values of my tables was restarted to 1.

2. tmstamp colums is not allowing to export

Exporting data from 2k is never been easy.

Any guess whats goin on in here ?