Showing posts with label contain. Show all posts
Showing posts with label contain. Show all posts

Thursday, March 8, 2012

"large value" data type(bcp)

I want to store some binary things(pic and so on), so I create a table which contain a a "varbinary" data-type column.

but 1. I used OPENROWSET to insert the large file in this table. 2. I used master..xp_cmdshell to retrieve data out as a file. One strange thing happened: the size of the input and output is really different(output is 1k bigger than the input file).

and it seems that the file is broken with different file format......

I really don't know why....

Any help would be appriciated.....

kavin

Could you please post a simple repro script? What command or utility are you using with xp_cmdshell to create the file? Is it BCP or OSQL with SELECT or BCP with queryout option and so on?|||

yes, sure.

EXEC master..xp_cmdshell 'bcp " SELECT column1 FROM Products where id =1111111117 " queryout fileName -n -U sa -P -S yourserver.

Is it any problem?

Anyway, thanks.

BR,

kavin

|||and when I compare the two files, I found that it just the 8-bytes at the beginning of file are extra filled. So I'm afraid something wrong with the created file?

Thursday, February 9, 2012

#DELETED displayed in all cells

I have a SQL 2000 database and I'm using Access 2003 to gain access to the
tables. All cells contain #Deleted.
What am I doing wrong?
TIA
Jon
Jon Paskett wrote:
> I have a SQL 2000 database and I'm using Access 2003 to gain access to the
> tables. All cells contain #Deleted.
> What am I doing wrong?
> TIA
> Jon
>
Does it show fine when you use Access 2000 with the database?
Anyway, most probably you have problems with primary keys - i had it couple times when i was using a
table from ODBC connection and primary key was set to the column of UNIQUEIDENTIFIER mssql type.
When i added an INT index column and set it as a primary key, everything works fine!
Also try to link those access 2000 table to a blank database created in Access 2003.
Let me know how it works!
Also if you post what columns (types) do you have in the table, i can have a look.
WYGL,
Andrey

#DELETED displayed in all cells

I have a SQL 2000 database and I'm using Access 2003 to gain access to the
tables. All cells contain #Deleted.
What am I doing wrong?
TIA
Jon
Jon Paskett wrote:
> I have a SQL 2000 database and I'm using Access 2003 to gain access to the
> tables. All cells contain #Deleted.
> What am I doing wrong?
> TIA
> Jon
>
Does it show fine when you use Access 2000 with the database?
Anyway, most probably you have problems with primary keys - i had it couple times when i was using a
table from ODBC connection and primary key was set to the column of UNIQUEIDENTIFIER mssql type.
When i added an INT index column and set it as a primary key, everything works fine!
Also try to link those access 2000 table to a blank database created in Access 2003.
Let me know how it works!
Also if you post what columns (types) do you have in the table, i can have a look.
WYGL,
Andrey