Showing posts with label size. Show all posts
Showing posts with label size. Show all posts

Tuesday, March 20, 2012

Could you tell me the VB code to check the file size in a folder and mail to xyz@abc.com automat

Dear all,

Could you tell me which code of vb scrip that i can check file size as follow ?

Dim FSO, Fyl
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Fyl = CreateObject("File")

If FSO.FileExists("C:\temp\lcbseg.log") Then
Set Fyl = FSO.GetFile("C:\temp\lcbseg.log")
If Fyl.Size > 0 Then
Main = DTSStepScriptResult_ExecuteTask
Else
Main = DTSStepScriptResult_DontExecuteTask
End If
End if

Thanks

Best regards,

Kusuma

You need to do this in two stages, since there is no workflow script anymore.

Here is a sample for nthe Script Task. It uses a variable called FileSize, into which it stores the file size, surpirse!

Public Sub Main()

Dim info As System.IO.FileInfo = New System.IO.FileInfo("C:\File.txt")

Dim variables As New Variables

Dts.VariableDispenser.LockOneForWrite("FileSize", variables)

variables(0).Value = info.Length

variables.Unlock()

Dts.TaskResult = Dts.Results.Success

End Sub

Now you would use a precedenc constraint from the sript task to the next task, but be sure to include an expression. Double-click to get the UI, and try and expression like this-

@.[Use::FileSize] > 0

|||

I've tried to follow your code DarrenSQLIS, but it has the error "FileSize" for read/write access with error 0xC0010001 "The variable cannot be found. how can i fix this problem?

So i've some questions where can i declare FileSize variable. It's on SSIS menu=> varible,isn't it? and what's type of FileSize variable. For next what's property of expresstion to use @.[Use::FileSize] > 0.

Many thanks.

Best Regards,

Kusuma

|||I know you asked how do check for a file size equal to non zero in a script task, which can certainly be done with a script task as Darren illustrates.

Another technique for checking file existence and size simultaneously is use of "WMI Data Reader Task" with WQL. Use of the WMI data reader task will require a WMI connection manager, which is quick simple to configure, and available through the task's UI.

For example, the following WQL query checks for the existence and size of c:\boot.ini. simultaneously.

Select FileSize From CIM_Datafile Where Name = 'C:\\boot.ini'

After the WMI task, a downstream task can constrained by the following expression, which evaluates to true only for an existent, non zero byte file.

@.FileLength > "0\r\n"

NOTE, in this case, @.FileLength is a string variable, unlike the script task case. The reason the variable for file size is a string rather than a uint64 is that the WMI Data Reader task writes string and/or object variable types. The backslash is a special character to WMI, and as such is doubled up (escaped) in the WQL query.
|||

KUS wrote:

Dear all,

Could you tell me which code of vb scrip that i can check file size as follow ?

Dim FSO, Fyl
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Fyl = CreateObject("File")

If FSO.FileExists("C:\temp\lcbseg.log") Then
Set Fyl = FSO.GetFile("C:\temp\lcbseg.log")
If Fyl.Size > 0 Then
Main = DTSStepScriptResult_ExecuteTask
Else
Main = DTSStepScriptResult_DontExecuteTask
End If
End if

Thanks

Best regards,

Kusuma

|||Hey hi . Could you tell me a VB code so that I can check a file size in a folder and mail to abc@.xyz.com if the file size is less than 10MB?|||First of all read the code above, it shows you how to get the file size into a variable. Then use an SMTP Send Mail Task to send the mail. To restrict the email to only files < 10MB, add an expression on the precendence constraint between the Script Task and Mail Task, @.Var < 10000sql

Could not set working set size to 1168512 KB

hello,
We're running W2000 sp4 fr/ SQL 2000 SP3 fr and get error 17122 in the
application event log every time SQL is brought up. The error text
reads
"initdata: Warning: Could not set working set size to 1168512 KB".
What does
this really mean, is it harmful and how can I correct it? Thanks for
any info.
Thanks
A.S
Hi,
Not a real problem, this is only a warning due to incompatibility with
PAE/AWE !
Just disable the "reserve physical memory for SQLServer" by :
sp_configure 'set working set size',0
go
reconfigure with override
go
See http://support.microsoft.com/kb/822164/en-us
Guillaume.
"Zizou-Real" wrote:

> hello,
> We're running W2000 sp4 fr/ SQL 2000 SP3 fr and get error 17122 in the
> application event log every time SQL is brought up. The error text
> reads
> "initdata: Warning: Could not set working set size to 1168512 KB".
> What does
> this really mean, is it harmful and how can I correct it? Thanks for
> any info.
>
> Thank’s
> A.S
>
>
sql

