Showing posts with label dts. Show all posts
Showing posts with label dts. Show all posts

Monday, March 12, 2012

manipulating binary data

To all,
I have a binary data type in my database. It is an array of doubles. I
would like to create a DTS package that can change this binary data type int
o
an array so I can retrieve one of the double values at a specific index.
Is there any way to do this?
How can I cast the binary data type in the database as an array of doubles?
Thanks in advance,
GloriaThere is no such thing in SQL as an array. So, to understand this clearly,
the data yoou have in the database, even though it was an array of doubles i
n
your client code before you sent it there, in the database it's just a byte
stream, or a long string of bytes...
To convert it to individual values, will most easily be done using client
side code in some programming language.
If the "array" was a delimited list of doubles represesnted as text, then it
miht be possible to do this parsing and separating using some SQL Code, but
even tis is medium to hard. If the data in your binary data column is the
actual binary byte stream generated by some client side code language to
represent an array of IEEE Double precision floats, then there's probably no
hope of parsing those individual values out in SQL Code...
"Gloria" wrote:

> To all,
> I have a binary data type in my database. It is an array of doubles. I
> would like to create a DTS package that can change this binary data type i
nto
> an array so I can retrieve one of the double values at a specific index.
> Is there any way to do this?
> How can I cast the binary data type in the database as an array of doubles
?
> Thanks in advance,
> Gloria|||There are no arrays in SQL, nor do we use it for bit level
manipulations. Indexes in SQL are not exposed toi the programmer; in
fact they are a implementattion method that not all products use
(Teradata is based on hashing; Nucleus uses bit vectors, etc.).
You have missed the point of SQL and have returned to a C style file
system in your mental model. And there is nothing wrong with a file or
programming at the machine level for certain problems. Databases are
not one of those problems.

Wednesday, March 7, 2012

Managing Excel execution through DTS

We have a convoluted DTS package. The package is stored and scheduled to run on database server1. Within the package we:
Make a connection to database server2
Execute a Process Task to execute EXCEL.EXE that is installed on server3
Pass parameters through the Process Task direct EXCEL.EXE to open a .xls file on server4
When the Excel file opens, an auto_exec macro in the Excel file being opened imports a text file local to server4 AND directs Excel to save it with another name on server4.

The questions are:
1. Excel is not installed on server1 so how do we direct Excel to execute on server3 rather than server1 where the DTS package is being executed?

2. And how do we control the security context that executes Excel through this use of automation?

3. Other than potential CPU competition, are there any significant issues with having Excel installed on a dedicated database server?Yikes! That is convoluted. Is there any particular reason you are doing things this way?|||Dude -

Are you into masochism? Enjoy sleepless nights?

Seriously - just pull the excel spreadsheet from the server you are reading from, open it on the machine with the dts package, do the manipulation & then copy the final result to wherever its going....

Dont make it any more complicated than it has to be - K.I.S.S.

Simple = Robust.

Cheers,|||Why do you have 4 servers in this scenario when you just want to modify some data on another server than where the DTS-package is situated?

What kind of data does this file contain, and why does it have to be updated via Excel?

Managing DTS Programmatically

Does anyone out there have any tip on managing DTS packages
programmatically?
Specifically, I want to install and run a dts package using tsql through
query anyalyzer.
I know how to run it using the xp_cmdshell, but I don't know how to install
it programatically from a Structured Storage File.You can 'install' the structured storage file like you would any other file
needed by your application. DTS doesn't really care where the file resides.
You might consider creating a folder on the SQL Server specifically for DTS
package files. You could then launch the packages using DTSRUN via
xp_cmdshell from that well-known location. Folder/file creation can be done
manually or as part of a Windows Installer package, depending on your
deployment requirements.
Hope this helps.
Dan Guzman
SQL Server MVP
"rmg66" <rgwathney__xXx__primepro.com> wrote in message
news:%23WYn30uEGHA.524@.TK2MSFTNGP09.phx.gbl...
> Does anyone out there have any tip on managing DTS packages
> programmatically?
> Specifically, I want to install and run a dts package using tsql through
> query anyalyzer.
> I know how to run it using the xp_cmdshell, but I don't know how to
> install
> it programatically from a Structured Storage File.
>

Saturday, February 25, 2012

Managing Big Database

