[freetds] Performing subqueries for inserting into MS-SQL

Peter Matulis pmatulis at gmail.com
Mon Oct 2 14:03:42 EDT 2006


How can I perform subqueries for inserting into MS-SQL Server 2000?
My current code fragment is here:


my $sqlStatement = "


declare @a varchar(10)
set @a = (select top 1 agent_id from ent_domain where domain_name = '1.2.3.4')

INSERT INTO

        table1 (agent_id)

VALUES (@a)


";


More information about the FreeTDS mailing list