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

Tuesday, March 20, 2012

Can I convert/reference a string to a var?

hey, guys

I got a strange question. :)

In SQL Server,
declare @.Item8 as varchar(100)
declare @.str as varchar(100)
set @.str = '@.Item8'
Is there any way I can reference @.str to @.Item8 ?

Thanks

No. This is not possible. Variables are scoped to batch or module or dynamic SQL batch.

Thursday, March 8, 2012

Can date ranges affect query plans?

Howdy. This seems strange to me, but maybe it is to be expected? I have two
queries that produce the same results.
When I use older date ranges(01/01/04 = 01/31/04), query 1 returns
consistently in 0-1 seconds, and query 2 returns in about 4 seconds.
But then when I use more recnt date ranges(01/01/06 - 01/31/06), I have to
cancel query 1 as it still hasnt completed after 10 minutes, while query 2
returns in about 10 seconds.
How can it be?
TIA, ChrisRWhat do the execution plans for the queries show?
SET SHOWPLAN_TEXT ON
--run your queries
Guess: Query1 will show a full table (or clustered index) scan for the date
range 1/1/06 - 1/31/06.
"ChrisR" wrote:

> Howdy. This seems strange to me, but maybe it is to be expected? I have tw
o
> queries that produce the same results.
> When I use older date ranges(01/01/04 = 01/31/04), query 1 returns
> consistently in 0-1 seconds, and query 2 returns in about 4 seconds.
> But then when I use more recnt date ranges(01/01/06 - 01/31/06), I have to
> cancel query 1 as it still hasnt completed after 10 minutes, while query 2
> returns in about 10 seconds.
> How can it be?
> TIA, ChrisR

Saturday, February 25, 2012

Can anyone Help Me??

Hi gurus,
I have been trying to export my mssql tables into mysql database using DTS. But I get a very strange error for some of my mssql tables which have "text" and "ntext" as field datatypes.The error message that i was gettins is,
"Query based insertion or updating of BLOB values is not supported".
But iam not using any BLOB values in my tables.
So if anyone has any solution for this please let me know.
Thanking you.Are using ODBC to connect the database in ur package?
Try to use SQL Oledb driver.
download latest service pack of SQL Server
download latest MDAC also,if it is not latest.|||I do not think this is going to work. when the error says blob it is talking about the text columns. avoid using text and ntext if at all possible. it usually not really needed. Find the max len of the exisiting data and perhaps change your data type.