Sunday, February 19, 2012

Could not allocate space because the 'DEFAULT' filegroup is full.

We are getting the error below when trying to attach a MS SQL 2005 Express
Database with a size of around 2GB.
The database had some issues before we detached the database and now we can
not attach.
There are a number of other databases in the primary filegroup but they are
all very small i.e. no more than 100Mb total in size.
Is this a configuration issue of some sort or a database corruption issue.
==================
TITLE: Microsoft SQL Server Management Studio Express
Attach database failed for Server 'ONLINE-INT'.
(Microsoft.SqlServer.Express.Smo)
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.Express.ConnectionInfo)
Could not allocate space for object 'events' in database 'port' because the
'DEFAULT' filegroup is full.
Error while undoing logged operation in database 'port'. Error at log record
ID (11807:19741:34).
Could not open new database 'port'. CREATE DATABASE is aborted.
1 transactions rolled forward in database 'port' (10). (Microsoft SQL
Server, Error: 1105)
PSernz
Hi
Do you have free space on the filesystem ?
"PSernz" <PSernz@.discussions.microsoft.com> wrote in message
news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
> We are getting the error below when trying to attach a MS SQL 2005 Express
> Database with a size of around 2GB.
> The database had some issues before we detached the database and now we
> can
> not attach.
> There are a number of other databases in the primary filegroup but they
> are
> all very small i.e. no more than 100Mb total in size.
> Is this a configuration issue of some sort or a database corruption issue.
>
> ==================
> TITLE: Microsoft SQL Server Management Studio Express
> --
> Attach database failed for Server 'ONLINE-INT'.
> (Microsoft.SqlServer.Express.Smo)
> --
> ADDITIONAL INFORMATION:
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.Express.ConnectionInfo)
> --
> Could not allocate space for object 'events' in database 'port' because
> the
> 'DEFAULT' filegroup is full.
> Error while undoing logged operation in database 'port'. Error at log
> record
> ID (11807:19741:34).
> Could not open new database 'port'. CREATE DATABASE is aborted.
> 1 transactions rolled forward in database 'port' (10). (Microsoft SQL
> Server, Error: 1105)
>
>
> PSernz
|||Yes I have 5Gb free on the disk that contains all Primary files.
PSernz
"Uri Dimant" wrote:

> Hi
> Do you have free space on the filesystem ?
>
>
> "PSernz" <PSernz@.discussions.microsoft.com> wrote in message
> news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
>
>
|||Hi
Do you have valid BACKUP of the database? Have you tried RESTORE?
"PSernz" <PSernz@.discussions.microsoft.com> wrote in message
news:0F6C0960-F410-46D5-87AE-8890D3163D55@.microsoft.com...[vbcol=seagreen]
> Yes I have 5Gb free on the disk that contains all Primary files.
>
> --
> PSernz
>
> "Uri Dimant" wrote:
|||Unfortunately not and hence we are hopeful that this is a config issue and
not a data integrity issue.
PSernz
"Uri Dimant" wrote:

> Hi
> Do you have valid BACKUP of the database? Have you tried RESTORE?
>
>
> "PSernz" <PSernz@.discussions.microsoft.com> wrote in message
> news:0F6C0960-F410-46D5-87AE-8890D3163D55@.microsoft.com...
>
>

Could not allocate space because the 'DEFAULT' filegroup is full.

