Openquery Erro Help

Feb 5, 2003

Hi,
I need your help to solve this error.
I am running the open query against Oracle server and this shows blow.


UPDATE Lp.dbo.CB
SET oldest_invoice_date = x.oldest_invoice_date
FROM ( SELECT MIN(INVOICE_DATE) as oldest_invoice_date,
I.ACCOUNT_NUM
FROM CDWD..CDW.INVOICE I
WHERE I.INVOICE_NUM >= 0
AND INVOICE_DATE IS NOT NULL
GROUP BY (I.ACCOUNT_NUM)
)x
WHERE account_num = x.ACCOUNT_NUM

I am getting the below error

Server: Msg 207, Level 16, State 3, Line 1
Invalid column name 'oldest_invoice_date'.


Anybody give solution what I am doing wrong?.
Thanks,
Ravi

View 3 Replies


ADVERTISEMENT

DTSRun Erro

Jan 9, 2001

Hi everyone,

I am using SQL Server 2000 and I get this error.

I get the following error when I attempt to run DTSRun from the command prompt:


C:>DTSRun /S (local) /U sa /N "ACPAY_New" /R "ThedaCare1"
DTSRun: Loading...

Error: -2147217355 (80041035); Provider Error: 0 (0)
Error string: General error -2147217355 (80041035).
Error source: Microsoft Data Transformation Services (DTS) Package
Help file: sqldts80.hlp
Help context: 705

This error makes no sense to me. I also get the following message too

C:>DTSRun /S local /U rrojas /N ACPAY_New /R ThedaCare1
DTSRun: Loading...

Error: -2147217390 (80041012); Provider Error: 0 (0)
Error string: [Microsoft][ODBC SQL Server
Driver][DBNETLIB]ConnectionOpen (Connect()).
Error source:
Help file:
Help context: 0



What I have done is created a package called ACPAY_New and saved the package
in two places, the SQL Server and the Meta Data Services (Repository). The
name of the Database is ThedaCare1, the name of the server itself is local or rrojas, the user name is rrojas. I have no idea as to what this error message
means. If I run the job in SQL Server Agent, the job does not run at all.

If I run the package on it's own within Data Transformation Services, by
right clicking and execute it runs fine.

Please help.

Thanks,

Rey

View 1 Replies View Related

Erro Trapping Question

Jul 20, 2005

I have a batch file that runs SQL Server scripts using commands like:OSQL -Umyname -Pmypassword -iScript_01.sql -w200 -e -n[color=blue][color=green]>>Consolidation.log[/color][/color]Script_01.sql will contain statements like:Update SASI.AACT set schoolnum='071' where schoolnum in ('000',' ')update SASI.AATD set schoolnum='071' where schoolnum in ('000',' ')update SASI.AATP set schoolnum='071' where schoolnum in ('000',' ')update SASI.ACHS set schoolnum='071' where schoolnum in ('000',' ')update SASI.ACLS set schoolnum='071' where schoolnum in ('000',' ')If one of those tables should not exist, how could I have it continue,but hopefully the log would have a reference to the error?I am experimenting, but I am unsuccessfull with something like:BEGIN TRANselect count(*) from sasi.aact --this could be an updatestatementif @@ERROR =208 GOTO err_handleselect count(*) from sasi.astuif @@ERROR <> 0 GOTO err_handleselect count(*) from sasi.astuif @@ERROR <> 0 GOTO err_handleselect count(*) from sasi.astuif @@ERROR <> 0 GOTO err_handleerr_handle:returncommit Tran

View 1 Replies View Related

Erro Whit J# - Urgent

Dec 14, 2005

Hi...Urgent...

View 3 Replies View Related

Erro: The Specified @job_name ('my_job') Does Not Exist.

Dec 5, 2007

I'm running this statment from a sql 2005 server against a sql 2000 server:

exec my_linked_server.msdb..sp_start_job @job_name = 'my_job'


If "my_linked_server" is e sql server 2005 it works fine.
If "my_linked_server" is a sql server 2000 I get this message:
Msg 14262, Level 16, State 1, Procedure sp_verify_job_identifiers, Line 61

The specified @job_name ('cmdb_get_infos') does not exist.


Has anyone an idee?
What's wrong?

Thanks
Laurent

View 11 Replies View Related

Service Broker Erro But Everything Working

