Showing posts with label truncate. Show all posts
Showing posts with label truncate. Show all posts

Thursday, March 29, 2012

DTS Rounding problem

I have a problem...
Data transformation rounds or truncate decimals!
I have an ODBC source in witch is a table with float numbers (ODBC Driver
publish it as float).
If I build a query form access or from excel with Query Analizer, I see all
decimal places, but when I try to insert data using DTS, float numbers will
be converted to its integer values.
A "select * from table", with table ODBC table, gives integer value when
runned from DTS to transform data from ODBC to MS-SQL Server table, and
gives float values from Access or other tools.
Where I can fix my problem?
Thanks.
Giorgioput convert(float,field) around your fields in the insert
example
declare @.i int
select @.i =1
select convert(float,@.i),@.i

http://sqlservercode.blogspot.com/

Tuesday, March 27, 2012

DTS question?????????

Hi,
I use DTS import/export to import data from DB2 into SQL 2000 tables.
It works find. However , I want to truncate the tables first before the
copy.
What is the best way to do this?
Thank you for all your suggestions.Do you have ajob set up for the DTS package?|||I have the DTS save under local PAckages, but I don't know how to
create a job for it.|||From EM right click the package, select 'schedule package'|||once you schedule the package, go to managment -> Jobs. Find the Job that you just created for the DTS. Right click on the job and go to the steps tab. There will be a step already in there for the data that you are transfering. Click on the insert button to insert a new step. A new step box will apear for you to enter info in. Name the step whatever you want. Fot Type, make sure its t-sql script. Make sure you select the right database. In the command text box type truncate table (and the name of the table yo want to clear). Click Apply. THen you will be back in steps tab. There are some arrows to rearrange the steps. Make sure that the truncate step is first. There is also a drop down box to where you select which step goes first.

Hope this helps.|||Thank you all for helping. I'll try that.

Thanks again|||No problem. Let me know if you run into a snag.

Sunday, February 26, 2012

DTS logs and "sysdtssteplog" in msdb