We are getting the error below when trying to attach a MS SQL 2005 Express
Database with a size of around 2GB.
The database had some issues before we detached the database and now we can
not attach.
There are a number of other databases in the primary filegroup but they are
all very small i.e. no more than 100Mb total in size.
Is this a configuration issue of some sort or a database corruption issue.
==================
TITLE: Microsoft SQL Server Management Studio Express
--
Attach database failed for Server 'ONLINE-INT'.
(Microsoft.SqlServer.Express.Smo)
--
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.Express.ConnectionInfo)
--
Could not allocate space for object 'events' in database 'port' because the
'DEFAULT' filegroup is full.
Error while undoing logged operation in database 'port'. Error at log record
ID (11807:19741:34).
Could not open new database 'port'. CREATE DATABASE is aborted.
1 transactions rolled forward in database 'port' (10). (Microsoft SQL
Server, Error: 1105)
PSernzHi
Do you have free space on the filesystem ?
"PSernz" <PSernz@.discussions.microsoft.com> wrote in message
news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
> We are getting the error below when trying to attach a MS SQL 2005 Express
> Database with a size of around 2GB.
> The database had some issues before we detached the database and now we
> can
> not attach.
> There are a number of other databases in the primary filegroup but they
> are
> all very small i.e. no more than 100Mb total in size.
> Is this a configuration issue of some sort or a database corruption issue.
>
> ==================> TITLE: Microsoft SQL Server Management Studio Express
> --
> Attach database failed for Server 'ONLINE-INT'.
> (Microsoft.SqlServer.Express.Smo)
> --
> ADDITIONAL INFORMATION:
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.Express.ConnectionInfo)
> --
> Could not allocate space for object 'events' in database 'port' because
> the
> 'DEFAULT' filegroup is full.
> Error while undoing logged operation in database 'port'. Error at log
> record
> ID (11807:19741:34).
> Could not open new database 'port'. CREATE DATABASE is aborted.
> 1 transactions rolled forward in database 'port' (10). (Microsoft SQL
> Server, Error: 1105)
>
>
> PSernz|||Yes I have 5Gb free on the disk that contains all Primary files.
PSernz
"Uri Dimant" wrote:
> Hi
> Do you have free space on the filesystem ?
>
>
> "PSernz" <PSernz@.discussions.microsoft.com> wrote in message
> news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
> > We are getting the error below when trying to attach a MS SQL 2005 Express
> > Database with a size of around 2GB.
> >
> > The database had some issues before we detached the database and now we
> > can
> > not attach.
> >
> > There are a number of other databases in the primary filegroup but they
> > are
> > all very small i.e. no more than 100Mb total in size.
> >
> > Is this a configuration issue of some sort or a database corruption issue.
> >
> >
> > ==================> >
> > TITLE: Microsoft SQL Server Management Studio Express
> > --
> >
> > Attach database failed for Server 'ONLINE-INT'.
> > (Microsoft.SqlServer.Express.Smo)
> >
> > --
> > ADDITIONAL INFORMATION:
> >
> > An exception occurred while executing a Transact-SQL statement or batch.
> >
> > (Microsoft.SqlServer.Express.ConnectionInfo)
> >
> > --
> >
> > Could not allocate space for object 'events' in database 'port' because
> > the
> > 'DEFAULT' filegroup is full.
> > Error while undoing logged operation in database 'port'. Error at log
> > record
> > ID (11807:19741:34).
> > Could not open new database 'port'. CREATE DATABASE is aborted.
> > 1 transactions rolled forward in database 'port' (10). (Microsoft SQL
> > Server, Error: 1105)
> >
> >
> >
> >
> > PSernz
>
>|||Hi
Do you have valid BACKUP of the database? Have you tried RESTORE?
"PSernz" <PSernz@.discussions.microsoft.com> wrote in message
news:0F6C0960-F410-46D5-87AE-8890D3163D55@.microsoft.com...
> Yes I have 5Gb free on the disk that contains all Primary files.
>
> --
> PSernz
>
> "Uri Dimant" wrote:
>> Hi
>> Do you have free space on the filesystem ?
>>
>>
>> "PSernz" <PSernz@.discussions.microsoft.com> wrote in message
>> news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
>> > We are getting the error below when trying to attach a MS SQL 2005
>> > Express
>> > Database with a size of around 2GB.
>> >
>> > The database had some issues before we detached the database and now we
>> > can
>> > not attach.
>> >
>> > There are a number of other databases in the primary filegroup but they
>> > are
>> > all very small i.e. no more than 100Mb total in size.
>> >
>> > Is this a configuration issue of some sort or a database corruption
>> > issue.
>> >
>> >
>> > ==================>> >
>> > TITLE: Microsoft SQL Server Management Studio Express
>> > --
>> >
>> > Attach database failed for Server 'ONLINE-INT'.
>> > (Microsoft.SqlServer.Express.Smo)
>> >
>> > --
>> > ADDITIONAL INFORMATION:
>> >
>> > An exception occurred while executing a Transact-SQL statement or
>> > batch.
>> >
>> > (Microsoft.SqlServer.Express.ConnectionInfo)
>> >
>> > --
>> >
>> > Could not allocate space for object 'events' in database 'port' because
>> > the
>> > 'DEFAULT' filegroup is full.
>> > Error while undoing logged operation in database 'port'. Error at log
>> > record
>> > ID (11807:19741:34).
>> > Could not open new database 'port'. CREATE DATABASE is aborted.
>> > 1 transactions rolled forward in database 'port' (10). (Microsoft SQL
>> > Server, Error: 1105)
>> >
>> >
>> >
>> >
>> > PSernz
>>|||Unfortunately not and hence we are hopeful that this is a config issue and
not a data integrity issue.
--
PSernz
"Uri Dimant" wrote:
> Hi
> Do you have valid BACKUP of the database? Have you tried RESTORE?
>
>
> "PSernz" <PSernz@.discussions.microsoft.com> wrote in message
> news:0F6C0960-F410-46D5-87AE-8890D3163D55@.microsoft.com...
> > Yes I have 5Gb free on the disk that contains all Primary files.
> >
> >
> > --
> > PSernz
> >
> >
> > "Uri Dimant" wrote:
> >
> >> Hi
> >> Do you have free space on the filesystem ?
> >>
> >>
> >>
> >>
> >> "PSernz" <PSernz@.discussions.microsoft.com> wrote in message
> >> news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
> >> > We are getting the error below when trying to attach a MS SQL 2005
> >> > Express
> >> > Database with a size of around 2GB.
> >> >
> >> > The database had some issues before we detached the database and now we
> >> > can
> >> > not attach.
> >> >
> >> > There are a number of other databases in the primary filegroup but they
> >> > are
> >> > all very small i.e. no more than 100Mb total in size.
> >> >
> >> > Is this a configuration issue of some sort or a database corruption
> >> > issue.
> >> >
> >> >
> >> > ==================> >> >
> >> > TITLE: Microsoft SQL Server Management Studio Express
> >> > --
> >> >
> >> > Attach database failed for Server 'ONLINE-INT'.
> >> > (Microsoft.SqlServer.Express.Smo)
> >> >
> >> > --
> >> > ADDITIONAL INFORMATION:
> >> >
> >> > An exception occurred while executing a Transact-SQL statement or
> >> > batch.
> >> >
> >> > (Microsoft.SqlServer.Express.ConnectionInfo)
> >> >
> >> > --
> >> >
> >> > Could not allocate space for object 'events' in database 'port' because
> >> > the
> >> > 'DEFAULT' filegroup is full.
> >> > Error while undoing logged operation in database 'port'. Error at log
> >> > record
> >> > ID (11807:19741:34).
> >> > Could not open new database 'port'. CREATE DATABASE is aborted.
> >> > 1 transactions rolled forward in database 'port' (10). (Microsoft SQL
> >> > Server, Error: 1105)
> >> >
> >> >
> >> >
> >> >
> >> > PSernz
> >>
> >>
> >>
>
>

