Showing posts with label directory. Show all posts
Showing posts with label directory. Show all posts

Sunday, March 11, 2012

Calling a Data Pump task from DTS?

I have a vbscript to read all files from a directory and, if the file
is valid, I would like my DTS to process it. I tried using the
vbscript as an ActiveX workflow script in the DTS, but it does not
execute the data pump until it has completed looping through all the
files, so only the last file read is sucked into the database
(utilizing a global variable as the filename). Is there a way to
execute the data pump task from within the activex script? I can't
seem to find any documentation about executing a DTS task.

Basically, the workflow I want is:

1)Read files from directory (the number and names may change each
time). (done with vbs)

2)For each file, send it through the transformation into the database.

3)When the information is in the database, append a date to the file
and move it to the archive folder. (done with vbs)

If I am going about this the wrong way and you see something that is
not obvious to me, please let me know.

Thanks in advance!Hi

This may help:
http://www.sqldts.com/default.aspx?246

John

<noelle.bond@.gmail.com> wrote in message
news:1128110995.716126.283160@.g47g2000cwa.googlegr oups.com...
>I have a vbscript to read all files from a directory and, if the file
> is valid, I would like my DTS to process it. I tried using the
> vbscript as an ActiveX workflow script in the DTS, but it does not
> execute the data pump until it has completed looping through all the
> files, so only the last file read is sucked into the database
> (utilizing a global variable as the filename). Is there a way to
> execute the data pump task from within the activex script? I can't
> seem to find any documentation about executing a DTS task.
> Basically, the workflow I want is:
> 1)Read files from directory (the number and names may change each
> time). (done with vbs)
> 2)For each file, send it through the transformation into the database.
> 3)When the information is in the database, append a date to the file
> and move it to the archive folder. (done with vbs)
> If I am going about this the wrong way and you see something that is
> not obvious to me, please let me know.
> Thanks in advance!|||Thanks so much! I'll give it a try.|||noelle.bond@.gmail.com wrote:

> Thanks so much! I'll give it a try.

Just be forewarned, the DTS designer has a big disconnect between what
it shows you as the name of a DTS step and what actually needs to be
used in your VBScript code to refer to it as...

Thursday, March 8, 2012

Call to Report Mqanager through Internet

Hi All,

Is it possible to call report manager through ASP.NET application?

We are using Microsoft Active Directory to validate users.

If the user type is admin then we would like to call the report manager so that the admin can create roles etc.

Does anyone knows how to do this?

Report Manager uses the report server SOAP API to perform management tasks. You can use this same API for your own applications. See http://msdn2.microsoft.com/en-us/library/ms152787(SQL.90).aspx|||

Thanks for the info. It looks like we can develop our own custom Report Manager using APIs. But we don't have time to do this.

So, is it possible to call report manager from web application? Something like..

http:/ReportSever/Reports and the admin can see just his folder(s).

|||Anyone know about this?|||

You can access Report Manager Folder the same way that you access other Virtual Directories. Go to your IIS Admin and look for Reports Virtual Directory and set up the security that you need. the URL should be somethig like:

http://YourServerOrIPAddress/Reports

|||Thanks much!!

Call to Report Manager through Internet

Hi All,

Is it possible to call report manager through ASP.NET application?

We are using Microsoft Active Directory to validate users.

If the user type is admin then we would like to call the report manager so that the admin can create roles etc.

Does anyone knows how to do this?

Report Manager uses the report server SOAP API to perform management tasks. You can use this same API for your own applications. See http://msdn2.microsoft.com/en-us/library/ms152787(SQL.90).aspx|||

Thanks for the info. It looks like we can develop our own custom Report Manager using APIs. But we don't have time to do this.

So, is it possible to call report manager from web application? Something like..

http:/ReportSever/Reports and the admin can see just his folder(s).

|||Anyone know about this?|||

You can access Report Manager Folder the same way that you access other Virtual Directories. Go to your IIS Admin and look for Reports Virtual Directory and set up the security that you need. the URL should be somethig like:

http://YourServerOrIPAddress/Reports

|||Thanks much!!

Sunday, February 12, 2012

Calculating Folder Size in TSQL

