New Features in Transact-SQL

Microsoft® Transact-SQL provides new and extended functionality that allows greater control and flexibility for the Transact-SQL programmer.

The additions and enhancements are organized by feature. For items listed by component type, see these topics:

Attaching and Detaching Databases

Microsoft SQL Server™ provides extended SQL statements and new system stored procedures for attaching and detaching databases.

ALTER DATABASE FOR ATTACH sp_attach_single_file_db
CREATE DATABASE FOR ATTACH sp_detach_db
sp_attach_db  

Cursor Support

SQL Server enhances cursor support.

cursor sp_describe_cursor_columns
sp_cursor_list sp_describe_cursor_tables
sp_describe_cursor  

Deferred Name Resolution

Deferred name resolution allows SQL Server stored procedures and triggers to reference the names of objects that do not yet exist. For more information, see Deferred Name Resolution and Compilation.

Files and Filegroups

SQL Server creates a database by using a set of operating-system files. These new or extended SQL statements support the use of files and filegroups:

ALTER DATABASE CREATE INDEX
ALTER TABLE CREATE TABLE
BACKUP RESTORE
CREATE DATABASE  

Distributed Queries

Microsoft SQL Server supports distributed queries, which use a four-part database object naming scheme. For information about distributed queries, see Distributed Queries. These new functions and new or enhanced stored procedures are used with distributed queries:

OPENQUERY sp_foreignkeys
OPENROWSET sp_indexes
sp_addlinkedserver sp_linkedservers
sp_addlinkedsrvlogin sp_primarykeys
sp_catalogs sp_serveroption
sp_columns_ex sp_tables_ex
sp_droplinkedsrvlogin sysoledbusers

Full-text Querying

SQL Server provides these new functions and stored procedures for full-text querying:

CONTAINS sp_fulltext_service
CONTAINSTABLE sp_fulltext_table
FREETEXT sp_help_fulltext_catalogs
FREETEXTTABLE sp_help_fulltext_catalogs_cursor
FULLTEXTCATALOGPROPERTY sp_help_fulltext_tables
FULLTEXTSERVICEPROPERTY sp_help_fulltext_tables_cursor
OBJECTPROPERTY sp_help_fulltext_columns
sp_fulltext_catalog sp_help_fulltext_columns_cursor
sp_fulltext_column sysfulltextcatalogs
sp_fulltext_database  

Information Schema Views

Information schema views provide table-independent access to the SQL Server metadata and allow applications to work properly even if significant changes have been made to the system tables. For more information, see Information Schema Views.

Job Processing

SQL Server job processing has changed from earlier versions of SQL Server. For more information, see Implementing Jobs. These stored procedures support the enhanced job processing functionality:

sp_add_alert sp_help_targetserver
sp_add_category sp_help_targetservergroup
sp_add_job sp_manage_jobs_by_login
sp_add_jobschedule sp_msx_defect
sp_add_jobserver sp_msx_enlist
sp_add_jobstep sp_post_msx_operation
sp_add_notification sp_purge_jobhistory
sp_add_operator sp_remove_job_from_targets
sp_add_targetservergroup sp_resync_targetserver
sp_add_targetsvrgrp_member sp_start_job
sp_apply_job_to_targets sp_stop_job
sp_delete_category sp_update_alert
sp_delete_job sp_update_category
sp_delete_jobschedule sp_update_job
sp_delete_jobserver sp_update_jobschedule
sp_delete_jobstep sp_update_jobstep
sp_delete_notification sp_update_notification
sp_delete_operator sp_update_operator
sp_delete_targetserver sp_update_targetservergroup
sp_delete_targetservergroup syscategories
sp_delete_targetsvrgrp_member sysdownloadlist
sp_help_category sysjobhistory
sp_help_downloadlist sysjobs
sp_help_job sysjobschedules
sp_help_jobhistory sysjobservers
sp_help_jobschedule sysjobsteps
sp_help_jobserver systargetservergroupmembers
sp_help_jobstep systargetservergroups
sp_help_notification systargetservers
sp_help_operator systaskids