Could not allocate space because the 'DEFAULT' filegroup is full.

We are getting the error below when trying to attach a MS SQL 2005 Express
Database with a size of around 2GB.
The database had some issues before we detached the database and now we can
not attach.
There are a number of other databases in the primary filegroup but they are
all very small i.e. no more than 100Mb total in size.
Is this a configuration issue of some sort or a database corruption issue.
==================
TITLE: Microsoft SQL Server Management Studio Express
--
Attach database failed for Server 'ONLINE-INT'.
(Microsoft.SqlServer.Express.Smo)
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.Express.ConnectionInfo)
Could not allocate space for object 'events' in database 'port' because the
'DEFAULT' filegroup is full.
Error while undoing logged operation in database 'port'. Error at log record
ID (11807:19741:34).
Could not open new database 'port'. CREATE DATABASE is aborted.
1 transactions rolled forward in database 'port' (10). (Microsoft SQL
Server, Error: 1105)
PSernzHi
Do you have free space on the filesystem ?
"PSernz" <PSernz@.discussions.microsoft.com> wrote in message
news:E2EAFD34-01F0-4887-A7D0-134D73EEC501@.microsoft.com...
> We are getting the error below when trying to attach a MS SQL 2005 Express
> Database with a size of around 2GB.
> The database had some issues before we detached the database and now we
> can
> not attach.
> There are a number of other databases in the primary filegroup but they
> are
> all very small i.e. no more than 100Mb total in size.
> Is this a configuration issue of some sort or a database corruption issue.
>
> ==================
> TITLE: Microsoft SQL Server Management Studio Express
> --
> Attach database failed for Server 'ONLINE-INT'.
> (Microsoft.SqlServer.Express.Smo)
> --
> ADDITIONAL INFORMATION:
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.Express.ConnectionInfo)
> --
> Could not allocate space for object 'events' in database 'port' because
> the
> 'DEFAULT' filegroup is full.
> Error while undoing logged operation in database 'port'. Error at log
> record
> ID (11807:19741:34).
> Could not open new database 'port'. CREATE DATABASE is aborted.
> 1 transactions rolled forward in database 'port' (10). (Microsoft SQL
> Server, Error: 1105)
>
>
> PSernz