Sql server® 2012 t-sql fundamentals



Download 10,93 Mb.
Pdf ko'rish
bet394/443
Sana26.01.2022
Hajmi10,93 Mb.
#411755
1   ...   390   391   392   393   394   395   396   397   ...   443
Bog'liq
BookSQL

The 

EXEC

 Command

The EXEC command is the original technique provided in T-SQL for executing dynamic SQL. EXEC 

accepts a character string in parentheses as input and executes the batch of code within the character 

string. EXEC supports both regular and Unicode character strings as input.

The following example stores a character string with a PRINT statement in the variable @sql and 

then uses the EXEC command to invoke the batch of code stored within the variable.

DECLARE @sql AS VARCHAR(100); 

SET @sql = 'PRINT ''This message was printed by a dynamic SQL batch.'';'; 

EXEC(@sql);

Notice the use of two single quotes to represent one single quote in a string within a string. This 

code returns the following output.

This message was printed by a dynamic SQL batch.

www.it-ebooks.info



360  

Microsoft SQL Server 2012 T-SQL Fundamentals




Download 10,93 Mb.

Do'stlaringiz bilan baham:
1   ...   390   391   392   393   394   395   396   397   ...   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