Feb 27, 2007

Hi

I have been running service broker between 3 initaitors and a single target witha forwarder for some time.

Everything works 100%, i use persistent conversation and all queues and transmission_queues are clear. Everything works 100%.

However while running profiler on the forwarder i see the following errors every now and again. Actually every time a message succesfully gets to central i see this error:

On the forwarder: Broker Connection: EventSubClass 4 - Closing :

An error occurred while receiving data: '64(The specified network name is no longer available.)'.

Database ID 1 : master:

ObjectName : tcp:11.45.101.100 - this is the target

i sometimes see the exact same error with a initiator IP.

I am very confused becuase everything is working 100%, queues and transmission queues are all clear.

Why do i see this error ?

Thanx





View 9 Replies View Related

Redirect Erro Rows Using Script Task

May 8, 2008



Hi



I am actually using a Script task to parse and load an XML file into multiple tables, however I want to add to this so that in case of a failed record I want to redirect it to a log table using Script Task, can anyone provide me with a good link or approach to do this.



Thanks

View 6 Replies View Related

Sql Server Does Not Exitst Or Access Denied,erro:10061

Apr 18, 2008

hi all,
I have installed sql server 2000 personal on a pc running Windows XP service pack 2. I have set authentication to sql server and windows.

When I created a system dsn on the same machine it's working fine. But when I try to create a dsn from another machine on the same network, its giving error like "connection faile , error 10061, sql server does not exit or access denied."

I have truned off firewall on the server machine.

How can I get rid of this prbolem?
Please help me

Thank you

View 8 Replies View Related

Erro Running A Query If Dashes Present In The String

Jul 20, 2005

Hi all,I have a table in the DB which holds ISBN book nubers .. which, as you knowhave dashes (examlple: 0-98765-8-9).When I run a query from an ASP page to find the number, it doesn't returnanything:sISBN = "0-98765-8-9"OpenSQL(select URL from ISBN_Redirect where ISBN=" & sISBN )Can you give me a hind of what I am doing wrong?Thanks so much in advance.S

View 1 Replies View Related

SQLExpress Database File Auto-creation Erro...........Im Lost!

Mar 28, 2008

here is my error message wich can also be seen live at www.aspdoug.com/menu  log in with  user: doug  pass: macromedia!
--------------------------------------------------------------------------------------------------------------------------------
Server Error in '/menu' Application.


An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. SQLExpress database file auto-creation error:
The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:

If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.
Sql Server Express must be installed on the machine.
The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.
Source Error:



An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:



[SqlException (0x80131904): An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800131
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +737554
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +114
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +421
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +133
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +68

[HttpException (0x80004005): Unable to connect to SQL Server database.]
System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +124
System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +86
System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +25
System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString) +397



Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
 
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Below is my web.config file.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------<?xml version="1.0"?><configuration>
 
 <appSettings/>
<connectionStrings>
<add name="aspdougcomConnectionString" connectionString="Data Source=65.36.214.248;Initial Catalog=aspdougcom;Persist Security Info=True;User ID=*&^%$#@;Password=*&^%$#@"providerName="System.Data.SqlClient" /></connectionStrings>
 
<system.web><!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.-->
<compilation debug="false" strict="false" explicit="true"></compilation>
<pages><namespaces>
<clear /><add namespace="System" />
<add namespace="System.Collections" /><add namespace="System.Collections.Generic" />
<add namespace="System.Collections.Specialized" /><add namespace="System.Configuration" />
<add namespace="System.Text" /><add namespace="System.Text.RegularExpressions" />
<add namespace="System.Web" /><add namespace="System.Web.Caching" />
<add namespace="System.Web.SessionState" /><add namespace="System.Web.Security" />
<add namespace="System.Web.Profile" /><add namespace="System.Web.UI" />
<add namespace="System.Web.UI.WebControls" /><add namespace="System.Web.UI.WebControls.WebParts" />
<add namespace="System.Web.UI.HtmlControls" /></namespaces>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user. -->
<authentication mode="Forms" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>-->
 </system.web>
</configuration>
 
-------------------------------------------------------------------------------------------------------------------------
MY host told me that they do not support sqlexpress and to change it MySql 2005 or something. im using hostmysite.com builder plan.

View 1 Replies View Related

Openquery???

Sep 14, 2004

Hi All,