H
I have a Database over 50G. It increases 1G per day
Today I detach the current database and move the data&log file to E drive. Then I use DTS transfering those data to a new database on D drive. The database becomes 18G!!!! I check the tables, everything is there.
How did this happen? I thought there must be something about fragments. But I am not sure. Can anyone tell me
And is there any other way to defrag the database without taking off-line
thank you very muchDBCC ShrinkDatabase?
Most of the suggestions in http://www.aspfaq.com/2446 apply to any database.
Also see http://www.aspfaq.com/2471
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"I.O" <anonymous@.discussions.microsoft.com> wrote in message
news:795D47D7-4A98-4907-8B2D-452A172EC1CD@.microsoft.com...
> Hi
> I have a Database over 50G. It increases 1G per day!
> Today I detach the current database and move the data&log file to E drive.
Then I use DTS transfering those data to a new database on D drive. The
database becomes 18G!!!! I check the tables, everything is there.
> How did this happen? I thought there must be something about fragments.
But I am not sure. Can anyone tell me?
> And is there any other way to defrag the database without taking off-line?
>
> thank you very much|||I have found the cause! It's because that I didn't build the index.|||I shrink database every day. The log file is quite small.|||and make sure you take backups of the database in order to be able to shrink
the transaction log in case of a full recovery model.
Check books online on dbcc shrinkdatabase, dbcc shrinkfile, and shrinking
the transaction log
--
Regards,
Dandy Weyn
MCSE, MCSA, MCDBA, MCT
www.dandyman.net
"I.O" <anonymous@.discussions.microsoft.com> wrote in message
news:795D47D7-4A98-4907-8B2D-452A172EC1CD@.microsoft.com...
> Hi
> I have a Database over 50G. It increases 1G per day!
> Today I detach the current database and move the data&log file to E drive.
Then I use DTS transfering those data to a new database on D drive. The
database becomes 18G!!!! I check the tables, everything is there.
> How did this happen? I thought there must be something about fragments.
But I am not sure. Can anyone tell me?
> And is there any other way to defrag the database without taking off-line?
>
> thank you very much

Managing Big Database

Hi
I have a Database over 50G. It increases 1G per day!
Today I detach the current database and move the data&log file to E drive. T
hen I use DTS transfering those data to a new database on D drive. The data
base becomes 18G!!!! I check the tables, everything is there.
How did this happen? I thought there must be something about fragments. But
I am not sure. Can anyone tell me?
And is there any other way to defrag the database without taking off-line?
thank you very muchDBCC ShrinkDatabase?
Most of the suggestions in http://www.aspfaq.com/2446 apply to any database.
Also see http://www.aspfaq.com/2471
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"I.O" <anonymous@.discussions.microsoft.com> wrote in message
news:795D47D7-4A98-4907-8B2D-452A172EC1CD@.microsoft.com...
quote:

> Hi
> I have a Database over 50G. It increases 1G per day!
> Today I detach the current database and move the data&log file to E drive.

Then I use DTS transfering those data to a new database on D drive. The
database becomes 18G!!!! I check the tables, everything is there.
quote:

> How did this happen? I thought there must be something about fragments.

But I am not sure. Can anyone tell me?
quote:

> And is there any other way to defrag the database without taking off-line?
>
> thank you very much
|||I have found the cause! It's because that I didn't build the index.|||I shrink database every day. The log file is quite small.|||and make sure you take backups of the database in order to be able to shrink
the transaction log in case of a full recovery model.
Check books online on dbcc shrinkdatabase, dbcc shrinkfile, and shrinking
the transaction log
Regards,
Dandy Weyn
MCSE, MCSA, MCDBA, MCT
www.dandyman.net
"I.O" <anonymous@.discussions.microsoft.com> wrote in message
news:795D47D7-4A98-4907-8B2D-452A172EC1CD@.microsoft.com...
quote:

> Hi
> I have a Database over 50G. It increases 1G per day!
> Today I detach the current database and move the data&log file to E drive.

Then I use DTS transfering those data to a new database on D drive. The
database becomes 18G!!!! I check the tables, everything is there.
quote:

> How did this happen? I thought there must be something about fragments.

But I am not sure. Can anyone tell me?
quote:

> And is there any other way to defrag the database without taking off-line?
>
> thank you very much