Wednesday, March 21, 2012
DTS package to import a csv file on a web server
file.
In enterprise manager when i attempt to create the dts process, im not sure
what datasource should i be using to connect to my csv file that resides on
the web server?
where do i specify me server to connect to; eg: www.myserver.com\dbRight-click Local Packages and select New Package, Look on Connection and
select Text File (Source). Specify the file name location on the network.
Perhaps you will need to create a shared folder on your web server and give
permissions to the SQL Server service account.
Hope this helps,
Ben Nevarez, MCDBA, OCP
Database Administrator
"bj" wrote:
> Im trying to schedule a dts package to import a database table from a csv
> file.
> In enterprise manager when i attempt to create the dts process, im not sur
e
> what datasource should i be using to connect to my csv file that resides o
n
> the web server?
> where do i specify me server to connect to; eg: www.myserver.com\db
>
>|||thanks ben
I think my biggest problem is working out what my UNC path to my web server
is to locate my text file
should it look something like this
\\syd2004\www.bradyaust.com.au\db\
"Ben Nevarez" <bnevarez@.sjm.com> wrote in message
news:118D97ED-21FC-4538-8670-53C25A1CF867@.microsoft.com...
> Right-click Local Packages and select New Package, Look on Connection and
> select Text File (Source). Specify the file name location on the network.
> Perhaps you will need to create a shared folder on your web server and
> give
> permissions to the SQL Server service account.
> Hope this helps,
> Ben Nevarez, MCDBA, OCP
> Database Administrator
>
> "bj" wrote:
>|||Go to your web server, select the folder containing the text file,
right-click and select Sharing and Security, Share this folder, give
Permissions (very careful here), maybe remove permissions to Everyone, Add
the SQL Server service account, etc.
Let us suppose you shared your folder as MyData, then SQL Server would be
able to access the file using \\webservername\MyData\MyTextFile.
Again, pay special attention to the permissions you give to the shared folde
r.
Ben Nevarez, MCDBA, OCP
Database Administrator
"bj" wrote:
> thanks ben
> I think my biggest problem is working out what my UNC path to my web serve
r
> is to locate my text file
> should it look something like this
> \\syd2004\www.bradyaust.com.au\db\
>
> "Ben Nevarez" <bnevarez@.sjm.com> wrote in message
> news:118D97ED-21FC-4538-8670-53C25A1CF867@.microsoft.com...
>
>
Monday, March 19, 2012
DTS Package reports error when executed from an ASP page
The package connects to a remote folder on the LAN and uploads a couple of foxpro tables to SQL Server. The package runs without errors when executed from Enterprise Manager.
I have an inkling the problem is to do with permissions but I'm not sure. Is it true that when run from a web page, the DTS is executed by the webserver? If so, how can I modify the access permissions of the remote folder so as to grant IUSR_WebServerName Read and Write access?
Any help is much appreciated.
Yes it is true that the DTS package will be executed by the Webserver, with whatever permissions that service account has. I am sorry, but I do not know enough about the web server end of the operation to tell you how to give the webserver access to that folder.
Donald Farmer
|||Thanks for the reply. I have solved the problem by using COM objects to wrap the DTS and runing it from a stored procedure.
Thanks. Good to hear you have it working.
DTS package in 2005
I have a DTS package in SQL Server 2005 , I will have to use the web service in the DTS Package, So my Biggest Doubt is
Can i Call the Web Service in the DTS Package using the Stored Procedure ? :confused:
Or
Can i call the Web Service in the DTS Package using the VB.Script ?:confused:
This is the Most Important thing for Us Right of now, and Will be happy if i could get some help.
Thankssince you are using 2005, you can call a web service in a sproc if it's a CLR sproc. a CLR sproc is implemented in managed code and can do anything you could do in C#, including calling a web service. It doesn't mean you *should* do it though...|||If you are using Sql Server 2005 then I hope that you mean Integration Services and you can easily call a Web Service from there. It is a Control Flow task specifically named Web Service Task. There are several examples of how to use the task floating around the net and a couple on Microsoft's site.|||Many people import their DTS packages (to the place under Management > Legacy) and continue using them.
(Honestly, much quicker than trying to understand the SSIS design tool IMO)
Friday, March 9, 2012
DTS Package and ASP.NET
I need to export tables out of a Pervasive DB and into SQL Server 2K. I
have set up a DTS Package to do this when a user visits a web page
(which will then allow them to view a up to date report using MS
Reporting Services).
Currently my DTS package checks to see if the table exists in SQL
Server and then drops it, creates it, and then does the import of data
from Pervasive.
I am wondering if there is a way to get only the new records? There are
currently no PK defined (Pervasive does not make use of them). However,
I noticed that the DTS package can assign PK.
Does anyone have any advice/code snippets?
I greatly appreciate your help.
Thanks,
TonyHi
What do you do if the existing record has been updated? Even if there is no
primary key there should (hopefully!) be a unique way (set of columns) to
identify them, this should be the PK in the SQL Server database.
One method is to load into a staging table then work from there. If you
drive the transformation using a SQL command in the form
SELECT S.Col1, S.Col2, ...
FROM StageTable S
WHERE NOT EXISTS ( SELECT 1 FROM DestinationTable D WHERE D.PK = S.PK )
You will not insert the existing rows. You can also use an additional SQL
Command step before the insert to update existing rows.
UPDATE D
SET Col1 = S.Col1,
Col2 = S.Col2
FROM DestinationTable D
JOIN StageTable S ON D.PK = S.PK
WHERE D.Col1 <> S.Col1
OR D.Col2 <> S.Col2
John
"Tony" <tcarcieri@.rihousing.com> wrote in message
news:1109857630.729309.129570@.l41g2000cwc.googlegr oups.com...
> Hi all,
> I need to export tables out of a Pervasive DB and into SQL Server 2K. I
> have set up a DTS Package to do this when a user visits a web page
> (which will then allow them to view a up to date report using MS
> Reporting Services).
> Currently my DTS package checks to see if the table exists in SQL
> Server and then drops it, creates it, and then does the import of data
> from Pervasive.
> I am wondering if there is a way to get only the new records? There are
> currently no PK defined (Pervasive does not make use of them). However,
> I noticed that the DTS package can assign PK.
> Does anyone have any advice/code snippets?
> I greatly appreciate your help.
> Thanks,
> Tony|||Hello John,
Thanks for the reply.
Is this scenario possible (psuedo code)?
If table exists
1)run update on exisiting data
2)select from pervasive db where not exists
Else
1)create table
2)run select
Your thoughts?
Thanks so much!
Tony
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||Hi Tony
I am not sure why you check the table existance, if you are in control
of the site then it should be know to exist or be part of an
installation. As previously stated, you can drive the data population
from a SQL statement, but doing this over your network may mean that
loading into a staging table may be quicker.
A different way to do this would be though a stored procedure and a
linked server.
John
Tony Carcieri wrote:
> Hello John,
> Thanks for the reply.
> Is this scenario possible (psuedo code)?
> If table exists
> 1)run update on exisiting data
> 2)select from pervasive db where not exists
> Else
> 1)create table
> 2)run select
> Your thoughts?
> Thanks so much!
> Tony
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
DTS Package
You can take a look atMicrosoft.SqlServer.Dts.Runtime Namespace
Google also gave me some examples:
http://www.sqldts.com/default.aspx?207
http://jaysonknight.com/blog/archive/2004/05/29/274.aspx
http://forums.aspfree.com/microsoft-sql-server-14/execute-dts-from-asp-net-19147.html
|||that helps!
Thank you :)