Showing posts with label old. Show all posts
Showing posts with label old. Show all posts

Thursday, March 29, 2012

DTS re-uses old text file input

Hi All,

A simple DTS job I have is giving me fits. It is a straight copy column job from a pipe delimited text file into a table. The input file comes from a mapped drive linked to a shared filesystem on a sun solaris box.

The typical scenario. I run the DTS job to load 8000 rows from the input text file. Job succeeds.

A week later, the text file is updated with 9000 new rows. I run the DTS job with no changes and it loads 8000 rows from last week.

I reboot my Win XP pc and run DTS again. It now loads the 9000 new rows.

I tried mapping to a UNC to no avail.

Is it buffering the old file somewhere? I need help.

current environment:
SQL Server 2000 with all latest SP's and patches
Windows 2000 Server with all latest SP's and patches
Drive 'G' mapped to a shared filesystem on sun solaris via Samba?I don't think DTS will use such type of cache and read old settings, ensure the source file path is defined correctly and oin the next execution it may be reading old settings.|||I don't think DTS will use such type of cache and read old settings, ensure the source file path is defined correctly and oin the next execution it may be reading old settings.

Thanks Satya,

I'm not sure what you mean by "old settings"? Here's what I do know.

Drive 'G' is mapped to \\sun001\data

The input file name is weekly_updates.txt and does not change.

My DTS connection 1 properties uses
G:\weekly_updates.txt in the File Name box.

It always works correctly after a reboot, and more specifically, from any pc, not just mine. Any idea's?|||Might it be somehow related to Enterprise Manager? I wonder if there is a way to automatically force everything in EM to refresh. I dislike having to submit a job and then keep hitting refresh to see when it completes. I'm wondering if the "old" information stored in EM is related to my DTS issue?

Thursday, March 22, 2012

DTS packages on new SQL Server

We're building a new W2K server with the same name as the current one. We
are taking down the old server, moving all the datafiles to the new server,
installing SQL Server, Analysis Services and sp3. The last time we did this
we lost our DTS packages. Can I export them somehow and then import them?
Are they not stored in the system tables?
Thanks,
DougThey are stored in the MSDB database, but moving that database is always
trickey. You can load the DTS packages into Enterprise Mangler and save
them to the file system. You can then reload and resave them when the new
server is ready. If you have a lot of packages, you can write a script to
do that automagically using SQL-DMO and the Package2 object.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Doug Stiers" <stiers@.email.com> wrote in message
news:ehNaTDFDEHA.2308@.tk2msftngp13.phx.gbl...
> We're building a new W2K server with the same name as the current one. We
> are taking down the old server, moving all the datafiles to the new
server,
> installing SQL Server, Analysis Services and sp3. The last time we did
this
> we lost our DTS packages. Can I export them somehow and then import them?
> Are they not stored in the system tables?
> Thanks,
> Doug
>|||OK, I saved a package to a .dts file. How do I import/execute that file?
Thanks,
Doug
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:Ormd6IFDEHA.3568@.tk2msftngp13.phx.gbl...
> They are stored in the MSDB database, but moving that database is always
> trickey. You can load the DTS packages into Enterprise Mangler and save
> them to the file system. You can then reload and resave them when the new
> server is ready. If you have a lot of packages, you can write a script
to
> do that automagically using SQL-DMO and the Package2 object.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Doug Stiers" <stiers@.email.com> wrote in message
> news:ehNaTDFDEHA.2308@.tk2msftngp13.phx.gbl...
We
> server,
> this
them?
>|||I found out how to do this by right clicking on the DTS folder in EM
I should have posted my question in: microsoft.public.sqlserver.tools
"Doug Stiers" <stiers@.email.com> wrote in message
news:%231U091FDEHA.3064@.tk2msftngp13.phx.gbl...
> OK, I saved a package to a .dts file. How do I import/execute that file?
> Thanks,
> Doug
>
> "Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
> news:Ormd6IFDEHA.3568@.tk2msftngp13.phx.gbl...
new
> to
> We
> them?
>|||Don't worry about it. .Server is pretty much a catch-all anyway.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Doug Stiers" <stiers@.email.com> wrote in message
news:uIICb9FDEHA.2908@.TK2MSFTNGP09.phx.gbl...
> I found out how to do this by right clicking on the DTS folder in EM
> I should have posted my question in: microsoft.public.sqlserver.tools
>
> "Doug Stiers" <stiers@.email.com> wrote in message
> news:%231U091FDEHA.3064@.tk2msftngp13.phx.gbl...
always
save
> new
script
one.
did
>

