Skip to Content
avatar image
Former Member

Crystal Reports Connect to MS SQL

I am currently using Crystal Reports V11. I am looking at upgrading to 2016 if I can "beat" this problem. When I design a report and connect to a MSSQL database I select the Data Source Name and I am able to start selecting tables. Once done, I go and look at Database/Database Expert I see the Datasource name I selected and then looking down the tree I see the Database Name. So Crystal does not only hold a reference to the Datasource Name, It holds a reference to the database name. The database name on my development server is SalesDB but on my clients servers their database name will have their name included such as RaySalesDB. Even though they use the same datasource name and table structure due to Crystal holding the database name these report files are not compatible between different Database Names.

Will I be faced with the same problem in 2016? Does anyone know of a way to "fix" this problem?

Thank you in advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 10, 2017 at 04:48 PM

    Hi Vince,

    If the tablenames are the same and the datasource is the same, the report should be able to find the tables without any issue. Instead of looking in the Database Expert, look at the SQL Query. The Database Expert uses an alias it creates when the report is first created so it's not accurate. Looking at the SQL Query will show you the fully qualified database.owner.table it's connecting to.


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Brian,

      Thank you for your time. What you had explained, was what I expected. I never thought to look at the SQL. Below is the SQL. It does actually show the database name which is salesDBN

      SELECT "workshee"."ID", "deal"."ACTIVE_YN", "phase"."PROJECT"
      FROM {oj ("salesDBN"."dbo"."WORKSHEE" "workshee" LEFT OUTER JOIN "salesDBN"."dbo"."deal" "deal" ON "workshee"."ID"="deal"."ID") INNER JOIN "salesDBN"."dbo"."PHASE" "phase" ON "deal"."PHASE"="phase"."PHASE"}
      WHERE "deal"."ACTIVE_YN"='Yes'
      ORDER BY "workshee"."ID"