Beginning Microsoft SQL Server 2008 ... - S3 Tech Training
Beginning Microsoft SQL Server 2008 ... - S3 Tech Training Beginning Microsoft SQL Server 2008 ... - S3 Tech Training
Appendix A: System Functions OBJECTPROPERTYEX OBJECTPROPERTYEX is an extended version of the OBJECTPROPERTY function. OBJECTPROPERTYEX(, ) Like OBJECTPROPERTY, the id parameter specifies the ID of the object required. The property parameter specifies the information required on the object. OBJECTPROPERTYEX supports all the same property values as OBJECTPROPERTY but adds the following property values as additional options: ❑ BaseType — Returns the base data type of an object. ❑ IsPrecise — Indicates that your object does not contain any imprecise computations. For example, an int or decimal is precise, but a float is not — computations that utilize imprecise data types must be assumed to return imprecise results. Note that you can specifically mark any .NET assemblies you produce as being precise or not. ❑ IsSystemVerified — Indicates whether the IsPrecise and IsDeterministic properties can be verified by SQL Server itself (as opposed to just having been set by the user). ❑ SchemaId — Just what it sounds like — returns the internal system ID for a given object. You can then use SCHEMA_NAME to put a more user-friendly name on the schema ID. ❑ SystemDataAccess — Indicates whether the object in question relies on any system table data. ❑ UserDataAccess — Indicates whether the object in question utilizes any of the user tables or system user data. @@PROCID Returns the stored procedure ID of the currently running procedure. Primarily a troubleshooting tool when a process is running and using up a large amount of resources. Is used mainly as a DBA function. SCHEMA_ID Given a schema name, returns the internal system ID for that schema. Utilizes the syntax: SCHEMA_ID( ) SCHEMA_NAME 626 Given an internal schema system ID, returns the user-friendly name for that schema. The syntax is: SCHEMA_NAME( )
SQL_VARIANT_PROPERTY SQL_VARIANT_PROPERTY is a powerful function and returns information about an sql_variant. This information could be from BaseType, Precision, Scale, TotalBytes, Collation, or MaxLength. The syntax is: SQL_VARIANT_PROPERTY (expression, property) Expression is an expression of type sql_variant. Property can be any one of the following values: Value Description Base Type of sql_variant Returned BaseType Data types include: char, int, money, nchar, ntext, numeric, nvarchar, real, smalldatetime, smallint, smallmoney, text, timestamp, tinyint, uniqueidentifier, varbinary, varchar Precision The precision of the numeric base data type: datetime = 23 smalldatetime = 16 float = 53 real = 24 decimal (p,s) and numeric (p,s) = p money = 19 smallmoney = 10 int = 10 smallint = 5 tinyint = 3 bit = 1 All other types = 0 Scale The number of digits to the right of the decimal point of the numeric base data type: decimal (p,s) and numeric (p,s) = s money and smallmoney = 4 datetime = 3 All other types = 0 TotalBytes The number of bytes required to hold both the metadata and data of the value. If the value is greater than 900, index creation will fail. Apendix A: System Functions sysname Collation The collation of the particular sql_variant value. sysname MaxLength The maximum data type length, in bytes. int int int int 627
- Page 613 and 614: Backup and Reco very No database-dr
- Page 615 and 616: ❑ Differential: This might be ref
- Page 617 and 618: ❑ Simple: Under this model, the t
- Page 619 and 620: The older DBCC commands are still s
- Page 621 and 622: many rows inserted over time and th
- Page 623: Chapter 19: Playing Administrator T
- Page 626 and 627: Appendix A: System Functions In add
- Page 628 and 629: Appendix A: System Functions @@TOTA
- Page 630 and 631: Appendix A: System Functions CHECKS
- Page 632 and 633: Appendix A: System Functions SUM Th
- Page 634 and 635: Appendix A: System Functions The de
- Page 636 and 637: Appendix A: System Functions @@REMS
- Page 638 and 639: Appendix A: System Functions Cert_I
- Page 640 and 641: Appendix A: System Functions Encryp
- Page 642 and 643: Appendix A: System Functions @@FETC
- Page 644 and 645: Appendix A: System Functions CURREN
- Page 646 and 647: Appendix A: System Functions SYSDAT
- Page 648 and 649: Appendix A: System Functions GetRoo
- Page 650 and 651: Appendix A: System Functions The ex
- Page 652 and 653: Appendix A: System Functions RAND T
- Page 654 and 655: Appendix A: System Functions ❑ IN
- Page 656 and 657: Appendix A: System Functions ❑ Is
- Page 658 and 659: Appendix A: System Functions FILEGR
- Page 660 and 661: Appendix A: System Functions INDEX_
- Page 662 and 663: IsCheckCnst IsConstraint IsDefault
- Page 666 and 667: Appendix A: System Functions TYPEPR
- Page 668 and 669: Appendix A: System Functions The qu
- Page 670 and 671: Appendix A: System Functions The SU
- Page 672 and 673: Appendix A: System Functions ASCII
- Page 674 and 675: Appendix A: System Functions The ch
- Page 676 and 677: Appendix A: System Functions UNICOD
- Page 678 and 679: Appendix A: System Functions CAST a
- Page 680 and 681: Appendix A: System Functions HOST_I
- Page 682 and 683: Appendix A: System Functions NULLIF
- Page 684 and 685: Appendix A: System Functions 646 Pr
- Page 686 and 687: Appendix A: System Functions Text a
- Page 688 and 689: Appendix B: Very Simple Connectivit
- Page 690 and 691: Appendix B: Very Simple Connectivit
- Page 692 and 693: Appendix B: Very Simple Connectivit
- Page 694 and 695: Appendix B: Very Simple Connectivit
- Page 696 and 697: ABS function A ABS function, 611 AC
- Page 698 and 699: closing tags closing tags, XML docu
- Page 700 and 701: cryptographic functions (continued)
- Page 702 and 703: defects defects. See well formed XM
- Page 704 and 705: EXPLICIT option EXPLICIT option bas
- Page 706 and 707: IGNORE_DUP_KEY option (CREATE INDEX
- Page 708 and 709: LOWER function LOWER function, 635
- Page 710 and 711: online transaction-processing (OLTP
- Page 712 and 713: query results query results alphabe
Appendix A: System Functions<br />
OBJECTPROPERTYEX<br />
OBJECTPROPERTYEX is an extended version of the OBJECTPROPERTY function.<br />
OBJECTPROPERTYEX(, )<br />
Like OBJECTPROPERTY, the id parameter specifies the ID of the object required. The property parameter<br />
specifies the information required on the object. OBJECTPROPERTYEX supports all the same property values<br />
as OBJECTPROPERTY but adds the following property values as additional options:<br />
❑ BaseType — Returns the base data type of an object.<br />
❑ IsPrecise — Indicates that your object does not contain any imprecise computations. For example,<br />
an int or decimal is precise, but a float is not — computations that utilize imprecise data types<br />
must be assumed to return imprecise results. Note that you can specifically mark any .NET<br />
assemblies you produce as being precise or not.<br />
❑ IsSystemVerified — Indicates whether the IsPrecise and IsDeterministic properties<br />
can be verified by <strong>SQL</strong> <strong>Server</strong> itself (as opposed to just having been set by the user).<br />
❑ SchemaId — Just what it sounds like — returns the internal system ID for a given object. You<br />
can then use SCHEMA_NAME to put a more user-friendly name on the schema ID.<br />
❑ SystemDataAccess — Indicates whether the object in question relies on any system table data.<br />
❑ UserDataAccess — Indicates whether the object in question utilizes any of the user tables or<br />
system user data.<br />
@@PROCID<br />
Returns the stored procedure ID of the currently running procedure.<br />
Primarily a troubleshooting tool when a process is running and using up a large amount of resources. Is<br />
used mainly as a DBA function.<br />
SCHEMA_ID<br />
Given a schema name, returns the internal system ID for that schema. Utilizes the syntax:<br />
SCHEMA_ID( )<br />
SCHEMA_NAME<br />
626<br />
Given an internal schema system ID, returns the user-friendly name for that schema. The syntax is:<br />
SCHEMA_NAME( )