Cov txheej txheem:

Dab tsi yog qhov pom hauv SQL Server Management Studio?
Dab tsi yog qhov pom hauv SQL Server Management Studio?

Video: Dab tsi yog qhov pom hauv SQL Server Management Studio?

Video: Dab tsi yog qhov pom hauv SQL Server Management Studio?
Video: Data Science with Python! Analyzing File Types from Avro to Stata 2024, Hlis ntuj nqeg
Anonim

A saib yog lub rooj virtual tsim raws li qhov tshwm sim ntawm ib qho SQL ntawv nqe lus. A saib muaj kab thiab kab, ib yam li lub rooj tiag tiag. Cov kab hauv lub saib yog cov kab los ntawm ib lossis ntau lub rooj tiag tiag hauv cov ntaub ntawv. Los ntawm kev siv SQL Server Management Studio UI. Los ntawm kev siv SQL Server lus nug.

Ib yam li ntawd, peb siv saib qhov twg hauv SQL?

Siv ntawm a Saib Views yog siv rau kev ruaj ntseg vim lawv muab encapsulation lub npe ntawm lub rooj. Cov ntaub ntawv nyob hauv lub rooj virtual, tsis khaws cia mus tas li. Saib tso saib tsuas xaiv cov ntaub ntawv. Peb ua tau kuj siv sql Koom nrog s hauv Xaiv nqe lus hauv kev muab cov ntaub ntawv rau tus saib.

Qhov thib ob, Kuv yuav nug li cas saib hauv SQL Server? Tsim ib tug saib , tus neeg siv yuav tsum muaj qhov tsim nyog tsim nyog raws li kev siv tshwj xeeb. Tsim SAIB view_name AS Xaiv kem1, kem2.. LOS NTAWM table_name WHERE [condition]; Koj tuaj yeem suav nrog ntau lub rooj hauv koj li Xaiv nqe lus zoo ib yam li koj siv lawv hauv ib txwm SQL SELECT query.

Ib yam li ntawd, koj tuaj yeem nug, Kuv yuav tsim kev pom hauv SQL Server li cas?

SQL Server CREATE VIEW

  1. Ua ntej, qhia lub npe ntawm qhov pom tom qab CREATE VIEW keywords. Lub schema_name yog lub npe ntawm lub schema uas qhov pom yog.
  2. Thib ob, qhia meej SELECT nqe lus (select_statement) uas txhais qhov pom tom qab AS lo lus tseem ceeb. Daim ntawv SELECT tuaj yeem xa mus rau ib lossis ntau lub rooj.

Peb puas tuaj yeem muab cov ntaub ntawv tso rau hauv saib?

Tsuas yog cov lus xaiv tau muab khaws cia rau hauv cov ntaub ntawv xwb. Txawm li cas los, views ua tau siv thiab ua haujlwm DML ( Ntxig , Hloov tshiab & Rho tawm) thiab. Koj tuaj yeem ntxig cov ntaub ntawv mus rau lub rooj saum toj no siv cov views peb nyuam qhuav tsim. Thiab nws yog tib syntax uas peb siv rau ntxig cov ntaub ntawv rau rooj.

Pom zoo: