Showing posts with label columns. Show all posts
Showing posts with label columns. Show all posts

Friday, February 24, 2012

Error in bcp of trace file

Hi, i've created a trace file which shows columns EventClass, TextData, SPID
and ServerName.
I can save this to a sql table by using profiler, save as, trace table optio
n.
If however i try and create a bcp process to do this automatically, it keeps
on failing with:
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Unexpected EOF encountered in BCP
data-file
I create the table with the same definitions as the profiler has created
them ie
CREATE TABLE [dbo].[test] (
[RowNumber] [int] NULL ,
[EventClass] [int] NULL ,
[TextData] [ntext] NULL ,
[SPID] [int] NULL ,
[ServerName] [nvarchar] (128) NULL
) ON [PRIMARY]
GO
execute master.dbo.xp_cmdshell 'bcp db1.dbo.test in c:\temp\test.trc -Usa -P
-S -c'
Any suggestions?Use function fn_trace_gettable to accomplish what you want.
Example:
select * from ::fn_trace_gettable('c:\temp\test.trc', default)
go
AMB
"billu" wrote:

> Hi, i've created a trace file which shows columns EventClass, TextData, SP
ID
> and ServerName.
> I can save this to a sql table by using profiler, save as, trace table opt
ion.
> If however i try and create a bcp process to do this automatically, it kee
ps
> on failing with:
> SQLState = S1000, NativeError = 0
> Error = [Microsoft][ODBC SQL Server Driver]Unexpected EOF encountered in BCP
> data-file
> I create the table with the same definitions as the profiler has created
> them ie
> CREATE TABLE [dbo].[test] (
> [RowNumber] [int] NULL ,
> [EventClass] [int] NULL ,
> [TextData] [ntext] NULL ,
> [SPID] [int] NULL ,
> [ServerName] [nvarchar] (128) NULL
> ) ON [PRIMARY]
> GO
> execute master.dbo.xp_cmdshell 'bcp db1.dbo.test in c:\temp\test.trc -Usa
-P
> -S -c'
> Any suggestions?

Friday, February 17, 2012

Error Importing CVS into SQL Server 2005 using SQLBulkCopy and c#

Hi,
I'm using SQLBulkCopy via c#, I'm importing a large text file into a
destination SQL Table, the file contains multiple columns and is about 100k
records, I am getting the following error:
'Could not allocate space for object 'dbo.list0001'.PK_List001Table' in
database 'E3232323\43343434_\34343\MyDatabase.mdf because the 'PRIMARY'
filegroup is full. Create disk space be deleting unneeded files, dropping
objects in the filegroup, adding additional files to the filegroup, or
setting autogrowth on the existing files in the filegroup.
Can someone please tell me how to resolve this?
Thanks
Hi Rob
"Rob Dob" wrote:

> Hi,
>
> I'm using SQLBulkCopy via c#, I'm importing a large text file into a
> destination SQL Table, the file contains multiple columns and is about 100k
> records, I am getting the following error:
>
> 'Could not allocate space for object 'dbo.list0001'.PK_List001Table' in
> database 'E3232323\43343434_\34343\MyDatabase.mdf because the 'PRIMARY'
> filegroup is full. Create disk space be deleting unneeded files, dropping
> objects in the filegroup, adding additional files to the filegroup, or
> setting autogrowth on the existing files in the filegroup.
>
> Can someone please tell me how to resolve this?
> Thanks
The error message is probably correct! You have either a fixed file size for
the database file, or there is not enough disc space for the file to grow by
the expected value. This may be because you have a percentage growth set and
it is therefore trying to expand by an enormous amount or you just don't have
enough space available.
John

Error Importing CVS into SQL Server 2005 using SQLBulkCopy and c#

Hi,
I'm using SQLBulkCopy via c#, I'm importing a large text file into a
destination SQL Table, the file contains multiple columns and is about 100k
records, I am getting the following error:
'Could not allocate space for object 'dbo.list0001'.PK_List001Table' in
database 'E3232323\43343434_\34343\MyDatabase.mdf because the 'PRIMARY'
filegroup is full. Create disk space be deleting unneeded files, dropping
objects in the filegroup, adding additional files to the filegroup, or
setting autogrowth on the existing files in the filegroup.
Can someone please tell me how to resolve this?
ThanksHi Rob
"Rob Dob" wrote:
> Hi,
>
> I'm using SQLBulkCopy via c#, I'm importing a large text file into a
> destination SQL Table, the file contains multiple columns and is about 100k
> records, I am getting the following error:
>
> 'Could not allocate space for object 'dbo.list0001'.PK_List001Table' in
> database 'E3232323\43343434_\34343\MyDatabase.mdf because the 'PRIMARY'
> filegroup is full. Create disk space be deleting unneeded files, dropping
> objects in the filegroup, adding additional files to the filegroup, or
> setting autogrowth on the existing files in the filegroup.
>
> Can someone please tell me how to resolve this?
> Thanks
The error message is probably correct! You have either a fixed file size for
the database file, or there is not enough disc space for the file to grow by
the expected value. This may be because you have a percentage growth set and
it is therefore trying to expand by an enormous amount or you just don't have
enough space available.
John

Error Importing CVS into SQL Server 2005 using SQLBulkCopy and c#

Hi,
I'm using SQLBulkCopy via c#, I'm importing a large text file into a
destination SQL Table, the file contains multiple columns and is about 100k
records, I am getting the following error:
'Could not allocate space for object 'dbo.list0001'.PK_List001Table' in
database 'E3232323\43343434_\34343\MyDatabase.mdf because the 'PRIMARY'
filegroup is full. Create disk space be deleting unneeded files, dropping
objects in the filegroup, adding additional files to the filegroup, or
setting autogrowth on the existing files in the filegroup.
Can someone please tell me how to resolve this?
ThanksHi Rob
"Rob Dob" wrote:

> Hi,
>
> I'm using SQLBulkCopy via c#, I'm importing a large text file into a
> destination SQL Table, the file contains multiple columns and is about 100
k
> records, I am getting the following error:
>
> 'Could not allocate space for object 'dbo.list0001'.PK_List001Table' in
> database 'E3232323\43343434_\34343\MyDatabase.mdf because the 'PRIMARY'
> filegroup is full. Create disk space be deleting unneeded files, dropping
> objects in the filegroup, adding additional files to the filegroup, or
> setting autogrowth on the existing files in the filegroup.
>
> Can someone please tell me how to resolve this?
> Thanks
The error message is probably correct! You have either a fixed file size for
the database file, or there is not enough disc space for the file to grow by
the expected value. This may be because you have a percentage growth set and
it is therefore trying to expand by an enormous amount or you just don't hav
e
enough space available.
John