Cov txheej txheem:

Kev saib puas tuaj yeem hloov pauv hauv SQL?
Kev saib puas tuaj yeem hloov pauv hauv SQL?

Video: Kev saib puas tuaj yeem hloov pauv hauv SQL?

Video: Kev saib puas tuaj yeem hloov pauv hauv SQL?
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim

Cov ALTER SAIB command tso cai rau koj hloov ib saib . A saib yog raws li cov txiaj ntsig tau teeb tsa los ntawm cov lus nug uas suav nrog SELECT nqe lus lossis UNION ntawm ob lossis ntau dua SELECT nqe lus. Txhawm rau txiav txim siab seb puas tau teev tseg saib muaj nyob rau hauv lub npe chaw tam sim no, siv $SYSTEM. SQL ntawv.

Ib yam li ntawd, peb tuaj yeem kho qhov pom hauv SQL?

Cov SQL ntawv Hloov tshiab SAIB lus txib ua tau siv rau hloov kho cov data a saib . Tag nrho saib tsis yog updataable. Yog li, UPDATE cov lus txib tsis siv tau rau txhua tus saib.

Ib sab saum toj no, kuv yuav hloov kho qhov pom SQL uas twb muaj lawm li cas? Siv SQL Server Management Studio

  1. Hauv Object Explorer, nyem lub cim ntxiv ntawm ib sab ntawm cov ntaub ntawv uas koj pom nyob thiab tom qab ntawd nyem lub cim ntxiv rau ntawm Views folder.
  2. Txoj cai-nias ntawm qhov pom koj xav hloov kho thiab xaiv Tsim.

Li ntawd, peb puas tuaj yeem hloov qhov kev pom?

ALTER SAIB . Siv cov ALTER SAIB nqe lus kom meej meej recompile a saib uas yog invalid los yog rau hloov saib kev txwv. Koj ua tau kuj siv ALTER SAIB txhais, hloov kho , los yog poob saib kev txwv. Cov lus no ua tsis hloov lub ntsiab txhais ntawm ib qho uas twb muaj lawm saib.

Peb puas tuaj yeem siv cov lus hloov tshiab hauv kev saib?

Koj tuaj yeem ntxig, hloov kho, thiab rho tawm kab hauv qhov pom, raug rau cov kev txwv hauv qab no:

  • Yog tias qhov pom muaj kev sib koom ntawm ntau lub rooj, koj tuaj yeem ntxig thiab hloov kho ib lub rooj hauv qhov saib, thiab koj tsis tuaj yeem rho tawm kab.
  • Koj tsis tuaj yeem hloov kho cov ntaub ntawv ncaj qha hauv kev pom raws li cov lus nug ntawm lub koomhaum.

Pom zoo: