System procedures

See Reference Manual: Procedures for details.

sp_activeroles

sp_activeroles [expand_down]

sp_addalias

sp_addalias loginame, name_in_db

sp_addauditrecord

sp_addauditrecord [text [, db_name [, obj_name
	[, owner_name [, dbid [, objid]]]]]]

sp_addaudittable

sp_addaudittable devname

sp_addengine

sp_addengine engine_number, engine_group

sp_addexeclass

sp_addexeclass classname, priority, timeslice, engine_group

sp_addextendedproc

sp_addextendedproc esp_name, dll_name

sp_addexternlogin

sp_addexternlogin remote_server, login_name, remote_name 
	[, remote_password] [role_name]

sp_addgroup

sp_addgroup grpname

sp_addlanguage

sp_addlanguage language, alias, months, shortmons, 
	days, datefmt, datefirst

sp_addlogin

sp_addlogin loginame, passwd [, defdb] 
	[, deflanguage] [, fullname] [, passwdexp]
	[, minpwdlen] [, maxfailedlogins]

sp_addmessage

sp_addmessage message_num, message_text 
	[, language [, with_log [, replace]]]

sp_addobjectdef

sp_addobjectdef tablename, "objectdef" [,"objecttype"]

sp_add_qpgroup

sp_add_qpgroup new_name

sp_addremotelogin

sp_addremotelogin remoteserver [, loginame [, remotename] ]

sp_add_resource_limit

sp_add_resource_limit name, appname, rangename, limittype, limitvalue 
	[, enforced [, action [, scope ]]]

sp_addsegment

sp_addsegment segname, dbname, devname

sp_addserver

sp_addserver “lname” [, class [,” pname”]]

sp_addthreshold

sp_addthreshold dbname, segname, free_space, proc_name

sp_add_time_range

sp_add_time_range name, startday, endday, starttime, endtime

sp_addtype

sp_addtype typename, 
	phystype [(length) | (precision [, scale])]
	[, "identity" | nulltype]

sp_addumpdevice

sp_addumpdevice {"tape" | "disk"}, logicalname,
	physicalname [, tapesize]

sp_adduser

sp_adduser loginame [, name_in_db [, grpname]]

sp_altermessage

sp_altermessage message_id, parameter, parameter_value

sp_audit

sp_audit option, login_name, object_name [,setting]

sp_autoconnect

sp_autoconnect server, {true|false} [, loginame]

sp_bindcache

sp_bindcache cachename, dbname
	[, [ownername.]tablename
	[, indexname | "text only"]]

sp_bindefault

sp_bindefault defname, objname [, futureonly]

sp_bindexeclass

sp_bindexeclass "object_name", "object_type", "scope", "classname"

sp_bindmsg

sp_bindmsg constrname, msgid

sp_bindrule

sp_bindrule rulename, objname [, futureonly]

sp_cacheconfig

sp_cacheconfig [cachename [ ,"cache_size[P|K|M|G]" ] 
	[,logonly | mixed ] [,strict | relaxed ] ]
	[, "cache_partition=[1|2|4|8|16|32|64]"]

sp_cachestrategy

sp_cachestrategy dbname, [ownername.]tablename 
	[, indexname | "text only" | "table only" 
	[, { prefetch | mru }, { "on" | "off"}]]

sp_changedbowner

sp_changedbowner loginame [, true ]

sp_changegroup

sp_changegroup grpname, username

sp_checknames

sp_checknames

sp_checkreswords

sp_checkreswords [user_name_param]

sp_checksource

sp_checksource [objname [, tabname [, username]]]

sp_chgattribute

sp_chgattribute objname, {"max_rows_per_page" | "fillfactor" | 
	"reservepagegap" | "exp_row_size"
	concurrency_opt_threshold | “optimistic_index_lock”}, value, optvalue
sp_chgattribute "table_name", "identity_gap", set_number
sp_chgattribute <table_name>, “dealloc_first_txtpg”,1

sp_clearpsexe

sp_clearpsexe spid, exeattr

sp_clearstats

sp_clearstats [loginame]

sp_client_addr

sp_client addr[“spid”]

sp_cmp_all_qplans

sp_cmp_all_qplans group1, group2 [, mode]

sp_cmp_qplans

sp_cmp_qplans id1, id2

sp_commonkey

sp_commonkey tabaname, tabbname, col1a, col1b 
	[, col2a, col2b, ..., col8a, col8b]

sp_companion

sp_companion 
	[server_name 
	{, configure
		[, {with_proxydb | NULL}] 
		[, srvlogin]
		[, server_password]
		[, cluster_login] 
		[, cluspassword]]
	| drop
	| suspend
	| resume
	| prepare_failback
	| do_advisory}
		{, all
		| help
		| group attribute_name 
		| base attribute_name}

sp_configure

