SQL Server/T-SQL/Insert Delete Update/Insert Image — различия между версиями

Материал из SQL эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Версия 13:46, 26 мая 2010

Inserting Images

1>
2> drop table Players
3> GO
1> create table Players (
2>    Player_Id int IDENTITY (1, 1) NOT NULL ,
3>    Photograph image NULL
4> )
5> GO
1>
2> -- Inserting Images
3>
4> INSERT INTO Players (Photograph)VALUES (0xFFFFFFFF)
5> GO
(1 rows affected)
1>
2> DECLARE @Pointer_Value varbinary(16)
3> SELECT @Pointer_Value = TEXTPTR(Photograph)
4> FROM Players
5> WHERE Player_ID = 1
6> WRITETEXT Players.Photograph @Pointer_Value "C:\k.bmp"
7> GO
1>
2> select * from Players
3> GO
Player_Id   Photograph
---------------------------------------------------------------
          1 0x433A5C6B2E626D70

(1 rows affected)
1>
2> drop table Players
3> GO
1>