Showing posts with label content. Show all posts
Showing posts with label content. Show all posts

Thursday, March 8, 2012

Copy cube from a DB to another one

Hi,

I would like to copy a cube and its content from a database to another one.

The first database is the one used for production and the second will be used to archive the old cubes.

Is there a specific way to deal with this kind of issue ?

Thanks in advance for your support.

Rgds,

Juan

Hello! You have not told about what version you are using, AS2000 or SSAS2005?

With SSAS2005 you simply change this is the properties of the project and deployment.

This is in the solution explorer of BI-Developer Studio.

In AS2000 you can use archive and restore from one machine to another as long as the data source name is the same.

Regards

Thomas Ivarsson

|||In SSAS 2005, you also can try the new feature 'synchronize'.|||

I am using SSAS 2005. Can you tell me more about the "synchronize" feature.

Also, is there a way using xmla scripts ?

Cheers,

Juan

|||

You can take a look at the following link for "synchronize".

http://msdn2.microsoft.com/en-us/library/ms174928.aspx

Yes. It supports xmla script. The easy way is to generate the script using the synchronize wizard.

|||Thx !

Wednesday, March 7, 2012

copy content of txt file

Hi Guys,

What approach should I use to copy content of a text file. Is BCP capable of doing this? How about SSIS?

Example of the text file's content:

Date, "20060101"
ST_Code, "101"
A_Code, P_Code, T_Code, amount, price
"0001", "1111", "0101", 550, 230
"0002", "1111", "0102", 345, 122
"2001", 0212", 0930", 410, 90

In the example above, I just want to copy the rows Date, "20060101" and ST_Code, "101" into a table.

Regards,

Lars

Hi,

You could use DTS for this. Define a new DTS package, with your database in source, and a text file for output.

You can use an SQL order to filter your Data (..Where Date = "20060101" AND ....).

The result will be formatted as a CVS file by default. If you need to personalize your output format, you can use ActiveX scripts in transformation tasks to do this

ex :

Function Main()
DTSDestination("Date") = "Date, " & DTSSource("Date")
Main = DTSTransformStat_OK
End Function

|||

hi,

if you know the location of the row you want to copy you can use

the -f anf -l switch of BCP which stands for

-f = the first row

-l = the lastrow

regards,

joey

copy content of a text file into table

Hi Guys,

What approach should I use to copy content of a text file.

Example of the text file's content:

Date, "20060101"
ST_Code, "101"
A_Code, P_Code, T_Code, amount, price
"0001", "1111", "0101", 550, 230
"0002", "1111", "0102", 345, 122
"2001", 0212", 0930", 410, 90

In the example above, I just want to copy the rows Date, "20060101" and ST_Code, "101" into a table.

Regards,

Lars

Hi Larry,

If the text file is not very large, in that scenario you can simply iterate through the file line by line checking for those lines which contain your desired content. Extract the content and fire and insert against the table.

I am feared that you may not be able to find any ready-made solution for it.

|||

Larry Surat wrote:

Hi Guys,

What approach should I use to copy content of a text file.

Example of the text file's content:

Date, "20060101"
ST_Code, "101"
A_Code, P_Code, T_Code, amount, price
"0001", "1111", "0101", 550, 230
"0002", "1111", "0102", 345, 122
"2001", 0212", 0930", 410, 90

In the example above, I just want to copy the rows Date, "20060101" and ST_Code, "101" into a table.

Regards,

Lars

Read the file in as a single-columned dataset. Use Conditional Split to get only the rows you are interested in. Then use Derived Column to parse out all of the columns.

-Jamie

Copy Content from Db1 (inconsistent) to Db2

Hi,
the consistency check on my Db1 failed. Though the database seems to be
intact, how ever all tools fail e.g. DTS with error messages.
Does anybody know how to copy the content from Db1 to DB2 (schema is the
same)?
Thanks for any advice
Graham
Graham SmithHi
What is the error you are getting?
"Graham Smith" <graham.smith@.bbank.com> wrote in message
news:eJvV8gu3FHA.2640@.TK2MSFTNGP09.phx.gbl...
> Hi,
> the consistency check on my Db1 failed. Though the database seems to be
> intact, how ever all tools fail e.g. DTS with error messages.
> Does anybody know how to copy the content from Db1 to DB2 (schema is the
> same)?
> Thanks for any advice
> Graham
> --
> Graham Smith
>|||insert into db2.owner.tablename
select * from db1.owner.tablename
Or DTS
or backup DB1 and restore on DB2
----
--
"I sense many useless updates in you... Useless updates lead to
fragmentation... Fragmentation leads to downtime...Downtime leads to
suffering..Fragmentation is the path to the darkside.. DBCC INDEXDEFRAG
and DBCC DBREINDEX are the force...May the force be with you" --
http://sqlservercode.blogspot.com/|||Hi,

> insert into db2.owner.tablename
> select * from db1.owner.tablename
thanks a lot. That works great. I have about 30 tables. Do you know how to
script that this statement loops through all user tables?
Thanks in advance
Graham

Saturday, February 25, 2012

Copy a column content in another one only if empty

for MS SQL 2000
table [Users] :
[id_Users] [int] NOT NULL ,
[Name] [varchar] (25) NOT NULL,
[Alias] [varchar] (25) NULL
how can I copy the content of [Name] into the column [Alias] only if [Alias] is Empty ?
thank you--I ve consider null value also in this code.
update Users
set Alias=Name where Alias is null or ltrim(rtrim(Alias))=''|||wonderfull !

it works :-)

thanks a lot