none
ERROR [42000] [MERANT][ODBC Sybase ASE driver][SQL Server]Incorrect syntax near '['.

    Question

  •  

     

     In  SSIS VS 2005 I added a data source for Sybase when I'm trying to add a table to the Data Source View I get a list of available tables, once I select a table and click OK I get the following error:


    ERROR [42000] [MERANT][ODBC Sybase ASE driver][SQL Server]Incorrect syntax near '['.

    Same goes if I try to add a Named Query.

    Are there are any setting I can change so that SSIS doesn't use square brackets when it generates a query?

    I'm using older Sybase driver, but thats all I got for now.

    Thanks.


    More details:

    ERROR [42000] [MERANT][ODBC Sybase ASE driver][SQL Server]Incorrect syntax near '['.
     (SYODASE.DLL)

    ------------------------------
    Program Location:

       at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
       at System.Data.Odbc.OdbcDataReader.get_FieldCount()
       at System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.get_VisibleFieldCount()
       at System.Data.ProviderBase.DataReaderContainer.Create(IDataReader dataReader, Boolean returnProviderSpecificTypes)
       at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
       at System.Data.Common.LoadAdapter.FillFromReader(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
       at System.Data.DataTable.Load(IDataReader reader, LoadOption loadOption, FillErrorEventHandler errorHandler)
       at System.Data.DataTable.Load(IDataReader reader)
       at Microsoft.DataWarehouse.Design.DataSourceConnection.FillDataSet(DataSet dataSet, String schemaName, String tableName, String tableType)
       at Microsoft.AnalysisServices.Design.DataSourceDesigner.AddRemoveObjectsFromDSV()



    lundi 16 février 2009 16:27

Toutes les réponses

  • Hi,

    Not sure if this will work but have you tried using a SQL Command instead of Table or View for Data access mode and writing a query that contains table names without [ ]?

    Cheers
    Jeff
    SQL Server MVP / WARDY IT Solutions, Solutions Architect
    mercredi 18 février 2009 06:32
  • Jeff,

    I tried writing a query without the [ ], for example trying to execute the sp (exec my_sp) as a named query Test, internally SSIS tried to execute the following:

        SELECT [Test].*
        FROM 
        (
            exec my_sp
        )    
         AS [Test] (Microsoft.AnalysisServices.Controls)

    And I got the same error:

    ERROR [42000] [MERANT][ODBC Sybase ASE driver][SQL Server]Incorrect syntax near '['.
     (SYODASE.DLL)

    Thanks,
    George

    mercredi 18 février 2009 22:10
  • Hi,

    Try surrounding your tablename with " "

    Cheers
    Jeff

    SQL Server MVP / WARDY IT Solutions, Solutions Architect
    mercredi 18 février 2009 22:16
  •  Hi,

    I have no control over '['.
    In my query all I say is: exec my_sp.
    'Test' is the name of the Named Query.

    I can see in the log  that SSIS adds wrapper around it internally:

         SELECT [Test].*
            FROM 
            (

                   *******My query, in this case 'exec my_sp' *********

             )AS [Test] (Microsoft.AnalysisServices.Controls)

    Thats the issue. 
    I'm trying to find a way to tell SSIS not to use '[ ]'.

    Thanks,
    George

    jeudi 19 février 2009 13:30