Fix LastInsertId is not supported
This commit is contained in:
parent
7e26dfea98
commit
cf2c573358
@ -176,8 +176,17 @@ func (mssql) SelectFromDummyTable() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (mssql) LastInsertIDReturningSuffix(tableName, columnName string) string {
|
||||
func (mssql) LastInsertIDOutputInterstitial(tableName, columnName string, columns []string) string {
|
||||
if len(columns) == 0 {
|
||||
// No OUTPUT to query
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("OUTPUT Inserted.%v", columnName)
|
||||
}
|
||||
|
||||
func (mssql) LastInsertIDReturningSuffix(tableName, columnName string) string {
|
||||
// https://stackoverflow.com/questions/5228780/how-to-get-last-inserted-id
|
||||
return "; SELECT SCOPE_IDENTITY()"
|
||||
}
|
||||
|
||||
func (mssql) DefaultValueStr() string {
|
||||
|
Loading…
x
Reference in New Issue
Block a user