---
title: "Uppdatering av information..."
type: "forum-thread"
url: "https://www.webforum.nu/amne/databaser-sql/44890-uppdatering-av-information"
topic: "Databaser & SQL"
topic_url: "https://www.webforum.nu/amne/databaser-sql"
author: "JAreMANNEN"
published: "2002-05-30T09:23:15.000Z"
updated: "2002-05-30T09:33:11.000Z"
replies: 1
views: 150
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/databaser-sql/44890-uppdatering-av-information"
---

# Uppdatering av information...

## #1 — JAreMANNEN, 2002-05-30T09:23Z

Uppdatera information i tabell...

Har en tabell som jag ska uppdatera information i..
Har importerat information från en txt-fil till en temp-tabell.
så ifrån temp-tabellen ska jag altså uppdatera informationen i originaltabellen...
Jag jämför Id i dessa två tabeller för att det ska bli riktigt..

I Query Analyzer försöker jag skriva

```
update tabell
set namn = temp_tabell.namn, adress = temp_tabell.adress
where tabell.id = temp_tabell.id
```

Men det blir ju självklart fel..
Måste gruppera ihop dessa två på nåt vis först antar jag...
Hoppas att du förstår hur jag menar..

/Jare

Permalänk: https://www.webforum.nu/p/44890

## #2 — JAreMANNEN, 2002-05-30T09:33Z

never mind...

löste det med

```
update tabell
set tabell.namn = temp_tabell.namn, tabell.adress = temp_tabell.adress
from tabell
inner join temp_tabell
on temp_tabell.id = tabell.id
where tabell.id = temp_tabell.id
```

Permalänk: https://www.webforum.nu/p/687245

---

Tråden på webben: https://www.webforum.nu/amne/databaser-sql/44890-uppdatering-av-information