HI,
Does anybody know (maybe from MS) is it safe to remove (truncate table) rows
from the "sysdtssteplog" table with contains DTL step logs?
RedardsYou can delete the logs from Enterprise Manager. Go to Data Transformation
Services, right click in the right pane, and choose 'Package logs...' from
the pop up menu. This will give you a dialog from which you can delete
package logs for all package past and present, and you can delete all the
logs for a package at once as well.
--
Jacco Schalkwijk
SQL Server MVP
"stats12" <vhs180@.polbox.com> wrote in message
news:%231txanRpDHA.2808@.TK2MSFTNGP10.phx.gbl...
> HI,
> Does anybody know (maybe from MS) is it safe to remove (truncate table)
rows
> from the "sysdtssteplog" table with contains DTL step logs?
> Redards
>|||Yes i know, but i must do it manulay for each package.
Now i have 70-ty packages and each is running even 100 times a day.
That's why i'm thinging about some process with wich i would be able to
automatycly clear the DTS logs.
U¿ytkownik "Jacco Schalkwijk" <NOSPAMjaccos@.eurostop.co.uk> napisa³ w
wiadomo¶ci news:e6y1vsRpDHA.2512@.TK2MSFTNGP09.phx.gbl...
> You can delete the logs from Enterprise Manager. Go to Data Transformation
> Services, right click in the right pane, and choose 'Package logs...' from
> the pop up menu. This will give you a dialog from which you can delete
> package logs for all package past and present, and you can delete all the
> logs for a package at once as well.
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "stats12" <vhs180@.polbox.com> wrote in message
> news:%231txanRpDHA.2808@.TK2MSFTNGP10.phx.gbl...
> > HI,
> >
> > Does anybody know (maybe from MS) is it safe to remove (truncate table)
> rows
> > from the "sysdtssteplog" table with contains DTL step logs?
> >
> > Redards
> >
> >
>|||You can create a DTS package with a VBScript task and use the DTS object
model to remove the logs with the PackageSQLServer.RemovePackageLogRecords
method See the article "Retrieving DTS System, Package, and Log Data" in
Books Online for more details.
Undocumented and thus unsupported is the use of the stored procedures that
are called by the above, sp_dump_dtspackagelog and sp_dump_dtslog_all. You
can use these, or have a look at the code of them (they are in the msdb
database), but if something goes wrong with updating system tables directly
like this, you won't have anything to fall back on
--
Jacco Schalkwijk
SQL Server MVP
"stats12" <vhs180@.polbox.com> wrote in message
news:eyJuolSpDHA.3024@.tk2msftngp13.phx.gbl...
> Yes i know, but i must do it manulay for each package.
> Now i have 70-ty packages and each is running even 100 times a day.
> That's why i'm thinging about some process with wich i would be able to
> automatycly clear the DTS logs.
>
> U¿ytkownik "Jacco Schalkwijk" <NOSPAMjaccos@.eurostop.co.uk> napisa³ w
> wiadomo¶ci news:e6y1vsRpDHA.2512@.TK2MSFTNGP09.phx.gbl...
> > You can delete the logs from Enterprise Manager. Go to Data
Transformation
> > Services, right click in the right pane, and choose 'Package logs...'
from
> > the pop up menu. This will give you a dialog from which you can delete
> > package logs for all package past and present, and you can delete all
the
> > logs for a package at once as well.
> >
> > --
> > Jacco Schalkwijk
> > SQL Server MVP
> >
> >
> > "stats12" <vhs180@.polbox.com> wrote in message
> > news:%231txanRpDHA.2808@.TK2MSFTNGP10.phx.gbl...
> > > HI,
> > >
> > > Does anybody know (maybe from MS) is it safe to remove (truncate
table)
> > rows
> > > from the "sysdtssteplog" table with contains DTL step logs?
> > >
> > > Redards
> > >
> > >
> >
> >
>|||Thank's for the tip with VB and the "PackageSQLServer" object - that's all i
need...
Regards...
U¿ytkownik "Jacco Schalkwijk" <NOSPAMjaccos@.eurostop.co.uk> napisa³ w
wiadomo¶ci news:eqoiYDTpDHA.392@.TK2MSFTNGP11.phx.gbl...
> You can create a DTS package with a VBScript task and use the DTS object
> model to remove the logs with the PackageSQLServer.RemovePackageLogRecords
> method See the article "Retrieving DTS System, Package, and Log Data" in
> Books Online for more details.
> Undocumented and thus unsupported is the use of the stored procedures that
> are called by the above, sp_dump_dtspackagelog and sp_dump_dtslog_all. You
> can use these, or have a look at the code of them (they are in the msdb
> database), but if something goes wrong with updating system tables
directly
> like this, you won't have anything to fall back on
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "stats12" <vhs180@.polbox.com> wrote in message
> news:eyJuolSpDHA.3024@.tk2msftngp13.phx.gbl...
> > Yes i know, but i must do it manulay for each package.
> > Now i have 70-ty packages and each is running even 100 times a day.
> > That's why i'm thinging about some process with wich i would be able to
> > automatycly clear the DTS logs.
> >
> >
> > U¿ytkownik "Jacco Schalkwijk" <NOSPAMjaccos@.eurostop.co.uk> napisa³ w
> > wiadomo¶ci news:e6y1vsRpDHA.2512@.TK2MSFTNGP09.phx.gbl...
> > > You can delete the logs from Enterprise Manager. Go to Data
> Transformation
> > > Services, right click in the right pane, and choose 'Package logs...'
> from
> > > the pop up menu. This will give you a dialog from which you can delete
> > > package logs for all package past and present, and you can delete all
> the
> > > logs for a package at once as well.
> > >
> > > --
> > > Jacco Schalkwijk
> > > SQL Server MVP
> > >
> > >
> > > "stats12" <vhs180@.polbox.com> wrote in message
> > > news:%231txanRpDHA.2808@.TK2MSFTNGP10.phx.gbl...
> > > > HI,
> > > >
> > > > Does anybody know (maybe from MS) is it safe to remove (truncate
> table)
> > > rows
> > > > from the "sysdtssteplog" table with contains DTL step logs?
> > > >
> > > > Redards
> > > >
> > > >
> > >
> > >
> >
> >
>

Friday, February 24, 2012

DTS job

