hi. Here's the code that gets executed to script objects. I've always used sql authentication for sp_OAMethod, but i'd like to change that to windows authentication...
Does anyone know how to code sp_OAMethod to use local windows account?
Thanks!!
Does anyone know how to code sp_OAMethod to use local windows account?
Thanks!!
Code:
DECLARE @object int, @hr int, @return varchar(255)
exec @hr = sp_OACreate 'SQLDMO.SQLServer', @object output
[COLOR=red][b]exec sp_OAMethod @object, 'Connect', NULL, 'localhost', 'sa', 'password' [/b][/color]
exec sp_OAGetProperty @object, 'Databases("DBName").Tables("table_name").Script(1023,"C:\path\table_name.table","",16)', @return output
exec sp_OADestroy @object