Announcement

Collapse
No announcement yet.

Select field_varbinary from T_table ... to file 'C:\temp\Text1.txt' ?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Select field_varbinary from T_table ... to file 'C:\temp\Text1.txt' ?

    Hallo,

    ich habe in einem varbinary-Feld eine Datei c:\Text1.txt eingefügt:

    Code:
    USE AdventureWorks
    GO
    CREATE TABLE myTable(FileName nvarchar(60), 
      FileType nvarchar(60), Document varbinary(max))
    GO
    
    INSERT INTO myTable(FileName, FileType, field_varbinary) 
       SELECT 'Text1.txt' AS FileName, 
          '.txt' AS FileType, 
          * FROM OPENROWSET(BULK N'C:\Text1.txt', SINGLE_BLOB) AS Document
    GO
    Wie bekomme ich diese Datei im SQL Management Studio wieder auf die Festplatte nach z.B. C:\temp\Text1.txt?

    Geht diese mit einem Select-Befehl in folgender Art?
    Select field_varbinary from T_table ... to file 'C:\temp\Text1.txt' ?

    Danke.

    Reinhold P.
    Zuletzt editiert von Reinhold_P; 18.06.2007, 08:27. Reason: Titel verbessert
Working...
X