Click here to Skip to main content
15,897,273 members
Home / Discussions / Database
   

Database

 
AnswerRe: Log file of Database increases in every replication Pin
Eddy Vluggen19-Sep-09 1:31
professionalEddy Vluggen19-Sep-09 1:31 
GeneralRe: Log file of Database increases in every replication Pin
Abdul Rahman Hamidy19-Sep-09 1:35
Abdul Rahman Hamidy19-Sep-09 1:35 
Question[Message Deleted] Pin
anushh18-Sep-09 7:12
anushh18-Sep-09 7:12 
AnswerRe: Is there any possiblity to name tables in sql server Pin
Luc Pattyn18-Sep-09 7:49
sitebuilderLuc Pattyn18-Sep-09 7:49 
QuestionSSIS Database copying Pin
imnotso#18-Sep-09 2:17
imnotso#18-Sep-09 2:17 
AnswerRe: SSIS Database copying Pin
J4amieC18-Sep-09 3:08
J4amieC18-Sep-09 3:08 
GeneralRe: SSIS Database copying Pin
imnotso#18-Sep-09 3:11
imnotso#18-Sep-09 3:11 
QuestionOdd problem (conversion or openquery?) only appearing in a stored procedure but not when running it adhoc Pin
alex3_1417-Sep-09 23:17
alex3_1417-Sep-09 23:17 
Here's the code I can run with no problems:

declare @AnneeSelectionnee numeric
select @AnneeSelectionnee = 2009
declare @DateDernierImport datetime
select @DateDernierImport =  'Nov 14 2008 12:00AM'

SELECT
    LTRIM(RTRIM(T_ASFSTAG0.STANS1)),
    LTRIM(RTRIM(T_ASFSTAG0.STHFO1)), LTRIM(RTRIM(T_ASFSTAG0.STRSP1))
   FROM T_ASFSTAG0
   WHERE   (T_ASFSTAG0.STANS1=@AnneeSelectionnee) AND
    ((isdate(T_ASFSTAG0.STCRT1)=1 and convert(datetime,convert(varchar,T_ASFSTAG0.STCRT1,103),103)>=convert(datetime,convert(varchar,@DateDernierImport,103),103)) or
    (isdate(T_ASFSTAG0.STMAJ1)=1 and convert(datetime,convert(varchar,T_ASFSTAG0.STMAJ1,103),103)>=convert(datetime,convert(varchar,@DateDernierImport,103),103)))


Please note that T_ASFSTAG0 is a view that is partly defined as follows:

FROM         OPENQUERY(ISERIES_SQLDBF, 'SELECT * FROM tstadvdbf.ASFSTAG0') AS DerivedTable1


And the following is the relevant code from the stored procedure that fails:

print @AnneeSelectionnee--2009
print @DateDernierImport--Nov 14 2008 12:00AM

print '------before the select-----------'
print convert(datetime,convert(varchar,@DateDernierImport,103),103)
print '------right before the select-----------'

 SELECT --line 60--
    LTRIM(RTRIM(T_ASFSTAG0.STANS1)),
    LTRIM(RTRIM(T_ASFSTAG0.STHFO1)), LTRIM(RTRIM(T_ASFSTAG0.STRSP1))
   FROM T_ASFSTAG0
   WHERE   (T_ASFSTAG0.STANS1=@AnneeSelectionnee) AND
    ((isdate(T_ASFSTAG0.STCRT1)=1 and convert(datetime,convert(varchar,T_ASFSTAG0.STCRT1,103),103)>=convert(datetime,convert(varchar,@DateDernierImport,103),103)) or
    (isdate(T_ASFSTAG0.STMAJ1)=1 and convert(datetime,convert(varchar,T_ASFSTAG0.STMAJ1,103),103)>=convert(datetime,convert(varchar,@DateDernierImport,103),103)))

print '------after the select and before the insert-----------'


That select statement (on "line 60") reports an error. We never see the "after the select and before the insert" print message. I thought it might have been a conversion problem but as long as an AND statement works like && does in C# (and, AFAIK, it does) then we should have no problems with the (isdate(x) AND convert(datetime(x)).

This is the error I receive:

Server: Msg 7399, Level 16, State 1, Procedure P_IMPORT_STAGES_PREPA, Line 60
OLE DB provider 'MSDASQL' reported an error. One or more arguments were reported invalid by the provider.
OLE DB error trace [OLE/DB Provider 'MSDASQL' ITransactionJoin::JoinTransaction returned 0x80070057:  One or more arguments were reported invalid by the provider.].


Any help or hints is greatly appreciated.

Alex

AnswerRe: Odd problem (conversion or openquery?) only appearing in a stored procedure but not when running it adhoc Pin
ElectricLlama17-Sep-09 23:38
ElectricLlama17-Sep-09 23:38 
GeneralRe: Odd problem (conversion or openquery?) only appearing in a stored procedure but not when running it adhoc Pin
alex3_1418-Sep-09 0:05
alex3_1418-Sep-09 0:05 
GeneralRe: Odd problem (conversion or openquery?) only appearing in a stored procedure but not when running it adhoc Pin
ElectricLlama18-Sep-09 15:00
ElectricLlama18-Sep-09 15:00 
Questionhow to connect triggerwithout main server Pin
rupal217-Sep-09 21:38
rupal217-Sep-09 21:38 
AnswerRepost Pin
Richard MacCutchan17-Sep-09 23:17
mveRichard MacCutchan17-Sep-09 23:17 
AnswerRe: how to connect triggerwithout main server Pin
Eddy Vluggen17-Sep-09 23:50
professionalEddy Vluggen17-Sep-09 23:50 
Questionhow to connect trigger Pin
rupal217-Sep-09 21:29
rupal217-Sep-09 21:29 
QuestionOracle Query Pin
sandhya1417-Sep-09 19:51
sandhya1417-Sep-09 19:51 
AnswerRe: Oracle Query Pin
sumithz22-Sep-09 1:33
sumithz22-Sep-09 1:33 
QuestionMySql not responding to query [modified] Pin
Jeffrey Webster17-Sep-09 15:06
Jeffrey Webster17-Sep-09 15:06 
AnswerRe: MySql not responding to query [modified] Pin
Luc Pattyn17-Sep-09 15:56
sitebuilderLuc Pattyn17-Sep-09 15:56 
NewsGet trained, get free copy of SQL Server 2008 Standard Pin
brucedkyle17-Sep-09 9:00
brucedkyle17-Sep-09 9:00 
GeneralRe: Get trained, get free copy of SQL Server 2008 Standard Pin
εїзεїзεїз17-Sep-09 13:13
εїзεїзεїз17-Sep-09 13:13 
QuestionMultiple queries being requested on for same table Pin
Vishnu Nath17-Sep-09 4:53
Vishnu Nath17-Sep-09 4:53 
AnswerRe: Multiple queries being requested on for same table Pin
David Mujica17-Sep-09 5:14
David Mujica17-Sep-09 5:14 
AnswerRe: Multiple queries being requested on for same table Pin
Ashfield17-Sep-09 9:15
Ashfield17-Sep-09 9:15 
GeneralRe: Multiple queries being requested on for same table Pin
Vishnu Nath18-Sep-09 21:05
Vishnu Nath18-Sep-09 21:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.