SSMS: How to import (Copy/Paste) data from excel

前端 未结 5 1669
轻奢々
轻奢々 2020-12-22 07:17

How to Copy/Paste following delimited data (by default delimited with tab) from excel:

declare @t_values   nvarchar(max)   =                   
N\'                   


        
5条回答
  •  伪装坚强ぢ
    2020-12-22 07:43

    If by some reason you don't want to use PROC (no permissions for instance), you can use snippet instead.

    Please save this code as file with extension .snippet and add it to your snippets through Code Snippets Manager:

    
    
        
            
    InsertTable Prepare Copy/Paste Excel data for inserting to Table Denis Sipchenko SurroundsWith
    t_name '#insertTable' Destination Table Name [(column names)] t_values copy/paste Excel data here delimiter char(9) Column Delimiter: HT = char(9) = HorizontalTab 0 -- skip empty rows $selected$$end$ ]]>

    Screen:

提交回复
热议问题