Link to home
Start Free TrialLog in
Avatar of Mauro Cazabonnet
Mauro CazabonnetFlag for United States of America

asked on

SQL Dump exec output to table

Hi,
What's the best way to dump an exec output to a temp table

USE [Dashboard]
DECLARE @ComputerADpath nvarchar(64) = 'LDAP://DC=demo,DC=lab';
DECLARE @ComputerADfilter nvarchar(64) = '(&(objectCategory=*)(objectClass=computer))';
DECLARE @ComputerMembers XML;
INSERT INTO [dbo].[Computers]
EXEC clr_GetADobjects @ComputerADpath, @ComputerADfilter, @ComputerMembers OUTPUT;

Open in new window


Thanks,
M
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What clr_GetADobjects does? It should at least return a table or rows from a SELECT statement.
What do you want to do with the @ComputerMembers OUTPUT? Ignore it or use it for the INSERT statement?
Avatar of Mauro Cazabonnet

ASKER

Thx this helped out
I had truncation occurring during the insert error message was a bit ambiguous

Regards,
M