Showing posts with label databases. Show all posts
Showing posts with label databases. Show all posts

Thursday, March 29, 2012

DTS Scripts (SQL Server 2000)

Hello,

I would like to know the DTS Scripts for converting Access Databases to SQL Server 2000. The Access Databases are located on multiple servers. The tables should be created the first time. Then the data should be copied from Access Databases located on multiple servers. No duplicate rows should be added to SQL Server tables. The data should be copied from Access Databases every 15 minutes. Please show me a example (code in DTS Scripts) which does this task.Smile

Thanks,

Vivek Gupta

You can use import export wizard in SQL enterprise manager and it will create DTS package for your, next you just have to modify it to accept input access file name as parameter, and maybe table name in it? But if your table structure is different in each database it will be hard to create single DTS package because DTS package will store table structure definition as fixed. Maybe instead of this you can write simple .Net application which will do this for your for any Access database location and table name.

Thanks

Sunday, March 25, 2012

Dts Problem!

Hello Everyone,

I have a DTS package, which has been working fine for few years. it runs once a month to get information from different databases and save it into the destination database. Now I get this error:

error source: microsoft ole db provider for sql server
error description: could not get the data of the row from the ole db provider 'MSOLAP'.
Conversion failed because the data value overflowed the data type used by the provider.
OLE DB error trace[OLE/DB provider 'MSOLAP' IRowset::GetData returned 0x40eda: Data status returned from the
provider:[COLUMN_NAME=[Measures].[The profit]STATUS=DBSTATUS_EDATAOVERFLOW], [COLUMN_NAME=[Measure].[Hours T2]

Any help will be apreciated!Your source table has data that is not acceptable on your side.
It could be just for example if you have int column and source table has bigint. All this time all numbers where easily converted into int datatype on your server but now one of the numbers is too big for your table and you get overflaw error .
Basically your message says that datatype on the source table cant be accepted on destination. Try to load data into a work table where all columns are character datatype and view what is not convertible into datatypes on your table.

Unfortunately solution involves some research on your part.

Good Luck.|||Thank you for your reply,

The problem is I know that the destination table has numeric datatype but the data comes from a cube on an OLAP linked server, I looked att som values there som was numerics and others '-1,#j' probably a formuler results. and I do this convert(float, "[Measures].[ The profit]"). What else do I need to do?|||As I already said.
Load data into a work table where this column is a character datatype and add additional step to your DTS package where you filter out unwanted records while loading data into production table. This way you can have exception table where you will enter invalid records and see what could be done to fix them.

Good Luck.

Thursday, March 22, 2012

DTS packages not migrating completely

Hi, I upgraded several of my SQL 2000 database to SQL 2005 databases. I'm in the process of migrating over the DTS packages over to SSIS packages. I'm using the DTSMigrationWizard utilty to do this migration. When I started testing the SSIS packages I've discovered that not all the steps were being excuted. So I've noticed on several of the packages not everything migrated over. Such as connections to oracle and some of the task as well did not migrate over. Is there a way to migrate the entire DTS package to SSIS or do I have to re-create the entire package from scratch or is there a better way to get the SQL 2000 DTS packages over to SQL 2005 and have them run successfully?

You can have the SQL 2000 DTS packages in a SQL 2005 server and still keep running them (using the DTS runtime). If you chose to migrate, please be aware its a best-efforts migration as DTS and SSIS are different products. See http://technet.microsoft.com/en-us/library/ms143462.aspx for more details on known issues during migration.

DTS packages not migrating completely

Hi, I upgraded several of my SQL 2000 database to SQL 2005 databases. I'm in the process of migrating over the DTS packages over to SSIS packages. I'm using the DTSMigrationWizard utilty to do this migration. When I started testing the SSIS packages I've discovered that not all the steps were being excuted. So I've noticed on several of the packages not everything migrated over. Such as connections to oracle and some of the task as well did not migrate over. Is there a way to migrate the entire DTS package to SSIS or do I have to re-create the entire package from scratch or is there a better way to get the SQL 2000 DTS packages over to SQL 2005 and have them run successfully?

You can have the SQL 2000 DTS packages in a SQL 2005 server and still keep running them (using the DTS runtime). If you chose to migrate, please be aware its a best-efforts migration as DTS and SSIS are different products. See http://technet.microsoft.com/en-us/library/ms143462.aspx for more details on known issues during migration.sqlsql

DTS packages and transaction

Hello everyone,

My question:
Is it possible to gate the complete execution of a DTS package?

Experimentation:
-I have to databases, dbSource and dbArchive.
-Each database has 1 table of the same format, tableData

1- I put 50 000 rows in dbSource
2- Once the insertion completed, I start my DTS package. The package does this:
2.1 - Move all rows of dbSource in dbArchive
2.2 - Truncate rows from dbSource
3- Immediatly after the DTS had start, I start the insertion of another 1000 rows inside dbSource.

Results:
Once everything is terminated (DTS and 1000-rows insertion), here is the count inside each database:

dbSource:881
dbArchive:50079

So I "lost" 40 rows in the process.

My expectations:
By setting the package property Use Transactions with the Serialization isolation level, I thought that the reading part of the bulk move would be gated, so any insertion in dbSource would be officially inside dbSource after the DTS completion only.

Feel free to ask any other information you might need. I can also explain my problem from a higher point a view and what I try to achive.

Thanks !I think that this is one of the major enhancements that is available to you in SQL 2005 (SQL Server Integration Services).

Be prepared for a steep learning curve.

Regards,

hmscott|||Thanks for the info.

Unfortunately, I cannot move to 2005 on this project I run...sqlsql

Sunday, March 11, 2012

DTS Package Error

Hello All.

My database server (MS SQL 7) crashed yesterday. After 2 days of recovery, I have managed to restore all databases in the server. All tables, stored procedures and views are in tact except for the DTS packages.

The full list (more than 50 DTS packages) was shown in Data Transformation - Local packages but when I right-clicked on "Design Package" or "Execute Package" on any of packages, an error message pops up.

Package Error
Error Source : Microsoft Data Transformation Services (DTS) Package
Error Description : The system cannot find the file specified.

Any idea what's wrong with the above? Whatever source that was needed were in place.

I need to fix this as soon as possible otherwise I will be in serious trouble. Please help me. Thanks a million.

Best regards
Teck Boon

:confused:Which service pack are you using with your sql server 7 ? What was your recovery process - did you have to reinstall sql server ?|||Yes. I have to re-installed SQL 7 (no service pack was applied) because my boot drive C crashed. I am on NT4 SP6a.

Restoration was done in this sequence:

1. Restored my 3 application databases to K Drive.
2. Restored master database to C drive.
3. Restored msdb database to C drive.
4. Restored model database to C drive

After master database was installed, I was still unable to see my DTS listing but once MSDB database was put back into he server, listing came on but see error message.

Thank you

Best regards
Teck Boon|||Hello All.

I have resolved the DTS problem by applying SQL 7 SP4 to my server.

Best regards
Teck Boon
:)

Wednesday, March 7, 2012

dts package

I have about 30 dts packages created for different databases . I am rebuilding this server. How do I move the dts packages, I need to back them up into another server. And then restore and re-install them when the server is rebuilt. How do I back up and restore dts packages.
Pls helpOriginally posted by dokeyemi
I have about 30 dts packages created for different databases . I am rebuilding this server. How do I move the dts packages, I need to back them up into another server. And then restore and re-install them when the server is rebuilt. How do I back up and restore dts packages.
Pls help

You could save it as files
or you can also backup all your databases included master and msdb and restore on your new server|||Originally posted by omiossec
You could save it as files
or you can also backup all your databases included master and msdb and restore on your new server

You mean save the files one by one individually? How about deploying them? Say I have 100 ++ DTS packages?|||Check out www.sqldts.com. Look in their downloads section for something called DTSBackup2000. I have used it in a development environment with a tremendous amount of success. I have not yet had the courage to try it in production, but I'm getting pretty close.

Regards,

Hugh Scott

Originally posted by dokeyemi
I have about 30 dts packages created for different databases . I am rebuilding this server. How do I move the dts packages, I need to back them up into another server. And then restore and re-install them when the server is rebuilt. How do I back up and restore dts packages.
Pls help

DTS or Replication??

I have different heterogeneous databases (SQL Server as well as Oracle) which need to transfer their data to a central SQL Server database for reporting purposes. Central location needs to be kept up-to-date on a periodic basis, say every night we consoli
date data from different sources. There can be maximum 100 such source databases. Each source can have max 100KB of data.
Now I have to figure out which one is more suitable to my needs: replication or DTS? I am new to both of these approaches. I don't know whether DTS would even make a solution or not? So please advise what would be the better approach. Also I would appreci
ate further links/references that would help me move ahead with either of them.
Thanks
-megha
Megha,
if you select DTS , you'll have potentially a huge task ascertaining which
are the new records, which have been deleted and which have been updated.
So, using DTS practically limits you (in most circumstances) to taking the
complete table from each subscriber. Replication, on the other hand, has a
methodology which takes all this into account. I would recommend merge
replication with your reporting server as a central publisher. You need to
consider if the data is to be partitioned according to subscriber, or if
conflicts can arise and how to treat these conflicts, for which there are
several inbuilt resolution techniques. Have a look at BOL for further
information. I maintain a simple site (www.replicationanswers.com) and on
the links section there are some configuration walkthroughs. Unfortunately
there aren't yet any books to recommend, but keep an eye out for the
imminent release of Hilary Cotter's book.
HTH,
Paul Ibison
|||Unfortunately with SQL 2000 you can't replicate from Oracle to SQL Server
AFAIK. I have gone through Oracle's documentation and Oracle 8 and 9 and
don't see this option.
DTS sounds like the best option, although tracking changes (as Paul
mentions) will be difficult.
I did set something up in the past that did bulk inserts from Oracle to SQL
Server using vbscript which would so an insert select of the form
insert into SQLServer.Database.dbo.tableName
select * from OracleServer.Database.ServerName.SYSDBA.TableName where
PKOracle not in (select PKSQLServer SQLServer.dbo.tablename)
It might be simpler to use a linked server for this.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"megha" <anonymous@.discussions.microsoft.com> wrote in message
news:A4C68146-4B9D-4136-8464-9E5271402E64@.microsoft.com...
> I have different heterogeneous databases (SQL Server as well as Oracle)
which need to transfer their data to a central SQL Server database for
reporting purposes. Central location needs to be kept up-to-date on a
periodic basis, say every night we consolidate data from different sources.
There can be maximum 100 such source databases. Each source can have max
100KB of data.
> Now I have to figure out which one is more suitable to my needs:
replication or DTS? I am new to both of these approaches. I don't know
whether DTS would even make a solution or not? So please advise what would
be the better approach. Also I would appreciate further links/references
that would help me move ahead with either of them.
> Thanks
> -megha
|||Thanks Paul for the feedback! I checked out your website and found that you work a lot with ASP.NET as well. I would like an advise here. How would web services fit in to my requirements here? Is there a way I can capture transactions on heterogenous data
base servers and then use web services to send them to a central server? Or is it better to go ahead with replication?
One more question: you suggested merge replication with central publisher. Why central publisher - I thought it would be central subscriber as I have many publishers and all data would need to come to one central server. Also, once arrived at central serv
er data might change but I don't want this data to propogate back to the publishers. Any changes coming from a publisher would overwrite the data at central location. Do I need to use merge replication or transactional replication is the solution? Please
explain.
|||Thank you Hilary for sharing your knowledge with me! I checked out the sample chapter of your upcoming book. There I have got a question for you. Are you saying that for SQL Server (any version) replication we can not have heterogeneous subscribers? I gue
ss thats correct and thats the reason you have mentioned DTS and Linked Servers.
But I did not quite follow the direction you pointed to. How can I use a linked server to an Oracle database that would simulate Oracle - SQL Server replication? Or how would DTS do that? OK I can use either of the two to access Oracle database but how do
I create/access the transaction log which I essentially need at central SQL Server - can you please explain more?
|||Megha,
you'll need to use replication for the SQL subscribers and DTS/linked
servers for Oracle. The data on the central reporting server can be
amalgamated into one table or more easily unioned using views. If you use
views and want to edit the data, you can partition them to enable edits or
use InsteadOf triggers. Webservices would only complicate things here, and
it'll be quite complex as it is :-)
The publisher/subscriber metaphor doesn't strictly apply to merge, and
centralized publishing is easier to manage/maintain.
You can implement unidirectional merge replication using the -EXCHANGETYPE
parameter. Transactional is possible, but merge is much simpler for your
needs.
HTH,
Paul Ibison
|||I had a mistake in my first question. I intend to ask - Are you saying that for SQL Server (any version) replication we can not have heterogeneous publishers?
|||Paul, I am still trying to understand: why central publishing would match my needs better. How I think about it is I do not need any data to flow from central location to different sources and so I would not need to publish anything on central side. Do I
understand it correct that whoever is changing the data can become a publisher and as central location's change of data do not need to go across it should not be a publisher? Am I missing on something here?
How unidirectional merge is simpler than transactional replication? Can you provide some facts? What I knew is that merge brings in additional complications to the process. I would like to know your reasons as I will be implementing it for the first time
and I do not have any convenience preferences so far.
You must have some insights into this, so please explain further.
|||Megha,
this is just my preference purely from the point of view of maintenance.
Remember, the publisher/subscriber metaphor doesn't strictly apply to merge,
meaning that either a publisher or a subscriber can change the data -
there's really no great distinction in this respect. There are some
differences eg the publisher wins conflicts by default, but in your case
this is probably not relevant.
If each remote computer is set up as a transactional publisher, this can be
a lot of maintenance. Each publisher typically is a publisher/distributer.
Each one has it's own set of alerts and jobs. All profile parameters
(timeouts, snapshot size etc), publication settings (duration of
transactions etc) are set on each remote machine separately. Also, backup
and restore for disaster recovery is also much more straightforward for
merge replication.
Regards,
Paul Ibison
|||OK now I can select central publishing topology for replication with unidirectional replication flowing from subscribers/publishers to central publisher. BUT even then I need to keep track of changes at subscribers/publishers so that it can bemerged at ce
ntral location. Won't I need then to define a distributor for each of these subscribers/publishers then? How can I get away with defining no publication settings (transaction duration as you quoted) on each one of them?
Can you explain it more or tell me if there is some book I can refer to in order to understand the merge replication more clearly? BOL does not detail on central publishing with unidirectional replication.
Thanks for your help!

DTS or Replication?

I need help deciding whether to use DTS or Replication:

We have four SQL Server databases on four separate servers with the same data schema, one for the north east, south west, mid atlantic, and mid west. We also have one "global" database on a separate server. First, and only this one time, we need to copy data from the four regional databases to the global database. Then, at least once a day we will need to copy changed and new data from the four regional SQL databases to the global database.

I have researched DTS and Replication and am still unsure how to proceed. DTS doesn't seem to have a mechanism to copy over only the changed data. Can somebody please advise me as to which method to use?

Thank you.

This sounds like a candidate for transactional replication to me.

Transactional replication bulk copies the data on first use but then only updates are applied, exactly what you are asking for. You will have to be careful about handling updates on the "global" database if that is a requirement, your key must be unique within all of the publication tables. Also, when setting up the subscriptions ensure replication does not try to drop the table first or replicate to seperate databases and join it together with a view. Using this view approach would be slightly less efficient but less prone to people pushing new subscriptions that drop all target tables.

DTS has no mechanism for doing this, you would have to write the logic yourself based on some sort of changed data marker/date flag. Why go to the hassle when SQL Server has a well tested system in place already?

Hope that helps

Nick
DBA
www.comoni.co.uk

|||

Do you know of any texts or resources I can find to teach me how to do this? I am not familiar with how to run replication or create a replication job, or whatever you call it. Thanks

Karen

|||

Merge replication is what you need. It is designed for the occasionally connected scenarios.

The following are some resources to get you started:

Planning Merge Replication

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/replsql/replplan_2ipa.asp

How merge replication works

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/replsql/repltypes_30z7.asp

|||

Merge replication would not be my choice here. Merge is best suited to 2 way data changes, not one way as in this case. The management overhead is higher with merge than transactional too. It is fine to run the distribution agent for transactional replication only once a day, providing there is space in the distribution database to store that day's changes.

As for documentation on this, books online is not particularly helpful on the basics. I found a quick Google for transactional replication brought up plenty of how-to articles though. It is worth spending the time reading the onlie resources as replication is a reasonably complex process and has a habit of causing problems if not planned correctly.

Nick

|||

The main difference between merge and transactional replication is not two-way or one-way. There is a "download-only" option in SQL Server 2005 merge replication to allow you to setup one-way replication and you can setup bi-directional transactional replication. The main difference is how soon you will see the change. Giving you only want to sync once a day, I would go with merge replication.

Here is an overview of different replication types and how to choose between them:

http://msdn2.microsoft.com/en-us/library/ms152531(SQL.90).aspx

Here is an example of using merge reaplication to integrate data from multiple branch offices, which is similar to the original scenario in this post:

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

|||Thank you all for your help! I have enough to move me in the right direction now. I'm sure I'll have problems along the way.....

Tuesday, February 14, 2012

DTS Import

I have a development database and a live database. I want to do a DTS
export from the live box to the dev box to sync the databases up. The
problem is that the development database has tables, stored procedures
associated to applications that aren't live yet because they are still
be tested or aren't done being programmed. If I do the import will
these tables get deleted or will they remain untouched?
Thanks in advance
Hi
Usually you would re-sync the data by scripting the changes from the base
version or (more prefereble) scripting the objects and keeping them in
version control, you can then use an upgrade script on the current version
to bring it into line with the development system.
Tools that may do this include SQL Compare from Red Gate www.red-gate.com
DBGhost www.innovartis.co.uk/Home.aspx and possibly Quest Central for SQL
Server
http://www.quest.com/quest_central/sql_server/freeware/
John
<anthony@.alocovare.com> wrote in message
news:1103136787.823604.21180@.z14g2000cwz.googlegro ups.com...
>I have a development database and a live database. I want to do a DTS
> export from the live box to the dev box to sync the databases up. The
> problem is that the development database has tables, stored procedures
> associated to applications that aren't live yet because they are still
> be tested or aren't done being programmed. If I do the import will
> these tables get deleted or will they remain untouched?
> Thanks in advance
>

DTS Import

I have a development database and a live database. I want to do a DTS
export from the live box to the dev box to sync the databases up. The
problem is that the development database has tables, stored procedures
associated to applications that aren't live yet because they are still
be tested or aren't done being programmed. If I do the import will
these tables get deleted or will they remain untouched?
Thanks in advanceHi
Usually you would re-sync the data by scripting the changes from the base
version or (more prefereble) scripting the objects and keeping them in
version control, you can then use an upgrade script on the current version
to bring it into line with the development system.
Tools that may do this include SQL Compare from Red Gate www.red-gate.com
DBGhost www.innovartis.co.uk/Home.aspx and possibly Quest Central® for SQL
Server
http://www.quest.com/quest_central/sql_server/freeware/
John
<anthony@.alocovare.com> wrote in message
news:1103136787.823604.21180@.z14g2000cwz.googlegroups.com...
>I have a development database and a live database. I want to do a DTS
> export from the live box to the dev box to sync the databases up. The
> problem is that the development database has tables, stored procedures
> associated to applications that aren't live yet because they are still
> be tested or aren't done being programmed. If I do the import will
> these tables get deleted or will they remain untouched?
> Thanks in advance
>

DTS help please

Hi,
I am using a DTS package to "Export Data" between two databases, but in fact
I want to be able to create a copy of the first db.. I am obviously a
newbie, but is there a better way to create a duplicate or "mirror" of the
main database and use a DTS package to automate the process?
thank you again
G
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.805 / Virus Database: 547 - Release Date: 03-Dec-04Hi
A quicker way would be to use BACKUP/RESTORE. It would depend on how often
you wish to make the copy and how up-to-date it needs to be. You could also
check out Log Shipping and Replication.
http://support.microsoft.com/defaul...en-us;Q314546#2
http://support.microsoft.com/kb/304692/EN-US/
http://msdn.microsoft.com/SQL/sqlwa...on/default.aspx
http://msdn.microsoft.com/library/d...LServer2000.asp
John
"Neither rhyme nor reason" <sportman_6663@.yahoo.ca> wrote in message
news:fnuae.27483$Jg5.1397312@.news20.bellglobal.com...
> Hi,
> I am using a DTS package to "Export Data" between two databases, but in
> fact
> I want to be able to create a copy of the first db.. I am obviously a
> newbie, but is there a better way to create a duplicate or "mirror" of the
> main database and use a DTS package to automate the process?
>
> thank you again
> G
>
> --
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.805 / Virus Database: 547 - Release Date: 03-Dec-04
>

DTS help needed!

I often use DTS to move databases between the servers. When you choose "Transform" data and Column Mappings and Transformation window opens, the default option is Append rows to destination table.
Question: Is there a way to change the default option to Delete rows in destination table, so I wouldnt have to go thru the transformation of dozens of tables every time I move databases around.

P.S. I know that I can save DTS package with my settings and use it later. The problem is that every time it might be different database or objects might change. So, it is not a solution for me.

ThanksPreceed the step with either DELETE or TRUNCATE script that you can easily generate yourself.

create view dbo.vw_DELETE_ALL_TABLES as
select 'DELETE ' + db_name() + '.dbo.[' + name + '] ' + char(13) + char(10) + 'go'
from dbo.sysobjects where objectproperty(id, 'IsTable')=1
and objectproperty(id, 'IsMSShipped')=0

Below is the OS step that you will need to create:

bcp <you_db>.dbo.vw_DELETE_ALL_TABLES out DELETE_ALL_TABLES.SQL -S <your_server> -T -c
osql -S <your_server> -E -i DELETE_ALL_TABLES.SQL|||Thanks rdjabarov,

It might work if you are dealing with a whole database.
But what if user asks you to refresh development database with the production data except a few tables? In this case you will need to modify your script, or ...?
That is why I was wondering if I could modify the default setting for DTS to "Delete rows in destination tables".

Thanks again|||Well, then have an exception table and populate it with tables that don't need to be refreshed. Then modify the view to return only records that are not found in the exception table. Easy, right? ;)|||It might be easy if you don't have 230 databases to support.
In my situation maintaining "exceptions" table in each database can be entire new project. So, I guess I will do it the old way - open and click to transform each table.

Thank you for your help.|||Well what I would do is create a quick web app that will pass the parameters such as what tables to transform and weather to delete the data or not to the dts package and then execute it.|||It might be easy if you don't have 230 databases to support...I used to support 1500 databases, now I support over 3500. If you think you can't afford to invest 1.5 hours in designing the structure and the process that would take care of it...I rest my case ;)|||1500? How many servers?

And that sound ludicrous...DTS..

I would dump and RESTORE...|||Calm down guys,

You forgot my initial question: Is there a way to make a default one of the DTS options in "Column mappings and transformations" window to "Delete rows in destination table" instead of "Append..."? That's it.

I'm pretty sure there are dozen of ways to transfer databases/data between the servers, as well as dozen of reason why you prefer to choose one way or another.

Thanks a lot for your help