E
Ed-it
Hello,
I'm migrating my C#.net application from a MS Access-database to SQL
Server 2000. Now I found a problem.
In my code I use a lot (and I mean a lot) of queries with multiple
tables and some tables have columns with the same names ("id", "name"
etc). For example:
SELECT a.id, b.id FROM a INNER JOIN b ON a.id=b.id
or
SELECT a.id, b.id FROM a, b
In MS Access I can use the column names "a.id" and "b.id" (e.g. in
reports or datagrids). Now in SQL Server I see that there will be 2
columns named "id", there is no distinction, so no "a.id" and "b.id".
I see it also in the Query Analyzer. So my datagrids and reports and
sourcecode can't find the right column anymore, they are mapped to
"a.id" and "b.id". I found out that I can use aliasses (SELECT a.id as
'a.id', b.id as 'b.id' FROM...), but is there another way, so that I
don't have to change every query, and even worse, my datagrids and
reports?
Thanks in advance,
Ed
I'm migrating my C#.net application from a MS Access-database to SQL
Server 2000. Now I found a problem.
In my code I use a lot (and I mean a lot) of queries with multiple
tables and some tables have columns with the same names ("id", "name"
etc). For example:
SELECT a.id, b.id FROM a INNER JOIN b ON a.id=b.id
or
SELECT a.id, b.id FROM a, b
In MS Access I can use the column names "a.id" and "b.id" (e.g. in
reports or datagrids). Now in SQL Server I see that there will be 2
columns named "id", there is no distinction, so no "a.id" and "b.id".
I see it also in the Query Analyzer. So my datagrids and reports and
sourcecode can't find the right column anymore, they are mapped to
"a.id" and "b.id". I found out that I can use aliasses (SELECT a.id as
'a.id', b.id as 'b.id' FROM...), but is there another way, so that I
don't have to change every query, and even worse, my datagrids and
reports?
Thanks in advance,
Ed