SELECT TDate = t1.TDate, TOpenP = t1.TOpenP, THighP = t1.THighP,
TLowP = t1.TLowP, TCloseP = t1.TCloseP, TVolume = t1.TVolume
FROM dbo.ibm$ t1
INNER JOIN dbo.intc$ t2
ON t1.TDate = t2.TDate
AND t1.TDate = '2011-01-21 00:00:00.000'
=======================================================================Ambiguous column name is usually the result of a poorly constructed inner join
BAD: ----------------------------------------------------
SELECT TDateFrom ibm$INNER JOIN intc$ON ibm$.TDate=intc$.TDate----------------------------------------------------GOOD:
SELECT TDate = t1.TDate FROM ibm$ t1 JOIN intc$ t2 ON t1.TDate = t2.TDate
SELECT TDate = t1.TDate, TOpenP = t1.TOpenP, THighP = t1.THighP,
TLowP = t1.TLowP, TCloseP = t1.TCloseP, TVolume = t1.TVolume
FROM dbo.ibm$ t1
INNER JOIN dbo.intc$ t2
ON t1.TDate = t2.TDate
AND t1.TDate = '2011-01-21 00:00:00.000'
=======================================================================
Ambiguous column name is usually the result of a poorly constructed inner join
SELECT TDate = t1.TDate
FROM ibm$ t1
JOIN intc$ t2
ON t1.TDate = t2.TDate
AND t1.TDate = '2011-01-21 00:00:00.000'
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP 1000 [F1]
,[F2]
,[F3]
,[F4]
,[F5]
,[F6]
FROM [trading].[dbo].[intc$]
--------------------------------------------------------------------------
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP 1000 [name]
,[team]
,[salary]
,[sickleave]
FROM [BASKETBALL].[dbo].[DONG]
--------------------------------------------
create database trading
----------------------------------------------
create table intel
(t_date date not null,
t_open decimal(10,2) not null,
t_high decimal(10,2) not null,
t_low decimal(10,2) not null,
t_close decimal(10,2) not null,
volume numeric(11) not null);
----------------------------------------------
SELECT * FROM ‘intc$’
-----------------------------------------------
Click Finish to perform the following actions:
Source Location : C:\Users\edog\Documents\intc.xls
Source Provider : Microsoft.Jet.OLEDB.4.0
Destination Location : DRC-PC\DONGSERVER
Destination Provider : SQLNCLI10
· Copy rows from `intc$` to [dbo].[intc$]
The new target table will be created.
· The package will not be saved.
· The package will be run immediately.
------------------------------------------------------------------------------------------------------------------------------------------------------------------