ultimatepp/uppsrc/MSSQL/MSSQL.cpp
cxl 2e0e1145bc MSSQL: IdentityInsert (bypass of IDENTITY column insertion)
git-svn-id: svn://ultimatepp.org/upp/trunk@1594 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2009-09-29 17:40:17 +00:00

23 lines
427 B
C++

#include "MSSQL.h"
namespace Upp {
String MsSqlTextType(int width)
{
if(width <= 4000)
return NFormat("varchar(%d)", width);
return "text";
}
void IdentityInsert(Sql& sql, const SqlInsert& ins)
{
sql.Execute("SET IDENTITY_INSERT " + ins.GetTable().ToString() + " ON;" +
((SqlStatement)ins).Get(MSSQL));
}
void IdentityInsert(const SqlInsert& ins)
{
IdentityInsert(SQL, ins);
}
};