当前位置:首页 » 多媒体相关

请教各路英雄,如何在把自定义的视频文件写入字段中?(在线等待)


我想在表的字段中写入一视频文件,大小20mb左右,请问该如何操作,谢谢!!  
  这一字段的类型是否仍未image类型?

推荐阅读

  • Eidos著名动作游戏《嗜血狂魔》 [详细内容]
  • 联想推新扬天商用电脑 一键杀毒补产品线版图 [详细内容]
  • 瑞星助力联想 全球首款“彻底杀毒”电脑问世 [详细内容]
  • C语言初学者的困惑--如何由dos向windows转变 [详细内容]
  • 910使用常见问题(四) [详细内容]
  • 中国日前加入国际反垃圾邮件组织 信息化频道 [详细内容]
  • 《二战特种兵2(Commandos 2)》前瞻 [详细内容]
  • 网友回答:
    网友:pengdali

    用image类型  
       
      方法:  
      1、建立过程  
      create   procedure   sp_textcopy   (    
          @srvname         varchar   (30),    
          @login             varchar   (30),    
          @password         varchar   (30),    
          @dbname             varchar   (30),    
          @tbname             varchar   (30),    
          @colname         varchar   (30),    
          @filename         varchar   (30),    
          @whereclause   varchar   (40),    
          @direction     char(1))    
      as    
      declare   @exec_str   varchar   (255)    
      select   @exec_str   =    
                      textcopy   /s     +   @srvname   +    
                        /u     +   @login   +    
                        /p     +   @password   +    
                        /d     +   @dbname   +    
                        /t     +   @tbname   +    
                        /c     +   @colname   +    
                        /w   "   +   @whereclause   +    
                      "   /f     +   @filename   +    
                        /   +   @direction    
      exec   master..xp_cmdshell   @exec_str      
       
      2、建表和初始化数据  
      create   table   表名   (编号   int,image列名   image)  
      go  
      insert   表名   values(1,0x)  
      insert   表名   values(2,0x)  
      go  
       
      3、读入  
      sp_textcopy   你的服务器名,sa,你的密码,库名,表名,image列名,c:\aa.avi,where   编号=1,i   --注意条件是   编号=1  
       
      sp_textcopy   你的服务器名,sa,你的密码,库名,表名,image列名,c:\bb.doc,where   编号=2,i   --注意条件是   编号=2  
       
      go  
       
      4、读出成文件  
      sp_textcopy   你的服务器名,sa,你的密码,库名,表名,image列名,c:\aa.avi,where   编号=1,o   --注意条件是   编号=1  
       
      sp_textcopy   你的服务器名,sa,你的密码,库名,表名,image列名,c:\bb.doc,where   编号=2,o   --注意条件是   编号=2  
      go  
     

    .

    讨论区

    Login