Groups | Blog | Home
all groups > sql server programming > march 2004 >

sql server programming : Using VBscript to check a file size and then update table.


Sue Hoegemeier
3/10/2004 6:54:05 PM
In the script where you get the file size, you could assign
the file size to a global variable. Then you could use that
global variable in a sql statement or as an input parameter
for a stored procedure. See the following for examples, more
info:
Global Variables and SQL statements in DTS
http://www.sqldts.com/?205

Global Variables and Stored Procedure Parameters
http://www.sqldts.com/?234

-Sue

On Wed, 10 Mar 2004 22:45:23 +0000 (UTC), "Jonesgj"
[quoted text, click to view]
Jonesgj
3/10/2004 10:45:23 PM
Hi,

What I would like to do is use the FileSystemObject to get the size of a
file on my server, and then update a table with its value.

I think I have got the VBscript part sorted out, but I have never used
VBscript in a SQL Server DTS package to update a table. Has anyone got any
examples for me to view...please


Many thanks in advance

JonesG

Jonesgj
3/11/2004 5:26:44 AM
Thanks Sue,

I'll give it a try today and let u know how I get on.

JonesG

[quoted text, click to view]

Uri Dimant
3/11/2004 9:50:53 AM
Jone
I'd go with VB or .NET small project to be done it.

(VB6)

Dim FSys As New FileSystemObject
If FSys.FolderExists("G:\YourPath") = True Then
Set qn = FSys.GetFolder("G:\YourPath")
If qn.Size / 1024 = 0 Then
MsgBox "Empty File"
Else
MsgBox qn.Size / 1024
End If
End If
rs.MoveNext
Note: Modify it for your needs and you can also update the table with a
getting value.


[quoted text, click to view]

AddThis Social Bookmark Button