Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Insert with multiselected AND fixed values

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-03-11 : 08:07:53
Kim Holzmann writes "INSERT INTO MGF_Produkt_aftale (Produkt)
SELECT MGF_Produkter.Auto_ID
FROM MGF_Produkter INNER JOIN
MGF_Produktgruppe_binding ON MGF_Produkter.Auto_ID = MGF_Produktgruppe_binding.Produktnavn
WHERE (MGF_Produktgruppe_binding.Produktgruppe = 1)

This working perfect
insertes XX values from MGF_Produkter to MGF_Produkt_aftale

but i need to do this! (add the AFD as a fixed value to)

INSERT INTO MGF_Produkt_aftale (Produkt,AFD)
SELECT MGF_Produkter.Auto_ID
FROM MGF_Produkter INNER JOIN
MGF_Produktgruppe_binding ON MGF_Produkter.Auto_ID = MGF_Produktgruppe_binding.Produktnavn
WHERE (MGF_Produktgruppe_binding.Produktgruppe = 1)

Set AFD = 1538

Have tryed many things now, so please help.

windows 2000 and XP, windows server 2003"

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2005-03-11 : 08:11:06
INSERT INTO MGF_Produkt_aftale (Produkt,AFD)
SELECT MGF_Produkter.Auto_ID, '1538'
FROM MGF_Produkter INNER JOIN
MGF_Produktgruppe_binding ON MGF_Produkter.Auto_ID = MGF_Produktgruppe_binding.Produktnavn
WHERE (MGF_Produktgruppe_binding.Produktgruppe = 1)
Go to Top of Page
   

- Advertisement -