成人性生交大片免费看视频r_亚洲综合极品香蕉久久网_在线视频免费观看一区_亚洲精品亚洲人成人网在线播放_国产精品毛片av_久久久久国产精品www_亚洲国产一区二区三区在线播_日韩一区二区三区四区区区_亚洲精品国产无套在线观_国产免费www

主頁 > 知識庫 > 一些SQLServer存儲過程參數(shù)及舉例

一些SQLServer存儲過程參數(shù)及舉例

熱門標簽:申請400電話在哪辦理流程 電銷外呼有錄音系統(tǒng)有哪些 臨沂智能電銷機器人加盟哪家好 外呼運營商線路收費 百度地圖標注改顏色 小e電話機器人 一個導航軟件能用幾個地圖標注點 貴州房產(chǎn)智能外呼系統(tǒng)供應(yīng)商 鎮(zhèn)江網(wǎng)路外呼系統(tǒng)供應(yīng)商

Microsoft included several hundred stored procedures in the various versions of Microsoft SQL Server and it has documented a good percentage of them. But many stored procedures remain undocumented. Some are used within the Enterprise Manager GUI in SQL 2000 and were not intended to be used by other processes. Microsoft has slated some of these stored procedures to be removed (or they have been removed) from future versions of SQL Server. While these stored procedures can be very useful and save you lots of time, they can be changed at any time in their function or they can simply be removed.