DTS packages fail after server migration

Hi All
My DTS packages fail after i have migrated my sql server from a NT based
network to a windows 2003 based network and unattached the old domain, I
know that the users that was once on the server as %old domain%\user will no
longer have any rights on the sql server, But how can i change the ownership
of those DTS packages to %New Domain%\New AD User.?
some input would be great.
thanksHave you checked SQLDTS.com. I believe package ownership issues are covered
on that site.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Todd" <Todd_c_wright@.hotmail.com> wrote in message
news:uVew3tSDEHA.3348@.TK2MSFTNGP11.phx.gbl...
Hi All
My DTS packages fail after i have migrated my sql server from a NT based
network to a windows 2003 based network and unattached the old domain, I
know that the users that was once on the server as %old domain%\user will no
longer have any rights on the sql server, But how can i change the ownership
of those DTS packages to %New Domain%\New AD User.?
some input would be great.
thanks|||You can change the owner using the undocumented
sp_reassign_dtspackageowner but the package ownership
probably has nothing to do with the packages failing. You
can sometimes run into issues when someone who isn't the
owner and isn't a sysadmin attempts to modify and save
packages owned by someone else but that's about it.
You can find more info on this at the site Vyas referred you
to:
Package Ownership Issues
http://www.sqldts.com/default.aspx?212
Are these scheduled packages that are failing or do they
fail when run manually as well? What are the errors?
-Sue
On Fri, 19 Mar 2004 09:56:27 +1300, "Todd"
<Todd_c_wright@.hotmail.com> wrote:

>Hi All
>My DTS packages fail after i have migrated my sql server from a NT based
>network to a windows 2003 based network and unattached the old domain, I
>know that the users that was once on the server as %old domain%\user will n
o
>longer have any rights on the sql server, But how can i change the ownershi
p
>of those DTS packages to %New Domain%\New AD User.?
> some input would be great.
> thanks
>

Wednesday, March 7, 2012

DTS of data between two tables, same field names but differnt datatypes

I need to migrate data from one sql database to another. The second DB
is a newer version of the "old" database with mostly the same tables
and fieldnames. In order support some reporting queries in the "new"
version I needed to change the datatype of a few fields from varchar to
int(the data stored was integers already as they were lookup tables).

DTS works great except in the cases of about 10 fields which I changed
the datatypes on from varchar to int.

DTS seems to drop the data if the fieldname and datatype are not an
exact match. Is there any way to use DTS and have it copy data from a
field call subsid type varchar to a field call subsid type int?<tdmailbox@.yahoo.com> wrote in message
news:1115388735.044389.231150@.g14g2000cwa.googlegr oups.com...
>I need to migrate data from one sql database to another. The second DB
> is a newer version of the "old" database with mostly the same tables
> and fieldnames. In order support some reporting queries in the "new"
> version I needed to change the datatype of a few fields from varchar to
> int(the data stored was integers already as they were lookup tables).
> DTS works great except in the cases of about 10 fields which I changed
> the datatypes on from varchar to int.
> DTS seems to drop the data if the fieldname and datatype are not an
> exact match. Is there any way to use DTS and have it copy data from a
> field call subsid type varchar to a field call subsid type int?

This should work fine - I tested it quickly on two tables with the same
column name but the source being varchar(10) and the destination int. Using
a Transform Data Task worked correctly, and the mapping was handled
automatically.

I'm not sure what you mean by DTS seems to "drop the data". Perhaps you can
give some more information - your MSSQL version, which type of task you're
using to move the data, the DDL for the tables, any error messages etc.

Simon|||DTS copies all the columns except the ones with datatype changes. My
varchars to ints end up with empty ints in the desitnation table.

