Składnia SQL Flashcards
1
Q
Tworzenie widoku
A
CREATE VIEW … AS SELECT …
2
Q
Tworzenie procedury
A
CREATE PROCEDURE … (argumenty) AS BEGIN … END
3
Q
Tworzenie funkcji
A
CREATE FUNCTION … (argumenty) RETURNS … AS BEGIN … END
4
Q
INSERT EXEC
A
INSERT INTO …(…) EXEC …
5
Q
SELECT INTO
A
SELECT … INTO … FROM …
6
Q
BULK INSERT
A
BULK INSERT … FROM … WITH ( datafiletype, fieldterminator, rowterminator)
7
Q
Tworzenie indexów
A
CREATE CLUSTRED INDEX … ON table (column) INCLUDE (column)
8
Q
Tworzenie triggerów
A
CREATE TRIGGER … ON table AFTER INSERT/UPDATE/DELETE AS …
9
Q
Tworzenie synonimów
A
CREATE SYNONIM … FOR …
10
Q
Warunek na usunięcie obiektu z bazy
A
If EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N’…’) AND type = N’UQ’)