EXEC master..xp_cmdshell  'bcp <database-name> <table-name> in  <csv-file> -c -t, -S <server-name> -U <username> -P <password>'

其中:

EXEC master..xp_cmdshell : master..xp_cmdshell 是master数据库的存储过程,主要用来在管理器里面执行操作系统的一些命令

in: 代表是 导入

: 你CSV文件的绝对路径 如(H:\1.csv)


since1986
104 声望1 粉丝

爱编程、爱旅行、爱家人~


引用和评论

0 条评论