This is my code. Currently, I just read the contents of the CSV file. I need to migrate this CSV file to MSSQL using Go Language Application
package main
import (
"encoding/csv"
"log"
"os"
)
func main() {
rows := readOrders("Ec2Instances.csv")
}
func readOrders(name string) [][]string {
f, err := os.Open(name)
if err != nil {
log.Fatalf("Cannot open '%s': %s
", name, err.Error())
}
defer f.Close()
r := csv.NewReader(f)
r.Comma = ';'
rows, err := r.ReadAll()
if err != nil {
log.Fatalln("Cannot read CSV data:", err.Error())
}
return rows
}
I want the CSV file to be written specifically into the "MSSQL Database". I have installed MSSQL and SSMS Softwares. How do I access these and write data into it?