ࡱ> AC@@ bjbjצצ (4:::::::N ," $N"R R R R R R R R $Rn:R R ::R R AAA:R :R AAA::AR F P & A0"AANN:::::A`R v TAD`R R R NN R 7 NNR SQL Server data types data type summary is on laptop remember alt-X SQL Server Books Online data type synonyms A domain is the set of allowable values in a column the SQL Server 2000 sql_variant data type is a special data type that allows you to store values of multiple base data types in the same column. For example you can store nchar values, int values , and decimal values in the same column. see Using sql variant Data. Null is a special value in databases that represents the concept of an unknown value. Null is not the same as a blank character or 0. Blank is a valid character and 0 is a valid number. data types-SQL Server Using bigint Data bigint data type is intended for use in cases where integer values might exceed the range supported by the int data type. For compatibility, the int data type remains the primary integer data type in Microsoft SQL Server 2000. caveats does not automatically promote tinyint, smallint, or int to bigint. CREATE TABLE BigintTable (ColA bigint) Binary Data Binary data consists of hexadecimal numbers. Binary data is stored using the binary, varbinary, and image data types in .... A column assigned the binary data type must have the same fixed length (up to 8 KB) for each row. use varbinary for storing binary data, unless the length of the data exceeds 8KB, in which case you should use image bit Integer data type 1,0, or NULL Columns of type bit can not have indexes on them. Microsoft SQL Server optimizes the storage used for bit columns. If there are 8 or fewer bit columns in a table, the columns are stored as 1 byte. fixed-length (char) or variable-length(varchar) character data types char[(n)] fixed length non-Unicode character data with lengthof n bytes. n must be a value from 1 through 8,000. Storage size is n bytes. The SQL-92 synonym for char is character varchar[(n)] variable-length non-Unicode character data with length of n bytes. n must be a value from 1 through 8,000. Storage size is the actual length in bytes of the data entered, not n bytes. The data entered can be 0 characters in length. The SQL-92 synonym for varchar are char varying or character varying When n is not specified in a data definition or variable declaration statement, the default length is 1. When n is not specified with the CAST function, the default length is 30. nchar and nvarchar are the Unicode data types which are used to minimize character conversion issues when supporting multiple languages. Use char when the data values in a column are expected to be consistently close to the same size. Use varchar when the data values in a column are expected to vary considerably in size. Microsoft SQL Server stores monetary data (currency values) using two data types: money and smallmoney. These data types can use any of the following currency symbols. [chart of hexadecimal values for the symbols is given] Currenty or monetary data does not need to be enclosed in single quotation marks(). However, the monetary data value must be preceded by the appropriate currency symbol. For example to specify 100 English pounds use 100 money and smallmoney are limited to four decimal points. Use decimal data type if more decimal points are required. Use a period to separate partial monetary units, like cents, from whole monetary units. datetime Date and time data from January 1, 1753 through December 31, 1999, to an accuracy of one three-hundreth of a second. Values are rounded to increments of .000, 003, or .007 seconds. Stored internally as two 4-byte integers. First 4 bytes store the number of days betwre or after the base date January 1, 1900. The base date is the system reference date. The other 4 bytes store the time of day represented as the number of milliseconds after midnight. smalldatetime Date and time data from January 1, 1900, through June 6, 2079, with accuracy to the minute. smalldatetime data type stores dates and times of day with less precision than datetime. smalldatetime values are stored as two 2-byte integers. First 2 bytes stored the number of days after January 1, 1900. The other 2 bytes stored the number of minutes since midnight. numeric data types with fixed precision and scale decimal [(p[,s])] numeric [(p[,s])] p(precision) must be a value from 1 through the maximum precision which is 38 s(scale) must be a value from 0 through p. The default scale is 0. 0<= s <= p Approximate number data types for use with floating point numeric data. Floating point data is approximate; not all values in the data type range can be precisely represented. float[(n)] is a floating point number data from -1.79E+308 through 1.9E+308. n is the number of bits used to store the mantissa for the float number in scientific notation. real is floating point number data from -3.40E+38 through 3.40E+38. Storage size is 4 bytes. In SQL server, the synonym for real is float(24). ntext, text, and image fixed and variable-length data types for storing large non-Unicode and Unicode character and binary data. Unicode data uses the UNICODE UCS-2 character set. ntext variable-length Unicode data with a maximum length of 230-1 (1,073,741,823) characters. Storage size in bytes is two times the number of characters entered. The SQL-92 synonym for ntext is national text. text variable-non-Unicode data in the code page of the server and with a maximum length of 231-1 (2,147,483,647) characters. image variable length binary data from 0 through 231-1 (2,147,483,647) bytes. int, bigint, smallint, and tinyint are exact number data types that use integer data. bigint integer data from -263 to 263-1. Storage size is 8 bytes int integer data from -231 to 231-1. Storage size is 4 bytes. SQL-92 synonym is integer smallint integer data from -215 to 215-1. Storage size is 2 bytes. tinyint integer data from 0 to 255. Storage size is 1 byte. timestamp is a data tpe that exposes automatically generated binary numbers, which are guaranteed to be unique within a database. uniqueidentifier a globally unique identifier 6789GH_`rs p q   , /  Ƚ̧̜zrgrgr_rgThE"hE"B*phhE"B* phhE"5B*\phhE"B*phh`B*phh`hE"B*ph̙hE"h`hB*phh`hB*phh`hB*ph̙hE"hGr"B*phhE"hB*phhGr"hh h`Y( *h h Y(h h Y( ht?Y(h`h`Y(h`ht? 789H`s p q ~ V W [ z $a$gd`$a$gdt? M ` d j P W Z [  > )-1;<Jǿ}rd}h#;ch' 05B*\phh`5B*\phh' 06B*]phh' 0h' 05B*\phh' 0h' 0B*phh' 0B*phh' 0h' 0B*phh' 05B*\phh' 0B*phhE"B*phhE"B*phhE"hE"hE"5B*\phhE"hE"B*phhE"5B*\ph'z ?@;<J|}1uvW7YZgd#;cgdHX&gd' 0MTYfj{16;C!(6VW7<ALu|HUøøøêÑÃ{hJSB*phhJShJS5B*\phh`hHX&5B*\phh#;chHX&B*phh#;chHX&5B*\phhHX&5B*\phhHX&B*phh#;ch' 05B*\phh#;cB*phh' 05B*\phh' 0B*phh' 06B*]ph-XYZV-VW=FIVZ_`=øøѰåÚðvkv`XvXh.B*phh.h#;cB*phh.h.B*phh.h.5B*\phh#;c5B*\phh#;c6B*]phh#;ch#;cB*phh#;c5B*\phh#;cB*phh#;ch#;cB*phh#;ch#;c5B*\phh`h#;cB*phh`B*phhHX&B*phhJSB*phhJS5B*\ph"UVHI`T=A&=?35STY\ UW\^%&h.hs &B*phhs &B*phh`hs &B*phh`h.B*phh`h.B*phh`h.5B*\phh#;cB*phh.h.B*phh.h.5B*\phh.5B*\phh.B*phh.B*H*ph2&&1h:pll/ =!"#$%H@H Gr"Normal CJOJQJ_HaJmH sH tH DA@D Default Paragraph FontRi@R  Table Normal4 l4a (k@(No List4789H`spq~VW[z?@;<J|}1 u v W 7    YZUVHI`T=A&00x0x00x00 000 00x0x0000000000000000000000x000x00x000000000000x0x000x00000x000000x000000x000x000000000000x00x`T?00 Tn?00?000?00 =z &s \Ks \s s s <ٖs 's s L * B 9O9 S H(W8*urn:schemas-microsoft-com:office:smarttagstime8*urn:schemas-microsoft-com:office:smarttagsdate 01121753190019992079316DayHourMinuteMonthYear                    G;<YZ==AA|9A`dfnqudoWZnp@L<DJY^i1 6 ! & 7 <    HUZa VW=CIN`eTY =@AH%&(3333333333333333333333333333333333333333333333333333333333333339`qWZ<JJTHI_wGr"s &`&HX&' 0t?JS#;cV~E"ll `=x.Ec@____p@UnknownGz Times New Roman5Symbol3& z ArialCFComic Sans MS"1hFFFC +C +!x24d3QHP(?ll Homework #4Elizabeth S. AdamsElizabeth S. AdamsOh+'0  8 D P \hpx Homework #4omeElizabeth S. Adamsliz Normal.dot.Elizabeth S. Adams3izMicrosoft Word 10.0@0@&@&@6r&C՜.+,0  hp  James Madison University#4+ O  Homework #4 Title  !"$%&'()*+,-./12345679:;<=>?BRoot Entry F@&DData 1Table#WordDocument(4SummaryInformation(0DocumentSummaryInformation88CompObjj  FMicrosoft Word Document MSWordDocWord.Document.89q