Does anyone know the syntax for an insert statement using Openquery in a stored procedure? All the examples I've seen are Select statements, but I want to send data to a linked server.

Would I be better off using DTS??

Thanks,

Greg

View 1 Replies View Related

Openquery

Dec 13, 2007



How to create linked server to Dbf,

How to openquery util step by step

View 1 Replies View Related

OPENQUERY

Sep 19, 2007



HI,
Can we use OPENQUERY with a parameter? Something like this:
SELECT * FROM OPENQUERY(@SOURCE_SERVER_NAME, 'Select * from dbo.FEED')


Please let me know at the earliest. Thanks a lot,.

Mannu.

View 3 Replies View Related

Openquery Problem

Apr 18, 2008

Hi everybody,
I am having a problem using a servername with '' in the openquery statement. I'd really appriciate if someone could suggest how I should be using it. Here is the query:
select * from openquery(sqldev est,'SELECT COUNT(*) FROM t_login WHERE username=''Tom''') into count
thanks in advance
devmetz

View 2 Replies View Related

Openquery() Search With NOT LIKE

May 20, 2008

Hi All,I want to use the following code to use 'NOT LIKE' clause for my File system search here is the code:SELECT Docs.FileNameFROM OPENQUERY(OPINIONSERVER, 'SELECT Filename FROM SCOPE() WHERE FREETEXT(''Any text not to search'')') AS Docs I want to use the above code for my html file system search similar to:ColumnName NOT LIKE N'%1971%'The confusing part for me is that in normal queries we use the column name to search in, but while searching in the file system using the FREETEXT() function how we exclude the words user dont want to search.I am using Dotnetnuke.

View 2 Replies View Related

Using Functions In Openquery

Jul 20, 2001

I'm trying to use the date() function in an openquery statement in query analyzer and I keep getting an illegal symbol ")" error. The statement is :

select *
from openquery([Big Blue], 'select cde_date, cde_item from acch1 where cde_date < date()')

The objective is to find records where cde_date is prior to today. The syntax works fine if I execute it on the mainframe in QMF and the ODBC connection works fine if I hard code the value. What I need is the ability to use the function so I can run the query on subsequent days without having to edit it.

Any suggestions??

View 1 Replies View Related

Openquery Error

Nov 20, 2002

Hello,
if I am running this query and getting the error the below error

SELECT * FROM OPENQUERY(AS400ODBC,'
SELECT CBH_CREDIT_MEMO_NMBR,CBH_CREDIT_MEMO_DATE,CBH_CUST _TAX_CODE,
CBH_TAXABLE_TOTAL,CBH_CUST_NMBR FROM CREDITBLDH CR1 WHERE CR1.
CBH_CREDIT_MEMO_DATE = (SELECT MAX(CR2.CBH_CREDIT_MEMO_DATE) FROM CREDITBLDH CR2 WHERE CR1.CBH_CUST_NMBR = CR2.CBH_CUST_NMBR)')

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0666 - Estimated query processing time 7211 exceeds limit 600.]


What can I do for this?.
I can able to run fine without subquery
You suggestion appreciated.
T's,
Ravi

View 1 Replies View Related

Openquery For Oracle

Jan 22, 2003

Hi,
I am using the below SQL query for Oracle
SELECT FP_MONTH
FROM CDWD..CDW.ACCOUNT_SALES
WHERE LAST_MODIFIED_DT > '2002-12-01 00:00:00.000'
OR SOURCE_CONTROL_DT > '2002-12-01 00:00:00.000'

My questions are
1. If I am using this date fileter it is taking long time than without filter
Why ?.
2. How I can write Open query for the above query?.
I am expecting valuable advice.
Thanks,
Ravi

View 3 Replies View Related

OpenQuery() Help Needed

Aug 25, 2004

Does anyone know how to use the openquery() method with dynamic SQL? I've tried these two different approaches with no success. DECLARE @sql nvarchar(4000)SET @sql = 'select producer_id from producer where producer_id = ' 'A' ' ' select producer_id from openquery([sybtest], @sql) -------------------------------------------DECLARE @producer_id char(1)SET @producer_id = 'A' select producer_id from openquery([sybtest], 'select producer_id from producer where producer_id = ' ' ' + @producer_id + ' ' ' ' )

View 4 Replies View Related

OPENQUERY Parameter

Oct 11, 2005

