SQL script to create insert script

后端 未结 4 694
太阳男子
太阳男子 2021-02-05 15:39

A bit of a vague title, I will explain.

I am writing an SQL script to create an insert statement for each row of a table in my database, purely to be able to apply that

4条回答
  •  长情又很酷
    2021-02-05 16:20

    In the case of NULL fields you can do something like

    Select COALESCE(Name, '') from...
    

    The coalesce function returns the first nonnull value in the list.

    For truly blank fields (empty nvarchar for instance) I believe your script above will work.

提交回复
热议问题