INSERT, UPDATE, DELETE

SQL Server'a Giriş

John MacKintosh

Instructor

INSERT

INSERT INTO table_name
INSERT INTO table_name (col1, col2, col3)
INSERT INTO table_name (col1, col2, col3) 
VALUES 
  ('value1', 'value2', value3)
SQL Server'a Giriş

INSERT SELECT

INSERT INTO table_name (col1, col2, col3) 
SELECT 
  column1, 
  column2, 
  column3 
FROM other_table 
WHERE 
  -- conditions apply
  • SELECT * kullanmayın
  • Tablo yapısı değişirse özel belirtin
SQL Server'a Giriş

UPDATE

UPDATE table 
SET column = value 
WHERE 
  -- Condition(s);
  • WHERE koşulunu unutmayın!
UPDATE table 
SET 
  column1 = value1, 
  column2 = value2 
WHERE 
  -- Condition(s);
SQL Server'a Giriş

DELETE

DELETE 
FROM table 
WHERE 
  -- Conditions
  • Önce test edin!
TRUNCATE TABLE table_name
  • Tüm tabloyu tek seferde temizler

Dur işareti

SQL Server'a Giriş

INSERT, UPDATE ve DELETE yapalım!

SQL Server'a Giriş

Preparing Video For Download...