Sql server® 2012 t-sql fundamentals



Download 10,93 Mb.
Pdf ko'rish
bet225/443
Sana26.01.2022
Hajmi10,93 Mb.
#411755
1   ...   221   222   223   224   225   226   227   228   ...   443
Bog'liq
BookSQL

 

CHAPTER 5

 

Table Expressions



 

 173

Before you look at the ENCRYPTION option, run the following code to alter the definition of the 



USACusts view to its original version.

ALTER VIEW Sales.USACusts 

AS 

 

SELECT 



  custid, companyname, contactname, contacttitle, address, 

  city, region, postalcode, country, phone, fax 

FROM Sales.Customers 

WHERE country = N'USA'; 

GO 

To get the definition of the view, invoke the OBJECT_DEFINITION function like this.



SELECT OBJECT_DEFINITION(OBJECT_ID('Sales.USACusts'));

The text with the definition of the view is available because the view was created without the 



ENCRYPTION option. You get the following output.

CREATE VIEW Sales.USACusts 

AS 

 

SELECT 



  custid, companyname, contactname, contacttitle, address, 

  city, region, postalcode, country, phone, fax 

FROM Sales.Customers 

WHERE country = N'USA'; 

Next, alter the view definition—only this time, include the ENCRYPTION option.

ALTER VIEW Sales.USACusts WITH ENCRYPTION 

AS 

 

SELECT 



  custid, companyname, contactname, contacttitle, address, 

  city, region, postalcode, country, phone, fax 

FROM Sales.Customers 

WHERE country = N'USA'; 

GO 

Try again to get the text with the definition of the view.



SELECT OBJECT_DEFINITION(OBJECT_ID('Sales.USACusts'));

This time you get a NULL back.

As an alternative to the OBJECT_DEFINITION function, you can use the sp_helptext stored proce-

dure to get object definitions. For example, the following code requests the object definition of the 



USACusts view.

EXEC sp_helptext 'Sales.USACusts';

www.it-ebooks.info



174  

Microsoft SQL Server 2012 T-SQL Fundamentals

Because in our case the view was created with the ENCRYPTION option, you will not get the object 

definition back, but instead you will get the following message.

The text for object 'Sales.USACusts' is encrypted.


Download 10,93 Mb.

Do'stlaringiz bilan baham:
1   ...   221   222   223   224   225   226   227   228   ...   443




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish