13:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.130 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 13:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.1313:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.13

.

.

Wednesday, January 26, 2011

Work in SQL Server 2008 R2


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 TDate
From 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

    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.

Provider mapping file : C:\Program Files\Microsoft SQL Server\100\DTS\MappingFiles\JetToMSSql9.xml
------------------------------------------------------------------------------------------------------------------------------------------------------------------