Skip to Content.
Sympa Menu

freetds - Re: [freetds] Performing subqueries for inserting into MS-SQL

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Peter Matulis" <pmatulis AT gmail.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Performing subqueries for inserting into MS-SQL
  • Date: Mon, 2 Oct 2006 15:11:26 -0400

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?




Archive powered by MHonArc 2.6.24.

Top of Page