Showing posts with label written. Show all posts
Showing posts with label written. Show all posts

Monday, March 19, 2012

Connection Manager ignores expressions with script component

I have written a script source component and attached a flat file connection. The connection string of which is defined by an expression.

However when I get the connectionstring from the connection in the script it has the default filename value of flat file not the value of the expression. This is proved by passing in the filename variable, and comparing the 2.

The flat file has an expression on the ConnectionString of @.[User::filename]

Can someone confirm this is a bug.

Is this any help to you: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=295220&SiteID=1

-Jamie

|||Looks like it, needs some clarification though.

Sunday, March 11, 2012

connection from windows mobile 5.0

Hi,
I have written some software for a windows mobile 5.0 device that
connects to a sql server directly and performs various operations
against a database.
Under sql server 2000 and XP, I had no problems doing this using
ActiveSync and/or via wireless tcp connections with a vpn connection
to the desktop.
However, since I switched to MS Vista and SQL Server 2005 (Developers
Edition), I can only connect while using Mobile Device Center
(ActiveSync).
What's confusing to me is that when I am connected wirelessly using a
VPN connection to the Vista machine, I'm on the same subnet as the
desktop/SQL Server. While using ActiveSync (MDC), I'm on a completely
different subnet. SQL Server connections function fine through
ActiveSync, but not over the VPN.
How do I configure SQL Server to allow these wireless/vpn connections?
Is this even a SQL Server setting?
Thanks for any and all help.
Charlie
Ok. I figured it out. My device is not resolving the host name
correctly. I configured the connection string to use the IP address
and it connects fine.
Thanks,
Charlie

connection from windows mobile 5.0

Hi,
I have written some software for a windows mobile 5.0 device that
connects to a sql server directly and performs various operations
against a database.
Under sql server 2000 and XP, I had no problems doing this using
ActiveSync and/or via wireless tcp connections with a vpn connection
to the desktop.
However, since I switched to MS Vista and SQL Server 2005 (Developers
Edition), I can only connect while using Mobile Device Center
(ActiveSync).
What's confusing to me is that when I am connected wirelessly using a
VPN connection to the Vista machine, I'm on the same subnet as the
desktop/SQL Server. While using ActiveSync (MDC), I'm on a completely
different subnet. SQL Server connections function fine through
ActiveSync, but not over the VPN.
How do I configure SQL Server to allow these wireless/vpn connections?
Is this even a SQL Server setting?
Thanks for any and all help.
CharlieOk. I figured it out. My device is not resolving the host name
correctly. I configured the connection string to use the IP address
and it connects fine.
Thanks,
Charlie

Friday, February 24, 2012

connection driver NATURAL

does anybody know where could i find a driver which would be able to connect database with BCK extension (as i know this is database written in natural language) from SQL Server 2000I believe in general .BCK extension will be given to a backup file and check whether this is a backup file or so. If not call originator for further details or try to open in NOTEPAD and see for further information on this file.

As of I know there is no driver in SQL for .BCK extension file to import.

Connection busy with results for another hstmt...

Hi mates,

I am getting this strange error while working on SQL server through JDBC.
I am using a connection-pooling mechanism. Have written my own connection pool. The pool holds a number of connections and has methods for requesting and returning connections from the clients. The issue is - when I get a connection from the pool and execute a select query, it works fine. Then I return the connection to the pool (at the top). On next request for connection, this same connection object is provided. When another select query is fired on this connection, I get an error - "connection is busy with results for another hstmt"... The error occurs at the time of executing the query and not while obtaining the statement object from the connection object.
If I don't use the connection pool and create new connection every time, everything works fine (except the performance!)...
I'll be grateful if anyone can shed some light on this....
Cheers!That's because each connection can only have 1 active (pending results) statement per connection.

It sounds like you are not closing/dropping the statements, or the driver is not. It might be your connection handling code. You might also try a different jdbc driver. Are you using an sql specific driver? It you use the default jdbc-odbc bridge, you can get bad behavior. That driver doen't work well. There are 3 kinds of replacements:

