Showing posts with label strange. Show all posts
Showing posts with label strange. Show all posts

Sunday, March 25, 2012

Case sensitive query? Problems with Integration Services Query

Hi,
i am writing a IntegrationServices2005 job which copies the result of a
view to a table.
I found a very strange problem:
select * from [dbo].[warehouse_aufwandurlaub] -> runs in < 1 second.
select * from [dbo].[warehouse_AufwandUrlaub] -> runs in > 30 Second
s
(timeout).
the name of the view is "warehouse_AufwandUrlaub".
If i run the query in query analyzer, both querys exectute very fast.
What is causing this failure? how can i avoid this?
Thx
Best regards,
Patrick DingerSorry i forgot to mention, that i am using SQL Server 2005 with SP1.
Thx in advance,
Patrick Dinger|||Any activites on the server at this time?
Don't you really need WHERE condition?
"Patrick Dinger" <paxos2k@.gmail.com> wrote in message
news:1147690976.451955.271160@.j55g2000cwa.googlegroups.com...
> Sorry i forgot to mention, that i am using SQL Server 2005 with SP1.
> Thx in advance,
> Patrick Dinger
>|||Hi,
its not an ressource problem, there isn't really activity on the server
currently.
the error is reproducible. No, i do not need a where condition...
Best regards,
Patrick Dinger

Case sensitive query? Problems with Integration Services Query

Hi,
i am writing a IntegrationServices2005 job which copies the result of a
view to a table.
I found a very strange problem:
select * from [dbo].[warehouse_aufwandurlaub] -> runs in < 1 second.
select * from [dbo].[warehouse_AufwandUrlaub] -> runs in > 30 Seconds
(timeout).
the name of the view is "warehouse_AufwandUrlaub".
If i run the query in query analyzer, both querys exectute very fast.
What is causing this failure? how can i avoid this?
Thx
Best regards,
Patrick DingerSorry i forgot to mention, that i am using SQL Server 2005 with SP1.
Thx in advance,
Patrick Dinger|||Any activites on the server at this time?
Don't you really need WHERE condition?
"Patrick Dinger" <paxos2k@.gmail.com> wrote in message
news:1147690976.451955.271160@.j55g2000cwa.googlegroups.com...
> Sorry i forgot to mention, that i am using SQL Server 2005 with SP1.
> Thx in advance,
> Patrick Dinger
>|||Hi,
its not an ressource problem, there isn't really activity on the server
currently.
the error is reproducible. No, i do not need a where condition...
Best regards,
Patrick Dinger

Sunday, February 12, 2012

Can't use parameter with DateAdd Function?

Hi, I encountered a strange error today. I have an Integer parameter "hours" that I am trying to use in my SQL Query.

DATEADD(hh, @.hours, @.startTime)

It works if I have it set such as DATEADD(hh, 8, @.startTime), but I need that parameter there for what I need.

I get this error:

Error Source: System.Data
Error Message: Failed to convert parameter value from Decimal to DateTime. I tried a variety of CInt and other conversion functions to no avail.

Any ideas?

Hello,

Try this:

=DateAdd("h", CDbl(@.hours), @.startTime)

Hope this helps.

Jarret

|||Just tried using this with no luck in the following expression. My goal is to use this with a report parameter that sets the value of @.period to 1, 7, 30, 90, or 365.

SELECT *
FROM dbo.v_call
WHERE (dbo.v_call.entry_date >= DATEADD(d, CDbl(@.period), GETDATE()))

When running the query I get the following error; string was not recognized as a valid date time.

I try changing my query to

SELECT *
FROM dbo.v_call
WHERE (dbo.v_call.entry_date >= DATEADD(d, @.period, GETDATE()))

and get this error:

Failed to convert parameter value from decimal to a datetime.
|||

Try using:

Code Snippet

="SELECT * FROM dbo.v_call

WHERE (dbo.v_call.entry_date >= DATEADD(d," &

CSTR(@.period) &

", GETDATE())) "

>L<

|||

For what it is worth, I have used the following with no problems

@.Trend is an integer parameter of 30, 90, 180, 365 or 720.

Code Snippet

authopen_idx >= dateadd(d,@.Trend*-1, getdate())