Optimizer Hints

Optimizer hints have been added to the DELETE, INSERT, SELECT, and UPDATE statements.

Parallel Queries

SQL Server supports parallel execution of individual queries. Queries that must examine a large number of rows to produce a small result set such as joins, aggregations, or unions, can benefit from having portions of their execution plans run in parallel on multiple processors. For more information, see Parallel Query Processing.

Property Functions

SQL Server supports these new or extended property-related functions:

COLUMNPROPERTY INDEXPROPERTY
DATABASEPROPERTY OBJECTPROPERTY
FILEGROUPPROPERTY TYPEPROPERTY
FILEPROPERTY  

Replication

SQL Server replication has changed from earlier versions of SQL Server. These stored procedures and system tables support the enhanced replication functionality:

sp_add_agent_parameter sp_helpreplicationdboption
sp_add_agent_profile sp_helpsubscription
sp_adddistpublisher sp_helpsubscription_properties
sp_adddistributiondb sp_link_publication
sp_addmergearticle sp_mergedummyupdate
sp_addmergefilter sp_mergesubscription_cleanup
sp_addmergepublication sp_refreshsubscriptions
sp_addmergepullsubscription sp_reinitmergepullsubscription
sp_addmergepullsubscription_agent sp_reinitmergesubscription
sp_addmergesubscription sp_reinitpullsubscription
sp_addpublication_snapshot sp_reinitsubscription
sp_addpublisher70 sp_replicationdboption
sp_addpullsubscription sp_replication_agent_checkup
sp_addpullsubscription_agent sp_replshowcmds
sp_addsubscriber_schedule sp_removedbreplication
sp_addsynctriggers sp_revoke_publication_access
sp_articlesynctranprocs sp_script_synctran_commands
sp_browsereplcmds sp_scriptdelproc
sp_change_agent_parameter sp_scriptinsproc
sp_change_agent_profile sp_scriptmappedupdproc
sp_change_subscription_properties sp_scriptupdproc
sp_changedistpublisher sp_subscription_cleanup
sp_changedistributiondb MSagent_parameters
sp_changedistributor_property MSagent_profiles
sp_changedistributor_password MSarticles
sp_changemergearticle MSdistpublishers
sp_changemergefilter MSdistributiondbs
sp_changemergepublication MSdistribution_agents
sp_changemergepullsubscription MSdistribution_history
sp_changemergesubscription MSdistributor
sp_changesubscriber_schedule MSlogreader_agents
sp_check_for_sync_trigger MSlogreader_history
sp_deletemergeconflictrow MSmerge_agents
sp_drop_agent_parameter MSmerge_contents
sp_drop_agent_profile MSmerge_delete_conflicts
sp_dropdistpublisher MSmerge_genhistory
sp_dropdistributiondb MSmerge_history
sp_dropmergearticle MSmerge_replinfo
sp_dropmergefilter MSmerge_subscriptions
sp_dropmergepublication MSmerge_tombstone
sp_dropmergepullsubscription MSpublication_access
sp_dropmergesubscription MSpublications
sp_droppullsubscription MSpublisher_databases
sp_dumpparamcmd MSreplication_objects
sp_enumcustomresolvers MSreplication_subscriptions
sp_expired_subscription_cleanup MSrepl_commands
sp_get_distributor MSrepl_errors
sp_grant_publication_access MSrepl_originators
sp_help_agent_default MSrepl_transactions
sp_help_agent_parameter MSrepl_version
sp_help_agent_profile MSsnapshot_agents
sp_helpdistpublisher MSsnapshot_history
sp_helpdistributiondb MSsubscriber_info
sp_helpmergearticle MSsubscriber_schedule
sp_helpmergearticleconflicts MSsubscriptions
sp_helpmergeconflictrows MSsubscription_properties
sp_helpmergedeleteconflictrows sysarticleupdates
sp_helpmergefilter sysmergearticles
sp_helpmergepublication sysmergepublications
sp_helpmergepullsubscription sysmergeschemachange
sp_helpmergesubscription sysmergesubscriptions
sp_help_publication_access sysmergesubsetfilters
sp_helppullsubscription sysreplicationalerts