1) Free Jdbc drivers for SQL Server. MS provides one, and there is an open source one out there.

2) A ready for deployment JDBC-ODBC Bridge from a vendor. There are several.

3) A commercial JDBC Driver.

What you need is dependant on your budget, time and architecture.

Jay Grubb
Technical Consultant
OpenLink Software
Web: http://www.openlinksw.com:
Product Weblogs:
Virtuoso: http://www.openlinksw.com/weblogs/virtuoso
UDA: http://www.openlinksw.com/weblogs/uda
Universal Data Access & Virtual Database Technology Providers

Connection Broken when executing select statement

Hi,
I have written a query that gives the following message
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionCheckForD
ata
(CheckforData()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection Broken
I have seen several posts with this problem but none seem to match mine.
here is the query
select distinct
case
when 'ct' = 'CT' then 'CTM'
when 'ct' = 'SD' then 'SDM'
when 'ct' = 'TFVT' then 'VTM'
end, null, 'L', 'AV-A196', 'AV-A196', null, null, Service_Area,
Locality, Location,
Segment_Ref, Vicinity, Map_Ref, Service_Status, Condition_Status,
Charge_Key,
Asset_Owner, Resp_Area, Resp_Position, Data_Changed, null, GIS_Tile,
Note_Text, Asset_Region, Asset_Ranking
from asset
where category = 'ct'
and asset_Id not in (60325, 60377,60274, 60397)
and ((len(local_id) < 6 and local_id = 'AV-A196')
or (len(local_id) >= 6 and substring(local_id, 1, len(local_id)-6) =
'AV-A196'))
I have tested this on a SQL Server 2000 machine by creating a new database,
importing the asset table of 66000 records. Then created new indexes on
Asset_id (clustered primary key)
Local_id (unique index)
Category (index)
If I remove any of the conditions in the where statement it runs fine.
However with them all in their it breaks.
I am running 8.00.859 (sp3)
Any Suggestions
BenBenJamin wrote:
> Hi,
> I have written a query that gives the following message
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionCheckFo
rData
> (CheckforData()).
> Server: Msg 11, Level 16, State 1, Line 0
> General network error. Check your network documentation.
> Connection Broken
> I have seen several posts with this problem but none seem to match
> mine. here is the query
> select distinct
> case
> when 'ct' = 'CT' then 'CTM'
> when 'ct' = 'SD' then 'SDM'
> when 'ct' = 'TFVT' then 'VTM'
> end, null, 'L', 'AV-A196', 'AV-A196', null, null, Service_Area,
> Locality, Location,
> Segment_Ref, Vicinity, Map_Ref, Service_Status, Condition_Status,
> Charge_Key,
> Asset_Owner, Resp_Area, Resp_Position, Data_Changed, null,
> GIS_Tile, Note_Text, Asset_Region, Asset_Ranking
> from asset
> where category = 'ct'
> and asset_Id not in (60325, 60377,60274, 60397)
> and ((len(local_id) < 6 and local_id = 'AV-A196')
> or (len(local_id) >= 6 and substring(local_id, 1, len(local_id)-6) =
> 'AV-A196'))
> I have tested this on a SQL Server 2000 machine by creating a new
> database, importing the asset table of 66000 records. Then created
> new indexes on Asset_id (clustered primary key)
> Local_id (unique index)
> Category (index)
> If I remove any of the conditions in the where statement it runs fine.
> However with them all in their it breaks.
> I am running 8.00.859 (sp3)
> Any Suggestions
> Ben
Maybe I'm reading the SQL statement incorrectly, but how would this
statement ever be true:
(len(local_id) < 6 and local_id = 'AV-A196')
That would seem to imply the lengh of the column must be 5 or less _and_
it must be equal to a 7 character string, at the same time.
Just curious.
David Gugick
Imceda Software
www.imceda.com|||"David Gugick" wrote:

> BenJamin wrote:
> Maybe I'm reading the SQL statement incorrectly, but how would this
> statement ever be true:
> (len(local_id) < 6 and local_id = 'AV-A196')
> That would seem to imply the lengh of the column must be 5 or less _and_
> it must be equal to a 7 character string, at the same time.
> Just curious.
>
> --
> David Gugick
> Imceda Software
> www.imceda.com
>
Fair Call,
That part is just there as a means to stop the statement trying to process
Local_ID's less than 6 characters long with the second part of the condition
statement. It is meant to always be false.
I was gettting incorrect length to the substring function. I tried to get it
to process the conditions in the order that they are written to exclude the
unwanted rows. Maybe there is a way, I don't know.
But thanks for the quick response though...|||Hi
Check your SQL Server log. You may find that your process was terminated at
a server level. If it was, try to go to 8.00.0878 and if that does not solve
it, open a call with PSS.
Regards
Mike
"BenJamin" wrote:

>
> "David Gugick" wrote:
>
> Fair Call,
> That part is just there as a means to stop the statement trying to process
> Local_ID's less than 6 characters long with the second part of the conditi
on
> statement. It is meant to always be false.
> I was gettting incorrect length to the substring function. I tried to get
it
> to process the conditions in the order that they are written to exclude th
e
> unwanted rows. Maybe there is a way, I don't know.
> But thanks for the quick response though...|||Ben
Add option (loop join) in your select statement
"BenJamin" <BenJamin@.discussions.microsoft.com> wrote in message
news:81A67F85-4D1E-4109-8090-6AFFE437DA63@.microsoft.com...
>
> "David Gugick" wrote:
>
> Fair Call,
> That part is just there as a means to stop the statement trying to process
> Local_ID's less than 6 characters long with the second part of the
condition
> statement. It is meant to always be false.
> I was gettting incorrect length to the substring function. I tried to get
it
> to process the conditions in the order that they are written to exclude
the
> unwanted rows. Maybe there is a way, I don't know.
> But thanks for the quick response though...|||Check the traffic on your network, the query maybe
overloading it.
Peter
"A politician needs the ability to foretell what is going
to happen tomorrow, next week, next month, and next year.
And to have the ability afterwards to explain why it
didn't happen."
Winston Churchill

>--Original Message--
>
>"David Gugick" wrote:
>
message[vbcol=seagreen]
ConnectionCheckForData[vbcol=seagreen]
documentation.[vbcol=seagreen]
seem to match[vbcol=seagreen]
null, Service_Area,[vbcol=seagreen]
Condition_Status,[vbcol=seagreen]
Data_Changed, null,[vbcol=seagreen]
(local_id)-6) =[vbcol=seagreen]
creating a new[vbcol=seagreen]
Then created[vbcol=seagreen]
statement it runs fine.[vbcol=seagreen]
how would this[vbcol=seagreen]
be 5 or less _and_[vbcol=seagreen]
time.[vbcol=seagreen]
>Fair Call,
>That part is just there as a means to stop the statement
trying to process
>Local_ID's less than 6 characters long with the second
part of the condition
>statement. It is meant to always be false.
>I was gettting incorrect length to the substring
function. I tried to get it
>to process the conditions in the order that they are
written to exclude the
>unwanted rows. Maybe there is a way, I don't know.
>But thanks for the quick response though...
>.
>

