SQL Server/T-SQL Tutorial/Data Types/text

Материал из SQL эксперт
Версия от 13:25, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Character Strings

   <source lang="sql">

9> Create table Contacts(ContactId char(8), 10> Name varchar(50), 11> Note text, 12> Resume varchar(max)) 13> GO 1> 2> insert into Contacts (ContactId, Name, Note, Resume) 3> values ("CO-92-81", "Tom Jones", "Tom@trigon.ru", "N/a") 4> GO (1 rows affected) 1> 2> drop table Contacts; 3> GO 1></source>


Sample Table Containing Text

   <source lang="sql">

3> 4> CREATE TABLE MyTextTable( 5> id int NOT NULL PRIMARY KEY, 6> txt text NULL 7> ) 8> GO 1> EXEC sp_tableoption "MyTextTable", "text in row", "1000" 2> GO 1> INSERT MyTextTable 2> VALUES (1, NULL) 3> UPDATE MyTextTable 4> SET 5> txt = REPLICATE ("x", 1000) 6> 7> select * from MyTextTable 8> GO (1 rows affected) (1 rows affected) id txt










------------------------------------------------------------------------------------------------------------

































         1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx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