SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS Error Conversion Datatype Variable


SSIS Error Conversion Datatype Variable

Author
Message
Lidou123
Lidou123
SSC-Enthusiastic
SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)

Group: General Forum Members
Points: 133 Visits: 380
Hi All,

I need your help. i wann be crazy !! Smile

Sql server 2008R2

I Have a variable that I converted into float to put it in a ssis variable ( datatype double)

Then I use this variable in a 'Command Sql from a variable'

But I have this error:

[PrepaPaie gains Serveurs [1]] Erreur : « Code d'erreur SSIS DTS_E_OLEDBERROR. Une erreur OLE DB s'est produite. Code d'erreur : 0x80040E07.
Un enregistrement OLE DB est disponible. Source : « Microsoft SQL Server Native Client 10.0 » Hresult : 0x80040E07 Description : « Erreur de conversion du type de données varchar en numeric. ».
 »


This is the script of the 'Command SQl from a variable':


"


DECLARE @START_DATE INT
DECLARE @END_DATE INT
DECLARE @CoefCoutHoraire decimal

SET @START_DATE = '"+ (DT_STR, 6, 1252) @[User:BigGrinateDebutChargement] +"'
SET @END_DATE =' "+ (DT_STR, 6,1252) @[User:BigGrinateFinChargement]+ "'
SET @CoefCoutHoraire = '"+ (DT_STR, 4, 1252) @[User::CoefCoutHoraire] +"'


set datefirst 1;

--- Calcul Gain serveurs

select YEAR (DATEADD(day, 1, DATEADD(DAY, -datepart(dw, data.Date), data.Date)))as ANNEE,
DATEPART (ISO_WEEK,data.Date)as SEMAINE,
data.Id as ID_ETAB, data.IdPers, data.Matricule, (sum(Gains_Midi+Gains_Soir) * @CoefCoutHoraire) as Gains
from
(select P.IdPers, P.Matricule, G.IdServeur, G.EtablissementId, E.Id, G.date,
sum(case when G.Service='MIDI' then G.Remise else 0 end) as Gains_Midi,
sum(case when G.Service='SOIR' then G.Remise else 0 end) as Gains_Soir
from GainsServeurs G, Personnel P, Etablissement E
where G.Date
between
DATEADD(day, 1, DATEADD(DAY, -datepart(dw, G.Date), G.Date))
and
DATEADD (day,7, DATEADD(DAY, -datepart(dw, G.Date), G.Date))
and G.IdPers = P.IdPers
and G.EtablissementId = P.EtablissementId
and E.Id = P.EtablissementId
and P.Tombstone is null

group by P.IdPers, P.Matricule, G.EtablissementId, E.ID, G.Remise, G.Date, G.IdPers,
G.CA, G.Couverts, G.IdServeur, G.EtablissementId
) as data
where 100* YEAR (data.date) + datepart(iso_week, data.date) between @start_date and @end_date
group by data.IdPers, data.Matricule, data.Id,
YEAR (DATEADD(day, 1, DATEADD(DAY, -datepart(dw, data.Date), data.Date))),
DATEPART (ISO_WEEK,data.Date)
order by data.Id, data.Matricule

"
Lidou123
Lidou123
SSC-Enthusiastic
SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)

Group: General Forum Members
Points: 133 Visits: 380
????
Orlando Colamatteo
Orlando Colamatteo
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15009 Visits: 14396
You have a data type error occurring in the database when you run your query. What does your expression evaluate to at runtime? If you can capture that you can try running the SQL against the server and see the exact problem. Post the SQL if you have issues determining the cause and would like some assistance.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search