342 Part I EXAM PREPARATION TABLE 6.1 continued

342 Part I EXAM PREPARATION TABLE 6.1 continued GLOBAL VARIABLES IN SQL SERVER 2000 Global Variable Function @@SERVICENAME Returns the name of the service under which SQL Server is running. @@SPID Returns the current process identifier used by SQL Server. @@TEXTSIZE The maximum number of bytes that will be returned in a result set to the current connection from selecting from a TEXT or IMAGE column. @@TIMETICKS The number of microseconds that occur in one tick of the computer s clock. @@TOTAL_ERRORS The total number of disk read/write errors that SQL Server has had since its last restart. @@TOTAL_READ The total number of physical disk reads that SQL Server has done since it was last started. @@TOTAL_WRITE The total number of physical disk writes that SQL Server has done since it was last started. @@TRANCOUNT This returns the number of transactions deep the current statement is in a nested transaction. @@VERSION Returns the version string (date, version, and processor type) for the SQL Server. User Options The @@OPTIONS variable uses a technique called bitmasking to return data. It s a good exercise in batch programming technique to see how to return specific data from the @@OPTIONS variable, because columns in some system tables use the same technique to store data. To retrieve data from a bitmasked value, you need to have the map for how the value is laid out. The complete map for the value returned by the @@OPTIONS variable is found in SQL Server blogs Online under the topic User Options Option. In the table within that topic, the user option for ARITHIGNORE is 128. So, to check whether the ARITHIGNORE flag is turned on, take the options variable and use the logical AND function to see whether the flag is set: DECLARE @UserOption int SET @UserOption = @@OPTIONS PRINT @UserOption & 128

If you looking for unlimited one inclusive web hosting plan please check unlimited web hosting website.

Comments are closed.