The chart below shows that while many of the procedures have been carried through from one version of Microsoft SQL Server to another, new stored procedures have been introduced, and some have been removed from the install package. Most, if not all, of the procedures require the user to be a member of the sysadmin fixed server role in order to execute the procedures. The stored procedures that interact with the file system also require that the user executing the procedure (as well as SQL Server's service account) have access to the file/folder.

Procedure Name SQL 2000 SQL 2005 SQL 2008
sp_executeresultset X    
sp_MSforeachdb X X X
sp_MSforeachtable X X X
sp_readerrorlog X X X
xp_create_subdir   X X
Xp_delete_file   X X
xp_dirtree X X X
xp_fileexist X X X
xp_fixeddrives X X X
xp_getfiledetails X    
xp_getnetname X X X
xp_loginconfig X X X
xp_makecab X    
xp_msver X X X
xp_get_mapi_profiles X X X
xp_subdirs X X X
xp_test_mapi_profile X X X
xp_unpackcab X    

sp_executeresultset

Microsoft removed this handy little procedure called sp_executeresultset from SQL Server in SQL Server 2005. It allows you to generate dynamic SQL code on the fly by using a SELECT query. Then, the resulting SQL commands will be executed against the database. It permits you to create a single piece of code that can, in a single step, find the number of records in every table in your database (as the example shows). This is an undocumented stored procedure and there is no way of knowing why it was removed. But, alas, this handy utility is gone.

exec sp_execresultset 'SELECT ''SELECT '''''' + name + '''''',
count(*) FROM '' + name
from sysobjects
where xtype = ''U'''

sp_MSforeachdb / sp_MSforeachtable

Two procedures, sp_MSforeachdb and sp_MSforeachtable, are wrappers around a cursor. They allow you to execute T-SQL code against each database on your SQL Server and each table within the current database, respectively. You cannot, however, use an sp_MSforeachtable command within an sp_MSforeachdb command in SQL 2000 and prior. The cursor name that was used within those procedures was the same (hCForEach) and would therefore return an error saying that the cursor name was already in use for each execution of the sp_MSforeachtable. In SQL Server 2005, Microsoft resolved this issue. In order to "next" the command, you must tell one of the procedures it will be using a different replacement character other than the default question mark. I change the replacement character in the database command because it's easier.

Print each table name in the current database.

exec sp_MSforeachtable 'print ''?'''

Print each database on the current server.

exec sp_MSforeachdb 'print ''?'''

Print each table on the current server.

exec sp_MSforeachdb 'use [@] exec sp_MSforeachtable ''print
''''@.?''''''', '@'

sp_readerrorlog / xp_readerrorlog

The stored procedure sp_readerrorlog actually comes in two forms. Each works the same; one is simply a wrapper for the second. The wrapper stored procedure is sp_readerrorlog and it calls xp_readerrorlog. Both have four input parameters, but only the first two are useful to us. The first parameter establishes the file number that you wish to view. The second is the log to view (1 or null for ERRORLOG, 2 for SQL Agent Log). This allows you to view your error logs quickly and easily instead of having to look at the bloated log viewer that now comes with SQL Server 2005 and SQL 2008.

View the current SQL ERRORLOG file.

exec sp_readerrorlog

exec sp_readerrorlog 0, 1

View the Prior SQL Agent Log file.

exec sp_readerrorlog 1, 2

xp_create_subdir

Introduced in SQL Server 2005, the xp_create_subdir stored procedure is very handy because you can use it to create folders on SQL Server's hard drive or on a network share from within T-SQL.

exec xp_create_subdir 'c:\MSSQL\Data'

xp_delete_file

Use the xp_delete_file stored procedure introduced in SQL Server 2005 to delete files from SQL Server's hard drive or a network share from within T-SQL.

xp_dirtree

The xp_dirtree procedure allows you to view the folder tree and/or file list beneath a folder. This procedure has several parameters that control how deep the procedure searches and whether it returns files and folders or folders only. The first parameter establishes the folder to look in. (Recommendation: Do not run this procedure against the root of the drive that Windows is installed on because it will take some time to generate the tree and return the data.) The second parameter limits the number of recursive levels that the procedure will dig through. The default is zero or all levels. The third parameter tells the procedure to include files. The default is zero or folders only, a value of 1 includes files in the result set. Specifying a third value not equal to zero will add an additional column to the output called file which is a bit field showing the entry in a folder or file.

Get the full directory tree.

exec xp_dirtree 'd:\mssql\'

Get the first two levels of the directory tree.

exec xp_dirtree 'd:\mssql', 2

Get the first three levels of the directory tree, including files.

exec xp_dirtree 'd:\mssql\', 3, 1

xp_fileexist

This SQL Server stored procedure, xp_fileexist, is used to determine if a file exists on SQL Server's hard drive or on a network share. It is extremely useful in stored procedures that load data from flat files. It allows you to check and see if the file exists before attempting to blindly load the file. The procedure has two parameters. Use the first parameter to determine if the file or folder you want exists. The second is an output parameter, which when specified, returns a 1 or 0 if the file exists or does not.

Without the parameter.

exec xp_fileexist 'c:\importfile.csv'

With the parameter.

DECLARE @file_exists int
exec xp_fileexist 'c:\importfile.csv', @file_exists OUTPUT
SELECT @file_exists
 

xp_fixeddrives

The procedure xp_fixeddrives is one of the most useful procedures. It presents a list of all drive letters and the amount of free space each drive has. The parameter has a single optional input parameter that can filter the results by drive type. A value of 3 will return all mass storage devices (CD-ROM, DVD, etc.); a value of 4 will return the hard drives; while a value of 2 will return removable media (USB thumb drives, flash drives, etc.).

Return all drives.

exec xp_fixeddrives

Return hard drives only.

exec xp_fixeddrives 2

xp_getfiledetails

The procedure xp_getfiledetails is another extremely useful procedure, which was last available in SQL Server 2000. This procedure returns size, date and attribute information about the file specified, including date and times created, accessed and modified.

exec xp_getfiledetails 'c:\filetoload.csv'

xp_getnetname

The procedure xp_getnetname returns the name of the physical machine where Microsoft SQL Server is installed. You can have the machine name returned as a record set or as a variable.

Without the parameter.

exec xp_getnetname

Using the parameter.

DECLARE @machinename sysname
exec xp_getnetname @machinename OUTPUT
select @machinename
 

xp_loginconfig

This SQL Server stored procedure will tell you some basic authentication information about the user executing it. It tells you the authentication method (Windows versus SQL Login), the default domain of the server, the audit level, as well as some internal separator information.

exec xp_loginconfig

xp_makecab

Back in SQL Server 2000, Microsoft gave us the ability to compress OS files directly from T-SQL without having to shell out to DOS via xp_cmdshell and run third-party software, like pkzip or winzip. That command was xp_makecab. It allows you to specify a list of files you want to compress as well as the cab file you want to put them in. It even lets you select default compression, MSZIP compression (akin to the .zip file format) or no compression. The first parameter gives the path to the cab file in which you want to create or add files to. The second parameter is the compression level. The third parameter applies if you want to use verbose logging. Starting with the fourth parameter and on down are the names of the files you want to compress. In my testing, I was able to pass 45 file names to be compressed to the extended stored procedure, which means that it is a very flexible solution to your data compression requirements.

exec xp_makecab 'c:\test.cab', 'mszip', 1, 'c:\test.txt' , 'c:\test1.txt'

xp_msver

The procedure xp_msver is very useful when looking for system information. It returns a wealth of information about the host operating system -- the SQL version number, language, CPU type, copyright and trademark information, Microsoft Windows version, CPU count and affinity settings, physical memory settings and your product key. This procedure has many input parameters that allow you to filter down the records that are returned. Each parameter is a sysname data type, which accepts the name of one of the records. If any parameters are specified, only the rows specified as a parameter are returned.

No filter specified.

exec xp_msver

Return only Platform and Comments records.

exec xp_msver 'Platform', 'Comments'

xp_get_mapi_profiles

The xp_get_mapi_profiles procedure assists you in configuring SQL Mail. When executed, it will call to Windows via the SQL Mail component of SQL Server and display a list of available MAPI profiles that are configured in Outlook and it specifies which profile is the default profile. If it doesn't display any records, then either Outlook is not configured correctly or SQL Server is not running under a domain account with Outlook profiles configured. In order to use this procedure in SQL Server 2005 or SQL Server 2008, you must enable the "SQL Mail XPs" option in the Surface Area Configuration tool or within the sp_configure procedure.

exec xp_get_mapi_profiles

xp_subdirs

The xp_subdirs procedure displays a subset of the information avaialble through xp_dirtree. Xp_subdirs will display all the subfolders in a given folder. It can be very handy when you are building a directory tree within a table dynamically and you do not want to worry about the extra parameters of the xp_dirtree procedure.

exec xp_subdirs 'd:\mssql'

xp_test_mapi_profiles

The procedure xp_test_mapi_profiles is another undocumented stored procedure that is very useful when you are setting up SQL Mail. It will start, then stop, a MAPI session to ensure that MAPI is configured correctly and working within the confines of Microsoft SQL Server. I should note that it does not verify the mail server configuration within the MAPI client (Outlook) nor does it send a test message.

The procedure accepts a single input parameter. That parameter is the name of the MAPI profile you wish to test. Like the xp_get_mapi_profiles procedure, for this stored procedure to function in SQL Server 2005 and SQL Server 2008, you must enable the "SQL Mail XPs" option in the Surface Area Configuration tool or within the sp_configure procedure.

When working with the SQL Mail stored procedures, be aware that SQL Mail is still slated for removal from the Microsoft SQL Server platform. That means the procedures sp_get_mapi_profiles and xp_test_mapi_profiles are slated for removal, as they are part of the SQL Mail subsystem. You should do all mail work on SQL Server 2005 and later using Database Mail instead of SQL Mail to ensure code portability with future versions of SQL Server. Microsoft initially slated SQL Mail for removal in SQL Server 2008, however, based on its inclusion in the current beta release, its future in SQL Server 2008 is unknown.

xp_unpackcab

Along with the xp_makecab procedure comes the xp_unpackcab extended stored procedure, and it does just what it says: It extracts files from cab files. The first paramater is the cab file, the second is the path you want to extract to and the third is verbose logging. A fourth paramater lets you specify the "extract to" file name.

exec xp_unpackcab 'c:\test.cab', 'c:\temp', 1

While this is not intended to be a complete list of the undocumented stored procedures in SQL Server, it does provide a reference point for many of these procedures with the hope of making the lives of the SQL Server administrators easier. Remember, you should never count on these procedures surviving from one SQL Server version to the next, nor should you expect their code base to remain the same between versions. That said, go code and enjoy.

All information provided about Microsoft SQL Server 2008 (Katmai) is based on beta edition 10.0.1019 of the software and is subject to change without notice.

標簽:三明 晉城 合肥 嘉興 澳門 延邊 日照 保定

巨人網(wǎng)絡(luò)通訊聲明:本文標題《一些SQLServer存儲過程參數(shù)及舉例》,本文關(guān)鍵詞  一些,SQLServer,存儲,過程,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《一些SQLServer存儲過程參數(shù)及舉例》相關(guān)的同類信息!
  • 本頁收集關(guān)于一些SQLServer存儲過程參數(shù)及舉例的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    夜夜嗨av一区二区三区四区| 国产精品日韩久久久久| 在线资源av| 精品三级在线观看视频| 中文字幕日本最新乱码视频| 久热国产精品视频一区二区三区| 91插插插插插插插插| 99国产在线视频| 久久久av网站| 欧洲国内综合视频| 天堂在线免费观看| 国产精品国内视频| 波多野结衣家庭教师在线| 欧美 日韩 亚洲 一区| 精品国产一区二区三区久久久| 91麻豆精品国产自产在线观看一区| 免费人成短视频在线观看网站| 国产美女直播视频一区| 亚洲av成人片色在线观看高潮| 在线中文免费视频| 欧美13一14另类| 国产精品欧美三级在线观看| 久久视频这里有精品| 国产欧美一区二区精品忘忧草| 超碰网在线观看| 国产精品国产高清国产| www.男人的天堂.com| 牛牛精品视频在线| 亚洲a视频在线| 国产免费一区二区| 日韩有码在线电影| 成人一区二区三区中文字幕| 国产黄色片免费观看| 欧美色视频一区| 国产午夜福利一区二区| 成年人黄视频在线观看| 豆国产97在线 | 亚洲| 精久久久久久久久久久| 欧美freesex黑人又粗又大| 国产chinese男男gaygay网站| 欧美电影免费提供在线观看| 奇米四色中文综合久久| 成人听书哪个软件好| jizz欧美性11| 91免费观看网站| 91社在线播放| 九色国产在线观看| 久久99蜜桃精品| 亚洲综合另类小说| 亚洲五月激情网| 国产精品福利在线观看| 在线观看精品视频一区二区三区| 深夜日韩欧美| 国产精品男女| 99视频精品全部免费在线| 亚洲国产综合在线| 91成人天堂久久成人| 黄动漫在线观看| 亚洲无在线观看| 超碰97久久国产精品牛牛| 牛牛电影国产一区二区| 欧美理论电影在线观看| 日韩一区二区三区电影在线观看| 在线中文av| 成人在线免费av| 中文字幕欧美日韩va免费视频| 欧美高清视频www夜色资源网| 最新中文字幕免费| 99视频精品视频高清免费| 色多多国产成人永久免费网站| porn视频在线观看| 国产乱淫av片杨贵妃| 天天影视色香欲综合网老头| 精品国产亚洲一区二区三区在线| 全部免费的黄色毛片| 亚洲国产精品va在看黑人| 伊人在线视频观看| av免费在线网址| 日韩欧美一级特黄在线播放| 国外成人福利视频| 国模吧精品视频| 中文字幕日韩欧美精品在线观看| 最近2019免费中文字幕视频三| 91国偷自产一区二区三区成为亚洲经典| 奴色虐av一区二区三区| 中文字幕免费在线观看视频| 成人在线中文字幕| 蜜桃久久精品乱码一区二区| 国产精品免费精品一区| 日韩一级欧美一级| 免费黄色网址在线观看| 大桥未久一区二区三区| 男女免费观看在线爽爽爽视频| 亚洲深爱激情| 国产一区二区三区在线观看| 亚洲一二三区av| 国产专区第一页| 成人蜜桃视频| 99热这里只有精品3| 国产精品国产精品国产专区不卡| 日韩第一区第二区| 麻豆视频免费在线观看| 国产丝袜一区二区三区| caoporn成人免费视频在线| 波多野结衣中文一区| 极品尤物久久久av免费看| 四虎a级欧美在线观看| 日韩精品黄色网| 99久热这里只有精品视频免费观看| 欧美成人午夜激情| 国产在线拍偷自揄拍精品| 久久久久久国产精品视频| 黄色片网站免费在线观看| 免费av一区| 欧美一级在线免费| 91久久精品久久国产性色也91| 国产欧美日韩精品a在线观看| 国产精品夫妻激情| 久久久精品国产sm调教网站| 中文字幕视频一区二区| 91看片淫黄大片一级| 亚洲你懂的在线视频| 成年人视频网站免费| www.久久爱.com| 亚洲男人天堂一区| 怡红院av一区二区三区| www在线播放| 影院欧美亚洲| ed2k情侣啪啪91av| 精品国产18久久久久久洗澡| 日韩欧美精品中文字幕| 欧美尺度大的性做爰视频| 青青草社区视频| 欧美日韩亚洲一区| 成人在线丰满少妇av| 亚洲一区二区美女| 亚洲精品1区| 国产精品久久久免费观看| av一区在线观看| 国v精品久久久网| 欧美亚洲免费在线| 东热在线免费视频| 成人性教育视频在线观看| 午夜在线视频一区二区区别| 性高潮久久久久久| 亚洲婷婷综合网| 国产精品国产三级国产在线观看| 久久福利资源站| 欧美激情在线有限公司| 欧美午夜激情影院| 在线一区免费| 怡红院成永久免费人全部视频| 亚洲综合视频1区| 国内揄拍国内精品久久| 日韩亚洲欧美一区二区| 久久亚洲国产精品成人av秋霞| 天天干视频在线| 国产最新精品视频| 亚洲综合色视频| 欧美极品jizzhd欧美仙踪林| 成人精品视频99在线观看免费| 欧美日韩麻豆| 国内精品在线视频| www.国产欧美| 黄色成年人视频在线观看| 亚洲精品国产精品乱码不卡| 国产精品久久免费看| 麻豆av免费在线观看| 国产亚洲观看| 成人免费观看视频大全| 成人福利电影| 波多野结衣绝顶大高潮| 一个人看的www久久| 六月亚洲精品一区| 六月丁香婷婷色狠狠久久| 91小视频xxxx网站在线| 亚洲成人免费在线观看| 中文字幕中文在线不卡住| 国产高潮av| 韩国女同性做爰三级| 中日韩美女免费视频网址在线观看| 国产精品久久一卡二卡| 国产又粗又猛又爽又黄的| 日韩电影免费观看高清完整版在线观看| 日韩小视频在线播放| sm在线播放| 激情 小说 亚洲 图片: 伦| 激情欧美成人久久综合小说| 国产av自拍一区| 日本成人精品视频| 国产精品久久久久久久久果冻传媒| 中文字幕的av| 亚洲综合小说区| 中文字幕亚洲精品一区| 亚洲av无码久久精品色欲| 最近中文字幕mv第三季歌词| www.爱色av.com| 免费在线视频欧美| 欧美精品三级在线| 亚洲三级电影在线观看| 91视频免费网址| 水野朝阳av一区二区三区| 一区二区三区在线播| 女人被狂躁到高潮视频免费网站| 久久综合免费视频| 中文先锋资源| 成人久久一区二区三区| 国产 日韩 欧美 综合| 中文字幕+乱码+中文乱码www| 青梅竹马是消防员在线| 日本高清视频一区二区| 国产成人福利夜色影视| 97超碰最新| 黄在线观看网站| 国产精品久久婷婷六月丁香| missav|免费高清av在线看| 97成人在线观看视频| 欧美深深色噜噜狠狠yyy| 99久久精品国产观看| 国产精品www色诱视频| 日韩精品一区二区三区不卡| 成人国产精品入口免费视频| 日日夜夜亚洲| 久久福利免费视频| 国产精品免费在线视频| 国产精品美女一区二区在线观看| 久久久人成影片一区二区三区观看| 精品一区在线播放| 亚洲精品成人久久久998| 日韩欧美国产一区二区| 久青草视频在线播放| 日韩三级电影| 色欲av永久无码精品无码蜜桃| 色www亚洲国产阿娇yao| 中文字幕日韩电影| 香蕉精品视频在线| 欧美性色欧美a在线播放| 久久精品第九区免费观看| а√天堂www在线а√天堂视频| 国产精品视频白浆合集| 亚洲小视频网站| 久久久123| 久久99久久人婷婷精品综合| 亚洲伦理中文字幕| 日韩av免费大片| 无码日本精品xxxxxxxxx| 欧美激情福利| 亚洲自拍偷拍区| 国产性xxxx高清| 日本韩国在线观看| 精品伦理一区二区| 日韩电影免费网站| av在线免费播放网站| 久久久久久久午夜| 免费网站免费进入在线| 黑人中文字幕一区二区三区| 亚洲第一成年人网站| 欧美 日韩 国产 在线| 无码人妻精品一区二| 三级av在线| 欧美丰满少妇xxxxx高潮对白| а 天堂 在线| 亚洲自拍高清视频网站| 美女免费视频一区二区| 日本激情一区二区三区| 色婷婷精品大视频在线蜜桃视频| 久久视频精品在线观看| 影音先锋男人在线资源| 久久久久久久中文字幕| 日韩一区二区三区电影在线观看| 免费免费啪视频在线观播放| 日韩在线播放视频| 日韩av色在线| 久久这里有精品视频| 久久这里只有精品6| 国产传媒日韩欧美成人| 91av在线免费播放| 第一页在线观看| 欧洲vodafone精品| seerx性欧美巨大| 精品国产乱码久久久久久蜜柚| 欧美白人最猛性xxxxx69交| 被灌满精子的波多野结衣| 欧美在线视频观看| 丁香花高清电影在线观看完整版| 日韩视频免费在线观看| 韩国视频一区二区三区| 亚洲人www| 秋霞午夜av一区二区三区| 青青青青在线| 国产亚洲精品日韩| 男人插女人下面免费视频| **毛片在线网站| 国产精品大全| 成人18视频免费69| 美女翘臀白浆直流视频| 国产精品69久久久久水密桃| 97最新国自产拍视频在线完整在线看| 特大巨黑人吊性xxxxn38| 亚洲精品视频免费观看| 国产成人av一区二区| 成年人免费在线视频网站| 中文字幕日韩在线| 波多野结衣亚洲一二三| 嫩草一区二区三区| 欧美日韩裸体免费视频| 久久影视免费观看| 国产精品人妻一区二区三区| 日本午夜精品电影| 亚洲美腿欧美激情另类| sm性调教片在线观看| 精品久久亚洲| 天天插天天操天天干| 大胆高清日本a视频| 欧美亚洲精品一区| 精品处破女学生| 亚洲韩国一区二区三区| 成人在线手机视频| 日本欧美一区二区三区不卡视频| 中文字幕无码人妻少妇免费| 亚洲欧美综合另类在线卡通| 九9re精品视频在线观看re6| 欧美一级在线| 久久亚洲国产成人精品性色| 91麻豆免费视频网站| 蝴蝶中文综合娱乐网| 美女黄毛**国产精品啪啪| 日韩欧美精品在线视频|