sp_configure [configname [, configvalue] | group_name | 
	non_unique_parameter_fragment][number of histogram steps, n]
sp_configure "configuration file", 0, {"write" | "read" | "verify" | "restore"} 
	"file_name"

sp_copy_all_qplans

sp_copy_all_qplans src_group, dest_group

sp_copy_qplan

sp_copy_qplan src_id, dest_group

sp_countmetadata

sp_countmetadata "configname" [, dbname]

sp_cursorinfo

sp_cursorinfo [{cursor_level | null}] [, cursor_name]

sp_dbextend

sp_dbextend ['check' | 'clear' | 'disable' | 'enable' | 'execute'| 'help' | 
	'list' |'listfull'| 'modify'| 'reload defaults' | 'set'| 'simulate' | 'trace' |
	'version' | 'who' 

sp_dboption

sp_dboption [dbname, optname, {true | false}]

sp_dbrecovery_order

sp_dbrecovery_order [database_name [, rec_order [, force]]]

sp_dbremap

sp_dbremap dbname

sp_defaultloc

sp_defaultloc dbname, {"defaultloc"| NULL} [, "defaulttype"]

sp_depends

sp_depends objname[, column_name]

sp_deviceattr

sp_deviceattr logicalname, optname, optvalue

sp_diskdefault

sp_diskdefault logicalname, {defaulton | defaultoff}

sp_displayaudit

sp_displayaudit ["procedure" | "object" | "login" | "database" | "global" | 
	"default_object" | "default_procedure" [, "name"]]

sp_displaylevel

sp_displaylevel [loginame [, level]]

sp_displaylogin

sp_displaylogin [loginame [, expand_up | expand_down]]

sp_displayroles

sp_displayroles [grantee_name [, mode]]

sp_dropalias

sp_dropalias loginame

sp_drop_all_qplans

sp_drop_all_qplans name

sp_dropdevice

sp_dropdevice logicalname

sp_dropengine

sp_dropengine engine_number, engine_group

sp_dropexeclass

sp_dropexeclass classname

sp_dropextendedproc

sp_dropextendedproc esp_name

sp_dropexternlogin

sp_dropexternlogin remote_server [, login_name] [, role_name]

sp_dropglockpromote

sp_dropglockpromote {"database" | "table"}, objname

sp_dropgroup

sp_dropgroup grpname

sp_dropkey

sp_dropkey keytype, tabname [, deptabname]

sp_droplanguage

sp_droplanguage language [, dropmessages]

sp_droplogin

sp_droplogin loginame

sp_dropmessage

sp_dropmessage message_num [, language]

sp_dropobjectdef

sp_dropobjectdef "object_name"

sp_drop_qpgroup

sp_drop_qpgroup group

sp_drop_qplan

sp_drop_qplan id

sp_dropremotelogin

sp_dropremotelogin remoteserver [, loginame [, remotename] ]

sp_drop_resource_limit

sp_drop_resource_limit { name, appname }
	[, rangename, limittype, enforced, action, scope]

sp_droprowlockpromote

sp_droprowlockpromote {"database" | "table"}, objname

sp_dropsegment

sp_dropsegment segname, dbname [, device]

sp_dropserver

sp_dropserver server [, droplogins]

sp_dropthreshold

sp_dropthreshold dbname, segname, free_space

sp_drop_time_range

sp_drop_time_range name

sp_droptype

sp_droptype typename

sp_dropuser

sp_dropuser name_in_db

sp_dumpoptimize

sp_dumpoptimize [ ’archive_space = {maximum | minimum | default }’ ]
sp_dumpoptimize [ ’reserved_threshold = {nnn | default }’ ]
sp_dumpoptimize [ ’allocation_threshold = {nnn | default }’ ]

sp_engine

sp_engine {“online” | [offline | can_offline] [, engine_id] | 
[“shutdown”, engine_id]}

sp_estspace

sp_estspace table_name, no_of_rows, fill_factor,
cols_to_max, textbin_len, iosec, page_size

sp_export_qpgroup

sp_export_qpgroup usr, group, tab

sp_extendsegment

sp_extendsegment segname, dbname, devname

sp_extengine

sp_extengine 'ejb_server', '{ start | stop | status }'

sp_familylock

sp_familylock [fpid1 [, fpid2]]

sp_find_qplan

sp_find_qplan pattern [, group ]

sp_fixindex

sp_fixindex dbname, table_name, index_id

sp_flushstats

sp_flushstats objname

sp_forceonline_db

sp_forceonline_db dbname, {"sa_on" | "sa_off" | "all_users"}

sp_forceonline_object

sp_forceonline_object dbname, objname, indid,
	{sa_on | sa_off | all_users} [, no_print]

sp_forceonline_page

sp_forceonline_page dbname, pgid, 
	{"sa_on" | "sa_off" | "all_users"}

sp_foreignkey

sp_foreignkey tabname, pktabname, col1 [, col2] ... [, col8] 

sp_freedll

sp_freedll dll_name

sp_getmessage

sp_getmessage message_num, result output [, language]

sp_grantlogin

sp_grantlogin {login_name | group_name} ["role_list" | default]

sp_ha_admin

sp_ha_admnin [cleansessions | help]

sp_help

sp_help [objname]

sp_helpartition

sp_helpartition [table_name]

sp_helpcache

sp_helpcache {cache_name | "cache_size[P|K|M|G]"}

sp_helpconfig

sp_helpconfig "configname", ["size"]

sp_helpconstraint

sp_helpconstraint [objname] [, detail] 

sp_helpdb

sp_helpdb [dbname]

sp_helpdevice

sp_helpdevice [devname]

sp_helpextendedproc

sp_helpextendedproc [esp_name]

sp_helpexternlogin

sp_helpexternlogin [remote_server] [, login_name] [, role_name]

sp_helpgroup

sp_helpgroup [grpname]

sp_helpindex

sp_helpindex objname

sp_helpjava

 sp_helpjava ["class" [, java_class_name [, “detail” | “depends” ] ] | 
	"jar" [, jar_name [, “depends” ] ] ]

sp_helpjoins

sp_helpjoins lefttab, righttab

sp_helpkey

sp_helpkey [tabname]

sp_helplanguage

sp_helplanguage [language]

sp_helplog

sp_helplog

sp_helpobjectdef

sp_helpobjectdef [object_name]

sp_help_qpgroup

sp_help_qpgroup [ group [, mode ]]

sp_help_qplan

sp_help_qplan id [, mode ]

sp_helpremotelogin

sp_helpremotelogin [remoteserver [, remotename]]

sp_help_resource_limit

sp_help_resource_limit [name [, appname [, limittime
	[, limitday [, scope [, action]]]]]]

sp_helprotect

sp_helprotect [name [, username [, "grant" 
	[,"none"|"granted"|"enabled"|role_name]]]]

sp_helpsegment

sp_helpsegment [segname]

sp_helpserver

sp_helpserver [server]

sp_helpsort

sp_helpsort

sp_helptext

sp_helptext objname [,number]

sp_helpthreshold

sp_helpthreshold [segname]

sp_helpuser

sp_helpuser [name_in_db]

sp_hidetext

sp_hidetext [objname [, tabname [, username]]]

sp_import_qpgroup

sp_import_qpgroup tab, usr, group

sp_indsuspect

sp_indsuspect [tab_name]

sp_ldapadmin

sp_ldapadmin { set_primary_url, ‘ldapurl’ | 
	set_secondary_url, { ‘ldapurl’ | null } |
	list_urls | check_url, ‘ldapurl’ |
	check_login, ‘login_name’ }

ldapurl::=ldap://host:port/node/?attributes?base | one | sub?filter

sp_listener

sp_listener “command”, “server_name”, engine | remaining

Or:

sp_listener “command”, “[protocol:]machine:port”, engine

sp_listsuspect_db

sp_listsuspect_db

sp_listsuspect_object

sp_listsuspect_object [dbname]

sp_listsuspect_page

sp_listsuspect_page [dbname] 

sp_lock

sp_lock [spid1 [, spid2]]

sp_locklogin

sp_locklogin [loginame, "{lock | unlock}"]

sp_logdevice

sp_logdevice dbname, devname

sp_loginconfig

sp_loginconfig ["parameter_name"]

sp_logininfo

sp_logininfo ["login_name" | "group_name"]

sp_logiosize

sp_logiosize ["default" | "size" | "all"]

sp_modifylogin

sp_modifylogin {loginame | “all overrides”}, option, value

sp_modify_resource_limit

sp_modify_resource_limit {name, appname } 
	rangename , limittype , limitvalue , enforced , action , scope

sp_modify_time_range

sp_modify_time_range name, startday, endday, starttime, endtime

sp_modifystats

sp_modifystats [database].[owner].table_name,
	{“column_group” | “all”},
	MODIFY_DENSITY,
	{range | total},
	{absolute | factor},
	“value
sp_modifystats [database].[owner].table_name, 
	column_name,
	REMOVE_SKEW_FROM_DENSITY

sp_modifythreshold

sp_modifythreshold dbname, segname, free_space
	[, new_proc_name] [, new_free_space] [, new_segname]

sp_monitor

sp_monitor

sp_monitorconfig

sp_monitorconfig "configname" [ , “result_tbl_name”]

sp_object_stats

sp_object_stats interval [, top_n [, dbname, objname [, rpt_option ]]]

sp_passthru

sp_passthru server, command, errcode, errmsg, rowcount
	[, arg1, arg2, ... argn]

sp_password

sp_password caller_passwd, new_passwd [, loginame]

sp_placeobject

sp_placeobject segname, objname

sp_plan_dbccdb

sp_plan_dbccdb [dbname]

sp_poolconfig

To create a memory pool in an existing cache, or to change pool size:

sp_poolconfig cache_name [, "mem_size [P|K|M|G]", "config_poolK" 
[, "affected_poolK"]]

To change a pool’s wash size:

sp_poolconfig cache_name, "io_size ", "wash=size[P|K|M|G]"

To change a pool’s asynchronous prefetch percentage:

sp_poolconfig cache_name, "io_size ", 
"local async prefetch limit=percent "

sp_primarykey

sp_primarykey tabname, col1 [, col2, col3, ..., col8]

sp_processmail

sp_processmail [subject] [, originator [, dbuser
	[, dbname [, filetype [, separator]]]]]

sp_procxmode

sp_procxmode [procname [, tranmode]]

sp_recompile

sp_recompile objname

sp_remap

sp_remap objname

sp_remoteoption

sp_remoteoption [remoteserver [, loginame 
	[, remotename [, optname [, optvalue]]]]]

sp_remotesql

sp_remotesql server, query [, query2, ... , query254]

sp_rename

sp_rename objname, newname [,“index” | “column”]

sp_renamedb

sp_renamedb dbname, newname

sp_rename_qpgroup

sp_rename_qpgroup old_name, new_name

sp_reportstats

sp_reportstats [loginame]

sp_revokelogin

sp_revokelogin {login_name | group_name}

sp_role

sp_role {"grant" | "revoke"}, rolename, loginame

sp_sendmsg

sp_sendmsg ip_address, port_number, message

sp_serveroption

sp_serveroption [server, optname, optvalue]

sp_setlangalias

sp_setlangalias language, alias

sp_setpglockpromote

sp_setpglockpromote {"database" | "table"}, objname, new_lwm, 
	new_hwm, new_pct
sp_setpglockpromote server, NULL, new_lwm, new_hwm, new_pct 

sp_setpsexe

sp_setpsexe spid, exeattr, value

sp_set_qplan

sp_set_qplan id, plan

sp_setrowlockpromote

sp_setrowlockpromote "server", NULL, new_lwm, new_hwm, new_pct
sp_setrowlockpromote {"database" | "table"}, objname, new_lwm, 
	new_hwm, new_pct

sp_setsuspect_granularity

sp_setsuspect_granularity [dbname 
	[, "database" | "page" [, "read_only"]]]

sp_setsuspect_threshold

sp_setsuspect_threshold [dbname [, threshold]]

sp_showcontrolinfo

sp_showcontrolinfo [object_type, object_name, spid ]

sp_showexeclass

sp_showexeclass [execlassname]

sp_showplan

sp_showplan spid, batch_id output, context_id output, stmt_num output

sp_showpsexe

sp_showpsexe [spid]

sp_spaceused

sp_spaceused [objname [,1] ]

sp_ssladmin

sp_ssladmin [addcert, certificate_path [, password | NULL]]
sp_ssladmin [dropcert, certificate_path]
sp_ssladmin [lscert]
sp_ssladmin [help]

sp_syntax

sp_syntax word [, mod][, language]

sp_sysmon

sp_sysmon begin_sample
sp_sysmon { end_sample | interval } [, section [, applmon] ]
sp_sysmon { end_sample | interval } [, applmon ]

sp_tempdb

sp_tempdb [
	[ { create | drop } , groupname ] | 
	[ { add | remove } , tempdbname, groupname ] | 
	[ { bind, objtype, objname, bindtype, bindobj [, scope, hardness ] } | 
		{ unbind, objtype, objname [, scope ] } ] | 
	[ unbindall_db, tempdbname ] | 
	[ show [, "all" | "gr" | "db" | "login" | "app" [, name ] ] | 
	[ who, dbname ] 
	[ help ] 
]

sp_thresholdaction

sp_thresholdaction @dbname,
	@segment_name,
	@space_left,
	@status

sp_transactions

sp_tranactions ["xid", xid_value] | 
	["state", {"heuristic_commit" | "heuristic_abort" 
	| "prepared" | "indoubt"} [, "xactname"]] |
	["gtrid", gtrid_value]

sp_unbindcache

sp_unbindcache dbname [,[owner.]tablename 
	[, indexname | "text only"]] 

sp_unbindcache_all

sp_unbindcache_all cache_name

sp_unbindefault

sp_unbindefault objname [, futureonly]

sp_unbindexeclass

sp_unbindexeclass object_name, object_type, scope

sp_unbindmsg

sp_unbindmsg constrname

sp_unbindrule

sp_unbindrule objname [, futureonly [, “accessrule” | “all”]]

sp_volchanged

sp_volchanged session_id, devname, action[, fname [, vname]]

sp_who

sp_who [loginame | "spid"]