Professional Documents
Culture Documents
(,, NOT Null, (,), (,),, ) NOT Null
(,, NOT Null, (,), (,),, ) NOT Null
-- add column/s --
ALTER TABLE example ADD column4 CHAR(1) NOT NULL;
-- alter column/s --
ALTER TABLE example ALTER COLUMN column2 VARCHAR(15);
-- drop column --
ALTER TABLE example DROP COLUMN column4;
-- drop table --
DROP TABLE example;
-- truncte table --
TRUNCATE TABLE example;
-- update table --
UPDATE example
SET column2 = 'Not a value' WHERE column2 IS NULL;
-- delete table--
DELETE FROM example WHERE column2 = 'Not a value';
DELETE example;
-- crearea sinonimului --
CREATE SYNONYM ex FOR example;
-- stergerea sinonimului --
DROP SYNONYM ex;
-- crearea viziunii --
-- schemabinding --
CREATE VIEW example_view (column1, column3) WITH SCHEMABINDING AS
SELECT column1, column3 FROM dbo.example;
-- check options --
CREATE VIEW example_view2 (column1, column3) AS
SELECT column1, column3 FROM dbo.example
WHERE column1 = column2
WITH CHECK OPTION;
-- with encryption --
CREATE VIEW example_view3 WITH ENCRYPTION AS
SELECT column1, column3 FROM dbo.example;
-- alter view --
ALTER VIEW example_view AS
SELECT column1, column2 FROM dbo.example;
-- drop constraint --
ALTER TABLE exampe
DROP CONSTRAINT PK;
-- create index --
CREATE INDEX example_index ON example (column2);
DROP INDEX IF EXISTS example_index ON example;
CREATE NONCLUSTERED INDEX example_index ON example (column2);