Hi, I would like to call this stored procedure with jdbc:
sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"
JDBC thinks the ? is a placeholder for an argument. In fact it is used by the SP to put in the table name. How can I call the stored procedure? I tried this:
CallableStatement call = jdbcConnection.prepareCall("call sp_msforeachtable(?)");
call.setString(1, "\"ALTER TABLE ? NOCHECK CONSTRAINT all\"");
call.executeUpdate();
and I get a syntax error near '@P0'. I guess '@P0' is the ?. How can I call this SP? I am using SQL Server 2008 BTW.