Connection Broken when executing select statement

Hi,
I have written a query that gives the following message
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionCheckForData
(CheckforData()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection Broken
I have seen several posts with this problem but none seem to match mine.
here is the query
select distinct
case
when 'ct' = 'CT' then 'CTM'
when 'ct' = 'SD' then 'SDM'
when 'ct' = 'TFVT' then 'VTM'
end, null, 'L', 'AV-A196', 'AV-A196', null, null, Service_Area,
Locality, Location,
Segment_Ref, Vicinity, Map_Ref, Service_Status, Condition_Status,
Charge_Key,
Asset_Owner, Resp_Area, Resp_Position, Data_Changed, null, GIS_Tile,
Note_Text, Asset_Region, Asset_Ranking
from asset
where category = 'ct'
and asset_Id not in (60325, 60377,60274, 60397)
and ((len(local_id) < 6 and local_id = 'AV-A196')
or (len(local_id) >= 6 and substring(local_id, 1, len(local_id)-6) =
'AV-A196'))
I have tested this on a SQL Server 2000 machine by creating a new database,
importing the asset table of 66000 records. Then created new indexes on
Asset_id (clustered primary key)
Local_id (unique index)
Category (index)
If I remove any of the conditions in the where statement it runs fine.
However with them all in their it breaks.
I am running 8.00.859 (sp3)
Any Suggestions
Ben
BenJamin wrote:
> Hi,
> I have written a query that gives the following message
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionCheckForData
> (CheckforData()).
> Server: Msg 11, Level 16, State 1, Line 0
> General network error. Check your network documentation.
> Connection Broken
> I have seen several posts with this problem but none seem to match
> mine. here is the query
> select distinct
> case
> when 'ct' = 'CT' then 'CTM'
> when 'ct' = 'SD' then 'SDM'
> when 'ct' = 'TFVT' then 'VTM'
> end, null, 'L', 'AV-A196', 'AV-A196', null, null, Service_Area,
> Locality, Location,
> Segment_Ref, Vicinity, Map_Ref, Service_Status, Condition_Status,
> Charge_Key,
> Asset_Owner, Resp_Area, Resp_Position, Data_Changed, null,
> GIS_Tile, Note_Text, Asset_Region, Asset_Ranking
> from asset
> where category = 'ct'
> and asset_Id not in (60325, 60377,60274, 60397)
> and ((len(local_id) < 6 and local_id = 'AV-A196')
> or (len(local_id) >= 6 and substring(local_id, 1, len(local_id)-6) =
> 'AV-A196'))
> I have tested this on a SQL Server 2000 machine by creating a new
> database, importing the asset table of 66000 records. Then created
> new indexes on Asset_id (clustered primary key)
> Local_id (unique index)
> Category (index)
> If I remove any of the conditions in the where statement it runs fine.
> However with them all in their it breaks.
> I am running 8.00.859 (sp3)
> Any Suggestions
> Ben
Maybe I'm reading the SQL statement incorrectly, but how would this
statement ever be true:
(len(local_id) < 6 and local_id = 'AV-A196')
That would seem to imply the lengh of the column must be 5 or less _and_
it must be equal to a 7 character string, at the same time.
Just curious.
David Gugick
Imceda Software
www.imceda.com
|||"David Gugick" wrote:

> BenJamin wrote:
> Maybe I'm reading the SQL statement incorrectly, but how would this
> statement ever be true:
> (len(local_id) < 6 and local_id = 'AV-A196')
> That would seem to imply the lengh of the column must be 5 or less _and_
> it must be equal to a 7 character string, at the same time.
> Just curious.
>
> --
> David Gugick
> Imceda Software
> www.imceda.com
>
Fair Call,
That part is just there as a means to stop the statement trying to process
Local_ID's less than 6 characters long with the second part of the condition
statement. It is meant to always be false.
I was gettting incorrect length to the substring function. I tried to get it
to process the conditions in the order that they are written to exclude the
unwanted rows. Maybe there is a way, I don't know.
But thanks for the quick response though...
|||Hi
Check your SQL Server log. You may find that your process was terminated at
a server level. If it was, try to go to 8.00.0878 and if that does not solve
it, open a call with PSS.
Regards
Mike
"BenJamin" wrote:

>
> "David Gugick" wrote:
> Fair Call,
> That part is just there as a means to stop the statement trying to process
> Local_ID's less than 6 characters long with the second part of the condition
> statement. It is meant to always be false.
> I was gettting incorrect length to the substring function. I tried to get it
> to process the conditions in the order that they are written to exclude the
> unwanted rows. Maybe there is a way, I don't know.
> But thanks for the quick response though...
|||Ben
Add option (loop join) in your select statement
"BenJamin" <BenJamin@.discussions.microsoft.com> wrote in message
news:81A67F85-4D1E-4109-8090-6AFFE437DA63@.microsoft.com...
>
> "David Gugick" wrote:
> Fair Call,
> That part is just there as a means to stop the statement trying to process
> Local_ID's less than 6 characters long with the second part of the
condition
> statement. It is meant to always be false.
> I was gettting incorrect length to the substring function. I tried to get
it
> to process the conditions in the order that they are written to exclude
the
> unwanted rows. Maybe there is a way, I don't know.
> But thanks for the quick response though...
|||Check the traffic on your network, the query maybe
overloading it.
Peter
"A politician needs the ability to foretell what is going
to happen tomorrow, next week, next month, and next year.
And to have the ability afterwards to explain why it
didn't happen."
Winston Churchill
[vbcol=seagreen]
>--Original Message--
>
>"David Gugick" wrote:
message[vbcol=seagreen]
ConnectionCheckForData[vbcol=seagreen]
documentation.[vbcol=seagreen]
seem to match[vbcol=seagreen]
null, Service_Area,[vbcol=seagreen]
Condition_Status,[vbcol=seagreen]
Data_Changed, null,[vbcol=seagreen]
(local_id)-6) =[vbcol=seagreen]
creating a new[vbcol=seagreen]
Then created[vbcol=seagreen]
statement it runs fine.[vbcol=seagreen]
how would this[vbcol=seagreen]
be 5 or less _and_[vbcol=seagreen]
time.
>Fair Call,
>That part is just there as a means to stop the statement
trying to process
>Local_ID's less than 6 characters long with the second
part of the condition
>statement. It is meant to always be false.
>I was gettting incorrect length to the substring
function. I tried to get it
>to process the conditions in the order that they are
written to exclude the
>unwanted rows. Maybe there is a way, I don't know.
>But thanks for the quick response though...
>.
>