Showplan

Showplan output options have changed considerably. SET SHOWPLAN_TEXT provides showplan information in text format. SET SHOWPLAN_ALL sends showplan information to another program for further display enhancement.

Security

SQL Server provides enhanced security through these new or extended functions, statements, and stored procedures:

DENY sp_droprole
IS_MEMBER sp_droprolemember
IS_SRVROLEMEMBER sp_dropsrvrolemember
REVOKE sp_grantdbaccess
SUSER_SID sp_grantlogin
SUSER_SNAME sp_helpdbfixedrole
sp_addapprole sp_helpntgroup
sp_addlinkedsrvlogin sp_helprole
sp_addrole sp_helprolemember
sp_addrolemember sp_helpsrvrole
sp_addsrvrolemember sp_helpsrvrolemember
sp_approlepassword sp_revokedbaccess
sp_changeobjectowner sp_revokelogin
sp_dbfixedrolepermission sp_setapprole
sp_denylogin sp_srvrolepermission
sp_dropapprole sp_validatelogins
sp_droplinkedsrvlogin  

SQL Server Profiler Extended Stored Procedures

SQL Server includes SQL Server Profiler for monitoring SQL Server events. For more information, see Monitoring with SQL Server Profiler. These are the SQL Server Profiler related stored procedures:

xp_trace_addnewqueue xp_trace_getwritefilter
xp_trace_deletequeuedefinition xp_trace_loadqueuedefinition
xp_trace_destroyqueue xp_trace_pausequeue
xp_trace_enumqueuedefname xp_trace_restartqueue
xp_trace_enumqueuehandles xp_trace_savequeuedefinition
xp_trace_eventclassrequired xp_trace_setappfilter
xp_trace_flushqueryhistory xp_trace_setconnectionidfilter
xp_trace_generate_event xp_trace_setcpufilter
xp_trace_getappfilter xp_trace_setdbidfilter
xp_trace_getconnectionidfilter xp_trace_setdurationfilter
xp_trace_getcpufilter xp_trace_seteventclassrequired
xp_trace_getdbidfilter xp_trace_seteventfilter
xp_trace_getdurationfilter xp_trace_sethostfilter
xp_trace_geteventfilter xp_trace_sethpidfilter
xp_trace_geteventnames xp_trace_setindidfilter
xp_trace_getevents xp_trace_setntdmfilter
xp_trace_gethostfilter xp_trace_setntnmfilter
xp_trace_gethpidfilter xp_trace_setobjidfilter
xp_trace_getindidfilter xp_trace_setqueryhistory
xp_trace_getntdmfilter xp_trace_setqueueautostart
xp_trace_getntnmfilter xp_trace_setqueuecreateinfo
xp_trace_getobjidfilter xp_trace_setqueuedestination
xp_trace_getqueueautostart xp_trace_setreadfilter
xp_trace_getqueuedestination xp_trace_setserverfilter
xp_trace_getqueueproperties xp_trace_setseverityfilter
xp_trace_getreadfilter xp_trace_setspidfilter
xp_trace_getserverfilter xp_trace_setsysobjectsfilter
xp_trace_getseverityfilter xp_trace_settextfilter
xp_trace_getspidfilter xp_trace_setuserfilter
xp_trace_getsysobjectsfilter xp_trace_setwritefilter
xp_trace_gettextfilter xp_trace_startconsumer
xp_trace_getuserfilter  

Transactions

SQL Server includes changes to COMMIT WORK and ROLLBACK WORK.

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.