I am trying to do the following:

SELECT ExpireDate
FROM OPENQUERY([10.22.10.79], Expire Date
From Product Where [ExpireDate] > 2005-12-31')
GO

However the above sql statement doesn't get the dates greater than the date provided unless there are quotes around the date. How do I add a variable that will cover this date and include the identifiers to get the correct records

View 4 Replies View Related

OpenQuery Using A Variable

Jan 29, 2004

Hi,

Here's what I did:

1) I declared a new VARCHAR(2000) variable called CQUERY like this:
DECLARE @CQUERY VARCHAR(2000)
2) I put a string query in the variable:
SET @CQUERY = 'SELECT ...'

Now, when I try to execute the OpenQuery method using that variable, it fails.

Here's the call:
SELECT * FROM OPENQUERY(OracleSource, @CQUERY)

I get the following error:
Server: Msg 170, Level 15, State 1, Line 13
Line 13: Incorrect syntax near '@CQUERY'.

Don't tell me I can't use a variable instead of a static query? What am I doing wrong?

Thanks,

Skip.

View 5 Replies View Related

How To Execute A SP Using OpenQuery

Jun 12, 2008

Hi,

I am trying to execute a ServerB stored Procedure which takes Int as paramter using OpenQuery in ServerA.But this doesnt seems to working.
Please Help !!!!

DECLARE @param1 INT
SET @param1 1

SELECT *
FROM OPENQUERY(ServerB,'DBNAME.dbo.SP_NAME ''@param1''')

View 3 Replies View Related

SQL Openquery && Oracle

Jul 23, 2005

In SQL Server 2000 I have set up an Oracle linked server. When I runthe following query it runs fine:-SELECT*FROMOPENQUERY(LINKEDSERVERNAME,'SELECT * FROM ORACLETABLENAME')However the following query does not work:-SELECT*FROMOPENQUERY(LINKEDSERVERNAME,'SELECT FIELDNAME FROM ORACLETABLENAME')This error is returned:-Server: Msg 7321, Level 16, State 2, Line 1An error occurred while preparing a query for execution against OLE DBprovider 'MSDAORA'.[OLE/DB provider returned message: ORA-00904: "FIELDNAME": invalididentifier]OLE DB error trace [OLE/DB Provider 'MSDAORA' ICommandPrepare::Preparereturned 0x80040e14].Basically select * works ok, but if I specify the field(s) I need thenit errors. I have tried entering the field names in upper and lowercase but it makes no difference.My real problem is that some dates in the Oracle database are pre 1753which SQL server does not recognise so I need to convert (decode) them.Any help would be appreciated.ThanksChris

View 2 Replies View Related

OpenQuery Performance

Mar 31, 2008



Hi,
To access data from Linked server, which of the following is good Performance-wise:
1. Use of OPENQUERY to access data from Linked server
2. Using Direct query to access data using the four part Name of Linked server

Thanks in Advance.

View 1 Replies View Related

OPENQUERY &&amp; Permissions

Oct 23, 2007

I have a dataming stored procedure. it works fine on it own, thanks to help from this forum. However, when i try to run aggregate funtions on the table it returns using sql server I get:

"The OLE DB provider "MSOLAP" for linked server "DM" indicates that either the object has no columns or the current user does not have permissions on that object."

This works:

CALL Assemby.Namespace.MyFunction('[model]', 'db','table',0)

And this works:

