[freetds] Performing subqueries for inserting into MS-SQL
Peter Matulis
pmatulis at gmail.com
Mon Oct 2 15:11:26 EDT 2006
On 10/2/06, Lowden, James K <james.k.lowden at alliancebernstein.com> wrote:
> > From: Peter Matulis
> > Sent: Monday, October 02, 2006 2:04 PM
> >
> > How can I perform subqueries for inserting
> > into MS-SQL Server 2000?
>
> Do you mean
>
> INSERT table2 SELECT ... FROM table1
>
> ?
>
> 1> select * from a
> 2> go
> a
> -----------
> 1
> 2
> 3
> 4
>
> 1> select * into #a from a where 0=1
> 2> insert #a select * from a
> 3> select a.a, t.a as '#a' from a join #a as t on a.a = t.a
> 4> go
> a #a
> ----------- -----------
> 1 1
> 2 2
> 3 3
> 4 4
Thanks for replying.
I'm not sure where you are going with this. Is it not possible to
continue with my current code? If so, how?
More information about the FreeTDS
mailing list