许久没写博客,近来真有点郁闷,首先自己水平有限,在成为大牛的路上努力挣扎中,狰狞地挣扎,其次是不满某些人的某些态度,我觉得态度是很重要的,好,吐槽完毕。
由于项目需要,需要用到sql server。首先golang连接sql server用的是官方推荐的包github.com/denisenkom/go-mssqldb,可以直接go get。golang调用sql server存储过程是比较蛋疼的,没有什么方法可以直接调用,所以我自己写了个方法:
//proc is the proc name
//declare is the proc declare with the return values
//in is the params in
//out is the params out
//outparas is the select parameters
func GetProcSql(proc, declare, in, out string, outparas ...string) string {
_sql := fmt.Sprintf(