Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 INSERT Data type image trimmed?

Author  Topic 

StefanK
Starting Member

4 Posts

Posted - 2011-08-04 : 02:15:46
Hi all,

First time poster. Haven't found anything regarding this issue so I hope you can shed some light on my frustration.

I manage ~40 DBs and every database is for a different company, so they all hold employees. However I also run a little Intranet with info on all employees so we have 'master'DB where we bring together all employee data on a daily basis to use on our Intranet.
This cancels the need for large queries with cursors etc etc.

So during the night I run a bunch of jobs to refresh my data in de masterDB.

A table (humres) in database '001' has the following fields:
res_id INT
picture IMAGE

I've created a similar table (humres) in my masterDB (INT & IMAGE data types).

Now, I manually run this query (simplified):

INSERT INTO [masterDB].[dbo].humres
SELECT res_id, picture FROM [001].[dbo].humres


By checking DATALENGTH of both picture fields I see both tables are equal. (I can also see the pictures on my Intranet using the masterDB).
However, whenever I run this query in a job the DATALENGTH of the picture field has been reduced to 1024 !!

I have no clue whatsoever where to look.
I have tried changing the picture field to VARBINARY(MAX) datatype but to no avail.

Has anyone ever seen this before or a clue to tackle this?

Thanks in advance.
   

- Advertisement -