SELECT SUM([prediction]) as value, count([prediction]) as count FROM OPENQUERY(DM,'
--DMX query that sproc produces and executes
')

but this:
SELECT SUM([prediction]) as value, count([prediction]) as count FROM OPENQUERY(DM,'
CALL Assemby.Namespace.MyFunction(''[model]'', ''db'',''table'',0)
')

gives this:

The OLE DB provider "MSOLAP" for linked server "DM" indicates that either the object has no columns or the current user does not have permissions on that object.

Could anyone point me in the right direction?

Thanks,
Adam

View 3 Replies View Related

Problem With OPENQUERY

Feb 18, 2007

Hello,
I've got a problem with OPENQUERY. When I use SQL Server Management Studio, I don't have any errors (I'm logged as Admin via Windows Auth.). When I try to use Adomd via ASP.NET (user - ASPNET with admin role, which is set in Man. Studio), I've got an error: Errors in the high-level relational engine. A connection could not be made to the data source specified in the query. Any idea? Other querries work fine (i mean that querries which don't use OPENQUERY statement).SELECT
t.[Name],
[DecisionTreeModel].[Party],
PredictProbability([Party])
From
[DecisionTreeModel]
PREDICTION JOIN
OPENQUERY([VotingRecordsRDS],
'SELECT
[Name],
[Permanent Tax Cuts],
[Campaign Finance Overhaul]
FROM
[dbo].[VotingRecords]
') AS t
ON
[DecisionTreeModel].[Permanent Tax Cuts] = t.[Permanent Tax Cuts] AND
[DecisionTreeModel].[Campaign Finance Overhaul] = t.[Campaign Finance Overhaul]
ORDER BY PredictProbability([Party]) DESC

Thank you in advance for any help with this.
MM

View 4 Replies View Related

Issues With OpenQuery

May 19, 2008

We are running the following query against a MYSQL database that runs a third party software.


SELECT Email, CONVERT(INT, count) AS clicks, date AS Last_Clicked_Date
FROM OPENQUERY(MYSQL, 'SELECT Email, SUM(count) count, MAX(date) date FROM tracking WHERE action="click" GROUP BY Email')

We are upgrading that software to the latest version. This requires a migration from MYSQL to PostGres.
There are some schema changes involved

Current MYSQL field name New PostGres field name
email email_address
date tracking_date
action action_name

I've modified the query to use the new fields

SELECT Email_address, CONVERT(INT, count) AS clicks, date AS Last_Clicked_Date
FROM OPENQUERY(MYSQL, 'SELECT Email_address, SUM(count) count, MAX(tracking_date) date FROM tracking WHERE action_name="click" GROUP BY Email_address')

and I get the following error message -

Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "MSDASQL" for linked server "test" reported an error. The provider reported an unexpected catastrophic failure.

Msg 7350, Level 16, State 2, Line 1

Cannot get the column information from OLE DB provider "MSDASQL" for linked server "test".



When I run this query it works -

select email_address, tracking_date

from openquery(test, 'select * from tracking')


What am I doing wrong?

Thanks

View 19 Replies View Related

OpenQuery With Inner Join

Feb 13, 2008

Hi All,
I would like to say Thank you in advance, i have a big problem with a deadline coming on friday, Here is my problem, i want to access data from remote server, the server name is "SeverName" just for some reason, and my table name is T1, T2, T3, T4. and My Comlumn Names are, Col1, Col2, .......Col11. Here is the code i used and the error i got: Note that T1=Table one, DB =DataBase, Col = Column.


Select

Col1 ,

Col2,

Col3,

Col4,

Col5,

Col6,

Col7,

Col8,

Col9,

Col10,

Col11



From

Openquery (ServerName , '

Select



T1.Col1,

CAST(substring(T1.Col2,1,255) AS Varchar(255)) AS Col2,

CAST(substring(T1.Col3,1,255) AS Varchar(255)) AS Col3,

CAST(substring(T1.Col4,1,255) AS Varchar(255)) AS Col4,

T1.Col5,

CAST(substring(T1.Col6,1,4000) AS Varchar(4000)) AS Col6,

T1.Col7,

CAST(substring(T1.Col8,1,255) AS Varchar(255)) AS Col8,

T3.Col9 As Col9

CAST(substring(T2.Col10,1,255) AS Varchar(255)) AS Col10,

T4.Col11 AS Col11,

FROM
DB.T1 a

Inner Join
DB.T2 b

on b.T2ID = a.T1ID

Inner Join

DB.T3 c

on c.T3ID = a.T1ID"

Inner Join

DB.T4 d

On d.T4ID = a.T1ID

')


Here is the error i got:

€œ[OLE/DB provider returned message: No query has been assigned to this statement.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IColumnsInfo::GetColumnsInfo returned 0x80004005: ].
Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error. €œ


Please help, anyone who could have any alternative it will be fine, if the code is wrong let me know, what ever reason i will take it.

Thank you again,

Sami

View 10 Replies View Related

How To? - OpenQuery Table Locking

Aug 21, 2007

We have a MS SQL database with an Oracle linked server  'ALTTEST'
 We can Select, Insert, Delete and Update tables on the Oracle Db using OpenQuery, but how do I apply a table lock with a transaction?
I've tried applying the code below, but it doesn't work.
 Any help appreciated.
BEGIN TRAN
SELECT * from openquery(ALTTEST,'select LAST_PIN_NUMBER from sys_params') WITH (TABLOCKX)
COMMIT
 

View 5 Replies View Related

OPENQUERY From ASP.NET Page Problem?

Jan 22, 2006

I'm performing a particular word Search in  MS Word, Text, PDF docs and displaying the results through Index Server linked to SQL Server when it is matched. For which I'm using Openquery in the stored procedure which works fine in Query Analyzer of the SQL Server but doesn't work ( displays none of the results) when i call it from the ASP.NET Page. I am not able to figure out Where and What is the problem? The Stored Proc which is i'm using is shown below Any help will be greatly appreciated. Thanks for your time and help in Advance
CREATE PROCEDURE SelectIndexServerCVpaths ( @searchstring varchar(100) ) AS SET @searchstring = REPLACE( @searchstring, '''', '''''' ) IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS  WHERE TABLE_NAME = 'FileSearchResults') DROP VIEW FileSearchResults EXEC ('CREATE VIEW FileSearchResults AS SELECT * FROM OPENQUERY(FileSystem,''SELECT Directory, FileName,  DocAuthor, Size, Create, Write, Path FROM SCOPE('''' "c:inetpubwwwrootsap-resourcesUploads" '''') WHERE FREETEXT(''''' + @searchstring + ''''')'')') SELECT * FROM CVdetails C, FileSearchResults F  WHERE C.CV_Path = F.PATH AND C.DefaultID=1 GO
which works with followin stat in Query Analyzer Exec SelectIndexServerCVpaths @searchstring = 'The Search text'
but doesn't work when i connect it to a Datagrid in my ASP.NET Page objcmd = new SqlCommand("SelectIndexServerCVpaths", objConn); objcmd.CommandType = CommandType.StoredProcedure; objcmd.Parameters.Add("@searchstring",strsearchstrings); objConn.Open(); objRdr = objcmd.ExecuteReader(); dgcvs.DataSource=objRdr; dgcvs.DataBind(); objRdr.Close(); objConn.Close();

View 9 Replies View Related

Using Variables In Openquery Statement

Mar 27, 2001

Does anybody know how to pass variables to openquery statement? I executed the following statement against DB2 mainframe
and got an error message.

Thanks in advance

Hung-Ban


declare @deptname varchar(20)
select @deptname = 'HEAD OFFICE'

select DEPTNUMB,DEPTNAME from openquery(m1db2u,"select DEPTNUMB,DEPTNAME from Q.ORG
where DEPTNAME=@deptname")

Server: Msg 7399, Level 16, State 1, Line 4
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][CLI Driver][DB2] SQL0206N "@DEPTNAME " is not a column in an inserted table, updated table, or any table identified in a FROM clause or is not a valid transition variable for the subject table of a trigger. SQLSTATE=42703
]

View 1 Replies View Related

DTS Package And Nested OPENQUERY's??

Nov 7, 2005

Is there a way to use nested OPENQUERY's in a DTS package??

I have the following SQL statement (whichs execute without error) that I would like to make a DTS package out of:

INSERT tbl_Sku SELECT AX.sku_id, AX.style_id, AX.style_color_id, AX.style_size_id, AY.color_id, AY.size_master_id from OPENQUERY("SVR-1",'SELECT sku_id, style_id, style_color_id, style_size_id FROM merch.dbo.sku') as AX, OPENQUERY("SVR-2",'SELECT sku_id, style_id, color_id, size_master_id FROM ma.dbo.sku') as AY Where AX.sku_id = AY.sku_id


The problem I am having is the connection object of the DTS package. It will not allow an OPENQUERY inside an OPENQUERY. How do I set up a third comnnection??

View 7 Replies View Related

'Subquery Returned More Than 1 Value' In OpenQuery

Nov 14, 2006

I'm getting the message

"Subquery returned more than 1 value." etc when running a query on a
linked server through OpenQuery. This returns around 6 values
(some of them are fairly long varchar's).
When running another query the same way which returns 2 values,
it works fine.

The problem query also works fine when run locally. It's calling a User-Defined Functions which returns a table, but the second query which works fine also does this.

Where can this subquery be ? Inside the UDF (shouldn't matter, should it?) ?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved