Hi folks,
Bit of a tricky one here, well for me anyway.
As an example I'll use the system tables.
Query 1
-------
select t.xtype, c.name from systypes t LEFT OUTER JOIN syscolumns c ON t.xtype = c.xtype AND c.name = 'info'
ORDER BY t.xtype
This query outputs all the types and the name beside it (if it exists). Basically all I need to do is re-write the query so that the c.name = 'info' isn't in the JOIN clause (as DTS doesn't appear to like parameters in the JOIN clause). I assumed that I could simply move it to the WHERE clause but that doesn't give you the same results! (see Query 2) Can ANYBODY solve this??
Query 2
-------
select t.xtype, c.name from systypes t LEFT OUTER JOIN syscolumns c ON t.xtype = c.xtype
WHERE c.name = 'info'
ORDER BY t.xtype
Bit of a tricky one here, well for me anyway.
As an example I'll use the system tables.
Query 1
-------
select t.xtype, c.name from systypes t LEFT OUTER JOIN syscolumns c ON t.xtype = c.xtype AND c.name = 'info'
ORDER BY t.xtype
This query outputs all the types and the name beside it (if it exists). Basically all I need to do is re-write the query so that the c.name = 'info' isn't in the JOIN clause (as DTS doesn't appear to like parameters in the JOIN clause). I assumed that I could simply move it to the WHERE clause but that doesn't give you the same results! (see Query 2) Can ANYBODY solve this??
Query 2
-------
select t.xtype, c.name from systypes t LEFT OUTER JOIN syscolumns c ON t.xtype = c.xtype
WHERE c.name = 'info'
ORDER BY t.xtype