Showing posts with label schema. Show all posts
Showing posts with label schema. Show all posts

Friday, March 23, 2012

servers: Invalid schema

Hi
This may not be much help but....I'm having the same
problem with MySQL. (1) Have you put a trace on the ODBC
call (do 'DBCC Traceon(7300)'in query analyser)- that gets
me some crud about 'nulls'. Do you get the same?. (2)
Anyway, as far as I am aware, catalog refers to the
database you are trying to connect to and schema refers to
the owner of the object you're trying to get at. My
question is, is the object owner in your other database
called something other than 'dbo' which is the name in
SQL2000 and are you using 'dbo' as the third part of the 4
part string?
I wouldn't normally ask questions in response to a
question but your posting seems to indicate that this is
not uncommon but no-one's posted an answer:-(
Malcolm
>--Original Message--
>I am having a problem referencing tables via a linked
>server in SQL queries using the
>syntax as exampled in the following simple illustration:
> SELECT * FROM LinkedServerName.Catalog.Schema.TableName
>The connection string I am using seems to be correct
>because I can see the table names when I expand the
>server in Enterprise Manager and I have also used it
>elsewhere (to generate a recordset using ADO and VBScript
>in a DTS package).
>When the above query is executed (in Query Analyser, for
>example) I get the following error message:
> 'OLE DB provider 'MSDASQL' returned an invalid schema
> definition. OLE DB error trace [Non-interface error:
> OLE/DB provider returned an invalid schema finition.].'
>The linked server is actually a Recital database
>connected using OLEDB for ODBC using the Recital ODBC
>driver. It does not have a direct equivalent of schema
>and catalogues and does not expose the interface which
>MSSQL Server seems to require.
>I have searched the internet (including various forums,
>e.g. dbforum) and have found quite a number of similar
>cases logged for a variety of other databases, but no one
>has replied with a solution.
>I really want to be able to write update queries using a
>mixture of SQL and Recital data and the linked server
>would be an attractive solution - if it worked!!!.
>Any suggestions.
>N.b. I have managed to use OPENROWSET, but not for update.
>.
>
i'm having the same problem with linking mysql. i get the error
Server: Msg 7312, Level 16, State 1, Line 1
Invalid use of schema and/or catalog for OLE DB provider 'MSDASQL'. A
four-part name was supplied, but the provider does not expose the
necessary interfaces to use a catalog and/or schema.
OLE DB error trace [Non-interface error].
i can see all the tables in the linked mysql server, but the schema
column is blank whereas it's usually dbo for linked sqlserver servers.
Malcolm wrote:
[vbcol=seagreen]
> Hi
> This may not be much help but....I'm having the same
> problem with MySQL. (1) Have you put a trace on the ODBC
> call (do 'DBCC Traceon(7300)'in query analyser)- that gets
> me some crud about 'nulls'. Do you get the same?. (2)
> Anyway, as far as I am aware, catalog refers to the
> database you are trying to connect to and schema refers to
> the owner of the object you're trying to get at. My
> question is, is the object owner in your other database
> called something other than 'dbo' which is the name in
> SQL2000 and are you using 'dbo' as the third part of the 4
> part string?
> I wouldn't normally ask questions in response to a
> question but your posting seems to indicate that this is
> not uncommon but no-one's posted an answer:-(
> Malcolm

servers: Invalid schema

Hi
This may not be much help but....I'm having the same
problem with MySQL. (1) Have you put a trace on the ODBC
call (do 'DBCC Traceon(7300)'in query analyser)- that gets
me some crud about 'nulls'. Do you get the same?. (2)
Anyway, as far as I am aware, catalog refers to the
database you are trying to connect to and schema refers to
the owner of the object you're trying to get at. My
question is, is the object owner in your other database
called something other than 'dbo' which is the name in
SQL2000 and are you using 'dbo' as the third part of the 4
part string?
I wouldn't normally ask questions in response to a
question but your posting seems to indicate that this is
not uncommon but no-one's posted an answer:-(
Malcolm
>--Original Message--
>I am having a problem referencing tables via a linked
>server in SQL queries using the
>syntax as exampled in the following simple illustration:
> SELECT * FROM LinkedServerName.Catalog.Schema.TableName
>The connection string I am using seems to be correct
>because I can see the table names when I expand the
>server in Enterprise Manager and I have also used it
>elsewhere (to generate a recordset using ADO and VBScript
>in a DTS package).
>When the above query is executed (in Query Analyser, for
>example) I get the following error message:
> 'OLE DB provider 'MSDASQL' returned an invalid schema
> definition. OLE DB error trace [Non-interface error:
> OLE/DB provider returned an invalid schema finition.].'
>The linked server is actually a Recital database
>connected using OLEDB for ODBC using the Recital ODBC
>driver. It does not have a direct equivalent of schema
>and catalogues and does not expose the interface which
>MSSQL Server seems to require.
>I have searched the internet (including various forums,
>e.g. dbforum) and have found quite a number of similar
>cases logged for a variety of other databases, but no one
>has replied with a solution.
>I really want to be able to write update queries using a
>mixture of SQL and Recital data and the linked server
>would be an attractive solution - if it worked!!!.
>Any suggestions.
>N.b. I have managed to use OPENROWSET, but not for update.
>.
>i'm having the same problem with linking mysql. i get the error
Server: Msg 7312, Level 16, State 1, Line 1
Invalid use of schema and/or catalog for OLE DB provider 'MSDASQL'. A
four-part name was supplied, but the provider does not expose the
necessary interfaces to use a catalog and/or schema.
OLE DB error trace [Non-interface error].
i can see all the tables in the linked mysql server, but the schema
column is blank whereas it's usually dbo for linked sqlserver servers.
Malcolm wrote:
[vbcol=seagreen]
> Hi
> This may not be much help but....I'm having the same
> problem with MySQL. (1) Have you put a trace on the ODBC
> call (do 'DBCC Traceon(7300)'in query analyser)- that gets
> me some crud about 'nulls'. Do you get the same?. (2)
> Anyway, as far as I am aware, catalog refers to the
> database you are trying to connect to and schema refers to
> the owner of the object you're trying to get at. My
> question is, is the object owner in your other database
> called something other than 'dbo' which is the name in
> SQL2000 and are you using 'dbo' as the third part of the 4
> part string?
> I wouldn't normally ask questions in response to a
> question but your posting seems to indicate that this is
> not uncommon but no-one's posted an answer:-(
> Malcolm

Wednesday, March 7, 2012

server to Text Files: is possible to detect changes made to those files? (SQL Server 2005

Hi gurus,

I've created a linked server (and set up the corresponding schema.ini file) in order to perform bulk-inserts from some CSV text files into SQL tables (from my standpoint the text files are just for reading purposes). The linked server works fine (I can select the data in the files without a problem).

Now the question: is possible to automatically detect when one or more of those files change in order to start the import process automatically? Something like having a trigger created on the CSV files Or there's no easy way to do that so I have, to say something, to create a Job that periodically checks if the files have changed programatically (say, recording each file's timestamp everytime is imported and comparing the recorded value with the current one, or whatever)?

Thanks a lot in advance!

I think it is not that kind of trigger... so for detecting changes I have some ideeas :

1.Probably there is something in WMI (see ) that let you detect modified data of your file; then compare it with a witness data that reside in SQL and import the file if there is a difference

2.Save the csv files with a name that include data ( 09_04_2007_20_23_12.csv) then in a SSIS package verify all that files ( with "for each loop container control flow item" vis-a-vis a witness data of last import and the import with data flow task.

The checking of new files should be made periodically in a job.