cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports Connect to MS SQL

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member292966
Active Contributor
0 Kudos

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.

Brian

Former Member
0 Kudos

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"

Answers (0)