Connection Broken when executing select statement

Hi,
I have written a query that gives the following message
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionCheckForData
(CheckforData()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection Broken
I have seen several posts with this problem but none seem to match mine.
here is the query
select distinct
case
when 'ct' = 'CT' then 'CTM'
when 'ct' = 'SD' then 'SDM'
when 'ct' = 'TFVT' then 'VTM'
end, null, 'L', 'AV-A196', 'AV-A196', null, null, Service_Area,
Locality, Location,
Segment_Ref, Vicinity, Map_Ref, Service_Status, Condition_Status,
Charge_Key,
Asset_Owner, Resp_Area, Resp_Position, Data_Changed, null, GIS_Tile,
Note_Text, Asset_Region, Asset_Ranking
from asset
where category = 'ct'
and asset_Id not in (60325, 60377,60274, 60397)
and ((len(local_id) < 6 and local_id = 'AV-A196')
or (len(local_id) >= 6 and substring(local_id, 1, len(local_id)-6) = 'AV-A196'))
I have tested this on a SQL Server 2000 machine by creating a new database,
importing the asset table of 66000 records. Then created new indexes on
Asset_id (clustered primary key)
Local_id (unique index)
Category (index)
If I remove any of the conditions in the where statement it runs fine.
However with them all in their it breaks.
I am running 8.00.859 (sp3)
Any Suggestions
BenBenJamin wrote:
> Hi,
> I have written a query that gives the following message
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionCheckForData
> (CheckforData()).
> Server: Msg 11, Level 16, State 1, Line 0
> General network error. Check your network documentation.
> Connection Broken
> I have seen several posts with this problem but none seem to match
> mine. here is the query
> select distinct
> case
> when 'ct' = 'CT' then 'CTM'
> when 'ct' = 'SD' then 'SDM'
> when 'ct' = 'TFVT' then 'VTM'
> end, null, 'L', 'AV-A196', 'AV-A196', null, null, Service_Area,
> Locality, Location,
> Segment_Ref, Vicinity, Map_Ref, Service_Status, Condition_Status,
> Charge_Key,
> Asset_Owner, Resp_Area, Resp_Position, Data_Changed, null,
> GIS_Tile, Note_Text, Asset_Region, Asset_Ranking
> from asset
> where category = 'ct'
> and asset_Id not in (60325, 60377,60274, 60397)
> and ((len(local_id) < 6 and local_id = 'AV-A196')
> or (len(local_id) >= 6 and substring(local_id, 1, len(local_id)-6) => 'AV-A196'))
> I have tested this on a SQL Server 2000 machine by creating a new
> database, importing the asset table of 66000 records. Then created
> new indexes on Asset_id (clustered primary key)
> Local_id (unique index)
> Category (index)
> If I remove any of the conditions in the where statement it runs fine.
> However with them all in their it breaks.
> I am running 8.00.859 (sp3)
> Any Suggestions
> Ben
Maybe I'm reading the SQL statement incorrectly, but how would this
statement ever be true:
(len(local_id) < 6 and local_id = 'AV-A196')
That would seem to imply the lengh of the column must be 5 or less _and_
it must be equal to a 7 character string, at the same time.
Just curious.
David Gugick
Imceda Software
www.imceda.com|||"David Gugick" wrote:
> BenJamin wrote:
> > Hi,
> >
> > I have written a query that gives the following message
> > [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionCheckForData
> > (CheckforData()).
> > Server: Msg 11, Level 16, State 1, Line 0
> > General network error. Check your network documentation.
> >
> > Connection Broken
> >
> > I have seen several posts with this problem but none seem to match
> > mine. here is the query
> > select distinct
> > case
> > when 'ct' = 'CT' then 'CTM'
> > when 'ct' = 'SD' then 'SDM'
> > when 'ct' = 'TFVT' then 'VTM'
> > end, null, 'L', 'AV-A196', 'AV-A196', null, null, Service_Area,
> > Locality, Location,
> > Segment_Ref, Vicinity, Map_Ref, Service_Status, Condition_Status,
> > Charge_Key,
> > Asset_Owner, Resp_Area, Resp_Position, Data_Changed, null,
> > GIS_Tile, Note_Text, Asset_Region, Asset_Ranking
> > from asset
> > where category = 'ct'
> > and asset_Id not in (60325, 60377,60274, 60397)
> > and ((len(local_id) < 6 and local_id = 'AV-A196')
> > or (len(local_id) >= 6 and substring(local_id, 1, len(local_id)-6) => > 'AV-A196'))
> >
> > I have tested this on a SQL Server 2000 machine by creating a new
> > database, importing the asset table of 66000 records. Then created
> > new indexes on Asset_id (clustered primary key)
> > Local_id (unique index)
> > Category (index)
> >
> > If I remove any of the conditions in the where statement it runs fine.
> > However with them all in their it breaks.
> >
> > I am running 8.00.859 (sp3)
> > Any Suggestions
> > Ben
> Maybe I'm reading the SQL statement incorrectly, but how would this
> statement ever be true:
> (len(local_id) < 6 and local_id = 'AV-A196')
> That would seem to imply the lengh of the column must be 5 or less _and_
> it must be equal to a 7 character string, at the same time.
> Just curious.
>
> --
> David Gugick
> Imceda Software
> www.imceda.com
>
Fair Call,
That part is just there as a means to stop the statement trying to process
Local_ID's less than 6 characters long with the second part of the condition
statement. It is meant to always be false.
I was gettting incorrect length to the substring function. I tried to get it
to process the conditions in the order that they are written to exclude the
unwanted rows. Maybe there is a way, I don't know.
But thanks for the quick response though...|||Hi
Check your SQL Server log. You may find that your process was terminated at
a server level. If it was, try to go to 8.00.0878 and if that does not solve
it, open a call with PSS.
Regards
Mike
"BenJamin" wrote:
>
> "David Gugick" wrote:
> > BenJamin wrote:
> > > Hi,
> > >
> > > I have written a query that gives the following message
> > > [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionCheckForData
> > > (CheckforData()).
> > > Server: Msg 11, Level 16, State 1, Line 0
> > > General network error. Check your network documentation.
> > >
> > > Connection Broken
> > >
> > > I have seen several posts with this problem but none seem to match
> > > mine. here is the query
> > > select distinct
> > > case
> > > when 'ct' = 'CT' then 'CTM'
> > > when 'ct' = 'SD' then 'SDM'
> > > when 'ct' = 'TFVT' then 'VTM'
> > > end, null, 'L', 'AV-A196', 'AV-A196', null, null, Service_Area,
> > > Locality, Location,
> > > Segment_Ref, Vicinity, Map_Ref, Service_Status, Condition_Status,
> > > Charge_Key,
> > > Asset_Owner, Resp_Area, Resp_Position, Data_Changed, null,
> > > GIS_Tile, Note_Text, Asset_Region, Asset_Ranking
> > > from asset
> > > where category = 'ct'
> > > and asset_Id not in (60325, 60377,60274, 60397)
> > > and ((len(local_id) < 6 and local_id = 'AV-A196')
> > > or (len(local_id) >= 6 and substring(local_id, 1, len(local_id)-6) => > > 'AV-A196'))
> > >
> > > I have tested this on a SQL Server 2000 machine by creating a new
> > > database, importing the asset table of 66000 records. Then created
> > > new indexes on Asset_id (clustered primary key)
> > > Local_id (unique index)
> > > Category (index)
> > >
> > > If I remove any of the conditions in the where statement it runs fine.
> > > However with them all in their it breaks.
> > >
> > > I am running 8.00.859 (sp3)
> > > Any Suggestions
> > > Ben
> >
> > Maybe I'm reading the SQL statement incorrectly, but how would this
> > statement ever be true:
> >
> > (len(local_id) < 6 and local_id = 'AV-A196')
> >
> > That would seem to imply the lengh of the column must be 5 or less _and_
> > it must be equal to a 7 character string, at the same time.
> >
> > Just curious.
> >
> >
> >
> > --
> > David Gugick
> > Imceda Software
> > www.imceda.com
> >
> >
> Fair Call,
> That part is just there as a means to stop the statement trying to process
> Local_ID's less than 6 characters long with the second part of the condition
> statement. It is meant to always be false.
> I was gettting incorrect length to the substring function. I tried to get it
> to process the conditions in the order that they are written to exclude the
> unwanted rows. Maybe there is a way, I don't know.
> But thanks for the quick response though...|||Ben
Add option (loop join) in your select statement
"BenJamin" <BenJamin@.discussions.microsoft.com> wrote in message
news:81A67F85-4D1E-4109-8090-6AFFE437DA63@.microsoft.com...
>
> "David Gugick" wrote:
> > BenJamin wrote:
> > > Hi,
> > >
> > > I have written a query that gives the following message
> > > [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionCheckForData
> > > (CheckforData()).
> > > Server: Msg 11, Level 16, State 1, Line 0
> > > General network error. Check your network documentation.
> > >
> > > Connection Broken
> > >
> > > I have seen several posts with this problem but none seem to match
> > > mine. here is the query
> > > select distinct
> > > case
> > > when 'ct' = 'CT' then 'CTM'
> > > when 'ct' = 'SD' then 'SDM'
> > > when 'ct' = 'TFVT' then 'VTM'
> > > end, null, 'L', 'AV-A196', 'AV-A196', null, null, Service_Area,
> > > Locality, Location,
> > > Segment_Ref, Vicinity, Map_Ref, Service_Status, Condition_Status,
> > > Charge_Key,
> > > Asset_Owner, Resp_Area, Resp_Position, Data_Changed, null,
> > > GIS_Tile, Note_Text, Asset_Region, Asset_Ranking
> > > from asset
> > > where category = 'ct'
> > > and asset_Id not in (60325, 60377,60274, 60397)
> > > and ((len(local_id) < 6 and local_id = 'AV-A196')
> > > or (len(local_id) >= 6 and substring(local_id, 1, len(local_id)-6) => > > 'AV-A196'))
> > >
> > > I have tested this on a SQL Server 2000 machine by creating a new
> > > database, importing the asset table of 66000 records. Then created
> > > new indexes on Asset_id (clustered primary key)
> > > Local_id (unique index)
> > > Category (index)
> > >
> > > If I remove any of the conditions in the where statement it runs fine.
> > > However with them all in their it breaks.
> > >
> > > I am running 8.00.859 (sp3)
> > > Any Suggestions
> > > Ben
> >
> > Maybe I'm reading the SQL statement incorrectly, but how would this
> > statement ever be true:
> >
> > (len(local_id) < 6 and local_id = 'AV-A196')
> >
> > That would seem to imply the lengh of the column must be 5 or less _and_
> > it must be equal to a 7 character string, at the same time.
> >
> > Just curious.
> >
> >
> >
> > --
> > David Gugick
> > Imceda Software
> > www.imceda.com
> >
> >
> Fair Call,
> That part is just there as a means to stop the statement trying to process
> Local_ID's less than 6 characters long with the second part of the
condition
> statement. It is meant to always be false.
> I was gettting incorrect length to the substring function. I tried to get
it
> to process the conditions in the order that they are written to exclude
the
> unwanted rows. Maybe there is a way, I don't know.
> But thanks for the quick response though...|||Check the traffic on your network, the query maybe
overloading it.
Peter
"A politician needs the ability to foretell what is going
to happen tomorrow, next week, next month, and next year.
And to have the ability afterwards to explain why it
didn't happen."
Winston Churchill
>--Original Message--
>
>"David Gugick" wrote:
>> BenJamin wrote:
>> > Hi,
>> >
>> > I have written a query that gives the following
message
>> > [Microsoft][ODBC SQL Server Driver][DBNETLIB]
ConnectionCheckForData
>> > (CheckforData()).
>> > Server: Msg 11, Level 16, State 1, Line 0
>> > General network error. Check your network
documentation.
>> >
>> > Connection Broken
>> >
>> > I have seen several posts with this problem but none
seem to match
>> > mine. here is the query
>> > select distinct
>> > case
>> > when 'ct' = 'CT' then 'CTM'
>> > when 'ct' = 'SD' then 'SDM'
>> > when 'ct' = 'TFVT' then 'VTM'
>> > end, null, 'L', 'AV-A196', 'AV-A196', null,
null, Service_Area,
>> > Locality, Location,
>> > Segment_Ref, Vicinity, Map_Ref, Service_Status,
Condition_Status,
>> > Charge_Key,
>> > Asset_Owner, Resp_Area, Resp_Position,
Data_Changed, null,
>> > GIS_Tile, Note_Text, Asset_Region, Asset_Ranking
>> > from asset
>> > where category = 'ct'
>> > and asset_Id not in (60325, 60377,60274, 60397)
>> > and ((len(local_id) < 6 and local_id = 'AV-A196')
>> > or (len(local_id) >= 6 and substring(local_id, 1, len
(local_id)-6) =>> > 'AV-A196'))
>> >
>> > I have tested this on a SQL Server 2000 machine by
creating a new
>> > database, importing the asset table of 66000 records.
Then created
>> > new indexes on Asset_id (clustered primary key)
>> > Local_id (unique index)
>> > Category (index)
>> >
>> > If I remove any of the conditions in the where
statement it runs fine.
>> > However with them all in their it breaks.
>> >
>> > I am running 8.00.859 (sp3)
>> > Any Suggestions
>> > Ben
>> Maybe I'm reading the SQL statement incorrectly, but
how would this
>> statement ever be true:
>> (len(local_id) < 6 and local_id = 'AV-A196')
>> That would seem to imply the lengh of the column must
be 5 or less _and_
>> it must be equal to a 7 character string, at the same
time.
>> Just curious.
>>
>> --
>> David Gugick
>> Imceda Software
>> www.imceda.com
>>
>Fair Call,
>That part is just there as a means to stop the statement
trying to process
>Local_ID's less than 6 characters long with the second
part of the condition
>statement. It is meant to always be false.
>I was gettting incorrect length to the substring
function. I tried to get it
>to process the conditions in the order that they are
written to exclude the
>unwanted rows. Maybe there is a way, I don't know.
>But thanks for the quick response though...
>.
>