I am looking for a method to calculate the size of a directory within
a stored procedure/function.
Basically, I want to do a select on a table, grab all data from the
table and get the size of a directory for each record. The select
would look something like this...
SELECT
w.WebsiteName,
w.IPAddress,
w.Status,
c.ClientName,
dbo.udfGetFolderSize(w.WebsitePath) as FolderSize -- <-- This is
what I am looking for...
FROM dbo.Websites w
INNER JOIN dbo.Clients c
ON c.ID = w.Clients_ID
ORDER BY w.WebsiteName, C.ClientNameHi,
I'm doing something similar with the DOS dir command and xp_cmdshell, though
I'm looking for files, not total usage.
Here is a small example to get you started.
Good luck,
Jay
-- cut --
use tempdb
set nocount on
declare @.line varchar(255)
declare @.path varchar(255)
declare @.command varchar(255)
if object_id('#output') is not null and objectproperty(object_id('#output'),
'IsTable') = 1
drop table #output
create table #output (line varchar(255))
set @.path = 'C:\Program Files'
set @.path = 'C:\WINDOWS'
set @.command = 'dir "' + @.path +'"'
insert into #output
exec master.dbo.xp_cmdshell @.command
select @.line = ltrim(replace(substring(line, charindex(')', line)+1,
len(line)), ',', ''))
from #output where line like '%File(s)%bytes'
print @.line + ' (This is a string and the value ignores the size of any
sub-folders)'
-- cut --
<TampaWebDevelopment@.gmail.com> wrote in message
news:1192614500.170755.290550@.q3g2000prf.googlegroups.com...
>I am looking for a method to calculate the size of a directory within
> a stored procedure/function.
> Basically, I want to do a select on a table, grab all data from the
> table and get the size of a directory for each record. The select
> would look something like this...
> SELECT
> w.WebsiteName,
> w.IPAddress,
> w.Status,
> c.ClientName,
> dbo.udfGetFolderSize(w.WebsitePath) as FolderSize -- <-- This is
> what I am looking for...
> FROM dbo.Websites w
> INNER JOIN dbo.Clients c
> ON c.ID = w.Clients_ID
> ORDER BY w.WebsiteName, C.ClientName
>|||The problem with this is enabling xp_cmdshell which is a potential security
threat. Why not use WMI with VBScript instead, write the results in a CSV
file and import the data in a SQL Server table?
"Jay" <spam@.nospam.org> wrote in message
news:OAfGOXMEIHA.5208@.TK2MSFTNGP04.phx.gbl...
> Hi,
> I'm doing something similar with the DOS dir command and xp_cmdshell,
> though I'm looking for files, not total usage.
> Here is a small example to get you started.
> Good luck,
> Jay
> -- cut --
> use tempdb
> set nocount on
> declare @.line varchar(255)
> declare @.path varchar(255)
> declare @.command varchar(255)
> if object_id('#output') is not null and
> objectproperty(object_id('#output'), 'IsTable') = 1
> drop table #output
> create table #output (line varchar(255))
> set @.path = 'C:\Program Files'
> set @.path = 'C:\WINDOWS'
> set @.command = 'dir "' + @.path +'"'
> insert into #output
> exec master.dbo.xp_cmdshell @.command
> select @.line = ltrim(replace(substring(line, charindex(')', line)+1,
> len(line)), ',', ''))
> from #output where line like '%File(s)%bytes'
> print @.line + ' (This is a string and the value ignores the size of any
> sub-folders)'
> -- cut --
>
> <TampaWebDevelopment@.gmail.com> wrote in message
> news:1192614500.170755.290550@.q3g2000prf.googlegroups.com...
>>I am looking for a method to calculate the size of a directory within
>> a stored procedure/function.
>> Basically, I want to do a select on a table, grab all data from the
>> table and get the size of a directory for each record. The select
>> would look something like this...
>> SELECT
>> w.WebsiteName,
>> w.IPAddress,
>> w.Status,
>> c.ClientName,
>> dbo.udfGetFolderSize(w.WebsitePath) as FolderSize -- <-- This is
>> what I am looking for...
>> FROM dbo.Websites w
>> INNER JOIN dbo.Clients c
>> ON c.ID = w.Clients_ID
>> ORDER BY w.WebsiteName, C.ClientName
>|||He asked for a way from within T-SQL. Can you use WMI from SQL? I didn't
think so.
"bass_player [SBS-MVP]" <bass_player@.mvps.org> wrote in message
news:u2LkjuVEIHA.1208@.TK2MSFTNGP05.phx.gbl...
> The problem with this is enabling xp_cmdshell which is a potential
> security threat. Why not use WMI with VBScript instead, write the results
> in a CSV file and import the data in a SQL Server table?
> "Jay" <spam@.nospam.org> wrote in message
> news:OAfGOXMEIHA.5208@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> I'm doing something similar with the DOS dir command and xp_cmdshell,
>> though I'm looking for files, not total usage.
>> Here is a small example to get you started.
>> Good luck,
>> Jay
>> -- cut --
>> use tempdb
>> set nocount on
>> declare @.line varchar(255)
>> declare @.path varchar(255)
>> declare @.command varchar(255)
>> if object_id('#output') is not null and
>> objectproperty(object_id('#output'), 'IsTable') = 1
>> drop table #output
>> create table #output (line varchar(255))
>> set @.path = 'C:\Program Files'
>> set @.path = 'C:\WINDOWS'
>> set @.command = 'dir "' + @.path +'"'
>> insert into #output
>> exec master.dbo.xp_cmdshell @.command
>> select @.line = ltrim(replace(substring(line, charindex(')', line)+1,
>> len(line)), ',', ''))
>> from #output where line like '%File(s)%bytes'
>> print @.line + ' (This is a string and the value ignores the size of any
>> sub-folders)'
>> -- cut --
>>
>> <TampaWebDevelopment@.gmail.com> wrote in message
>> news:1192614500.170755.290550@.q3g2000prf.googlegroups.com...
>>I am looking for a method to calculate the size of a directory within
>> a stored procedure/function.
>> Basically, I want to do a select on a table, grab all data from the
>> table and get the size of a directory for each record. The select
>> would look something like this...
>> SELECT
>> w.WebsiteName,
>> w.IPAddress,
>> w.Status,
>> c.ClientName,
>> dbo.udfGetFolderSize(w.WebsitePath) as FolderSize -- <-- This is
>> what I am looking for...
>> FROM dbo.Websites w
>> INNER JOIN dbo.Clients c
>> ON c.ID = w.Clients_ID
>> ORDER BY w.WebsiteName, C.ClientName
>>
>