Inserting GUID into SQL Server

前端 未结 4 1378
既然无缘
既然无缘 2021-01-01 19:32

I have a stored proc were I want to insert a GUID (user id) into a table in MS SQL but I keep getting an error about the hyphen \'-\' that is part of the guid value, here\'s

4条回答
  •  再見小時候
    2021-01-01 20:15

    You need single quotes around your GUID....it's just a string to sql server.

    You could try letting the sp generate the GUID with the sql function newid() ...sql server only i think.

    And if you're pulling the GUID from another table, let the SP go get that GUID from that table.

提交回复
热议问题