Hi ,
During a DTS job what are the actions that cannot be
done on a table ? i.e DELETE/TRUNCATE , UPDATE , INSERT '
i am doing some migration using DTS job but the current
database is still being used by users
thks & rdgsYou can do anything in a DTS job that you have permission to do,,, select,
insert, update, delete, truncate, select int, create, drop, alter...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
news:337201c48f21$75909980$a301280a@.phx.gbl...
> Hi ,
> During a DTS job what are the actions that cannot be
> done on a table ? i.e DELETE/TRUNCATE , UPDATE , INSERT '
> i am doing some migration using DTS job but the current
> database is still being used by users
> thks & rdgs|||Hi Wayne ,
what i actually meant was during a DTS job that
transfers data from Table A in Location A to Location B.
What shld i not do to Table A so that DTS job will not
fail ?
thks & rdgs
>--Original Message--
>You can do anything in a DTS job that you have permission
to do,,, select,
>insert, update, delete, truncate, select int, create,
drop, alter...
>--
>Wayne Snyder, MCDBA, SQL Server MVP
>Mariner, Charlotte, NC
>www.mariner-usa.com
>(Please respond only to the newsgroups.)
>I support the Professional Association of SQL Server
(PASS) and it's
>community of SQL Server professionals.
>www.sqlpass.org
>"maxzsim" <anonymous@.discussions.microsoft.com> wrote in
message
>news:337201c48f21$75909980$a301280a@.phx.gbl...
INSERT '[vbcol=seagreen]
current[vbcol=seagreen]
>
>.
>

DTS job

Hi ,
During a DTS job what are the actions that cannot be
done on a table ? i.e DELETE/TRUNCATE , UPDATE , INSERT ?
i am doing some migration using DTS job but the current
database is still being used by users
thks & rdgs
You can do anything in a DTS job that you have permission to do,,, select,
insert, update, delete, truncate, select int, create, drop, alter...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
news:337201c48f21$75909980$a301280a@.phx.gbl...
> Hi ,
> During a DTS job what are the actions that cannot be
> done on a table ? i.e DELETE/TRUNCATE , UPDATE , INSERT ?
> i am doing some migration using DTS job but the current
> database is still being used by users
> thks & rdgs
|||Hi Wayne ,
what i actually meant was during a DTS job that
transfers data from Table A in Location A to Location B.
What shld i not do to Table A so that DTS job will not
fail ?
thks & rdgs
>--Original Message--
>You can do anything in a DTS job that you have permission
to do,,, select,
>insert, update, delete, truncate, select int, create,
drop, alter...
>--
>Wayne Snyder, MCDBA, SQL Server MVP
>Mariner, Charlotte, NC
>www.mariner-usa.com
>(Please respond only to the newsgroups.)
>I support the Professional Association of SQL Server
(PASS) and it's
>community of SQL Server professionals.
>www.sqlpass.org
>"maxzsim" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:337201c48f21$75909980$a301280a@.phx.gbl...
INSERT ?[vbcol=seagreen]
current
>
>.
>

DTS job

Hi ,
During a DTS job what are the actions that cannot be
done on a table ? i.e DELETE/TRUNCATE , UPDATE , INSERT '
i am doing some migration using DTS job but the current
database is still being used by users
thks & rdgsYou can do anything in a DTS job that you have permission to do,,, select,
insert, update, delete, truncate, select int, create, drop, alter...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"maxzsim" <anonymous@.discussions.microsoft.com> wrote in message
news:337201c48f21$75909980$a301280a@.phx.gbl...
> Hi ,
> During a DTS job what are the actions that cannot be
> done on a table ? i.e DELETE/TRUNCATE , UPDATE , INSERT '
> i am doing some migration using DTS job but the current
> database is still being used by users
> thks & rdgs|||Hi Wayne ,
what i actually meant was during a DTS job that
transfers data from Table A in Location A to Location B.
What shld i not do to Table A so that DTS job will not
fail ?
thks & rdgs
>--Original Message--
>You can do anything in a DTS job that you have permission
to do,,, select,
>insert, update, delete, truncate, select int, create,
drop, alter...
>--
>Wayne Snyder, MCDBA, SQL Server MVP
>Mariner, Charlotte, NC
>www.mariner-usa.com
>(Please respond only to the newsgroups.)
>I support the Professional Association of SQL Server
(PASS) and it's
>community of SQL Server professionals.
>www.sqlpass.org
>"maxzsim" <anonymous@.discussions.microsoft.com> wrote in
message
>news:337201c48f21$75909980$a301280a@.phx.gbl...
>> Hi ,
>> During a DTS job what are the actions that cannot be
>> done on a table ? i.e DELETE/TRUNCATE , UPDATE ,
INSERT '
>> i am doing some migration using DTS job but the
current
>> database is still being used by users
>> thks & rdgs
>
>.
>