SQL 2000, DTS export, no error messages.|||I tested it again with the export wizard (I'd used the package designer
before), and it worked fine. I have no idea why it's not working for
you, unless you have a column transformation of some sort. One other
guess would be that your values are too big for an int, and you've also
set ANSI_WARNINGS OFF, which would ignore the overflow. But since
that's ON for ODBC/OLE DB by default, it's very unlikely.

You could specify a source query instead of a source table and use CAST
to force the conversion:

select col1, col2, cast(col3 as int), col4...
from dbo.SourceTable

Even if that doesn't work, you might get a clue of some sort from an
error. Finally, you could also copy the data into a staging table which
has exactly the same structure as the source table, then use SQL to
check and INSERT the data. Or just INSERT directly, if both databases
are on the same server.

Simon

Tuesday, February 14, 2012

DTS help - using look ups

Hi
I'm migrating data from the old schema to the new schema using DTS. The
old and new schema are different. In the new schema we have identity
columns as Primary keys and referred as foreign keys in the child
tables. In the old schema Primary keys are not identity columns. So when
I migrate old data, identity columns are newly generated for parent
tables. Now in order to establish the foreign key relationship in the
child table i.e, to map the identity value generated, I'm planning to
make use of lookups and active scripts something like this.
Old Schema:
Categories table:
Category name varchar(100) Primary key
Products table:
ProductID int PK
Category Name varchar(100)FK
New Schema:
Categories table:
CategoryID int identity Primary key,
Category Name varchar(100)
Products table:
ProductID int PK
CategoryID int FK
When migrating Categories there is no issue as the identity column
CategoryID is newly generated. When migrating Products table, I should
get the CategoryID value for corresponding Category Name. Shall I use
look ups for this?
SELECT CategoryID FROM Categories
WHERE (CategoryName = ?)
In the active-x script, I'll pass the old CategoryName value
DTSDestination("CategoryID")
=DTSLookups("GetCatID").Execute(DTSSource("CategoryName"))
Is this OK? or is there a better way
Regards
RJN
*** Sent via Developersdex http://www.examnotes.net ***Hi
You could allow identity inserts and keep the old primary keys? This may
help with the products table. If you have gaps in the old Primary keys you
can remove then by allowing cascading updates on the FKs you can then re-ran
k
them.
If you don't want to use lookups, then you could store the transfer the
category name into the products table and then do your own updates to get th
e
categoryid once all the data is imported. The categoryname can then be
dropped from the products table using an ALTER TABLE statement. If the FKS
are in place during the data import you may have to default the Categoryid t
o
a known value that will not violate the FK. This may be quicker than using
lookups.
A tutorial on lookups can be found at:
http://www.sqldts.com/default.aspx?277,1
John
"RJN" wrote:

> Hi
> I'm migrating data from the old schema to the new schema using DTS. The
> old and new schema are different. In the new schema we have identity
> columns as Primary keys and referred as foreign keys in the child
> tables. In the old schema Primary keys are not identity columns. So when
> I migrate old data, identity columns are newly generated for parent
> tables. Now in order to establish the foreign key relationship in the
> child table i.e, to map the identity value generated, I'm planning to
> make use of lookups and active scripts something like this.
> Old Schema:
> Categories table:
> Category name varchar(100) Primary key
> Products table:
> ProductID int PK
> Category Name varchar(100)FK
> New Schema:
> Categories table:
> CategoryID int identity Primary key,
> Category Name varchar(100)
> Products table:
> ProductID int PK
> CategoryID int FK
> When migrating Categories there is no issue as the identity column
> CategoryID is newly generated. When migrating Products table, I should
> get the CategoryID value for corresponding Category Name. Shall I use
> look ups for this?
> SELECT CategoryID FROM Categories
> WHERE (CategoryName = ?)
> In the active-x script, I'll pass the old CategoryName value
> DTSDestination("CategoryID")
> =DTSLookups("GetCatID").Execute(DTSSource("CategoryName"))
> Is this OK? or is there a better way
> Regards
> RJN
>
>
> *** Sent via Developersdex http://www.examnotes.net ***
>