July 7, 2005 at 6:54 am
Let's go the other way around.
Create a new dts package, add an activex task, then switch the code to vb, then just insert this code and save, don't forget to change the connection so that it connects to your server. Then repeat the steps I outlined in my first post and it should work.
Function Main()
Dim MyRsCols
Dim MyRsCount
Dim MyCn
Dim OColumns
Dim OTable
Dim oField
Dim sTable
Dim iCount
SET MyCn = CreateObject ("ADODB.Connection")
SET MyRsCols = CreateObject ("ADODB.RecordSet")
SET MyRsCount = CreateObject ("ADODB.RecordSet")
MyCn.Open ("Provider=sqloledb;Data Source=SERVEUR4;Initial Catalog=Documentation;Integrated Security=SSPI;")
MyRsCols.Open "Select O.Name, NULLIF(dbo.ListTableColumns_NotNulls(O.id), '') as NullColumns from dbo.SysObjects O WHERE O.XType = 'U' order by O.Name", MyCn, 1, 3
if not MyRsCols.EOF THEN
SET OTable = MyRsCols.Fields ("Name")
SET OColumns = MyRsCols.Fields ("NullColumns")
WHILE NOT MyRsCols.EOF
if not ISNULL(OColumns.value) THEN
MyRsCount.Open "Select '" & OTable.Value & "', " & OColumns.Value & " FROM dbo." & OTable.value, MyCn, 1, 3
sTable = ""
iCount = 0
For each oField in MyRsCount.Fields
if iCount = 0 then
sTable = MyRsCount.Fields(0).Value
else
MyCn.Execute "EXEC dbo.TablesColumnsNulls_Insert '" & sTable & "', '" & OField.Name & "', " & oField.Value
end if
iCount = iCount + 1
next
MyRsCount.Close
END IF
MyRsCols.MoveNext
WEND
END IF
MyRsCols.Close
MyCn.Close
SET MyRsCount = NOTHING
SET MyRsCols = NOTHING
SET MyCn = NOTHING
Main = DTSTaskExecResult_Success
End Function
July 7, 2005 at 8:43 am
Hi Remi,
Thanks! Success, but not complete. It updated 1617 (about half-way) when it gave me an error:
Error Code: 0
Error Source = Microsoft OLE DB Provider for SQL Server
Error Description: The count aggregate operation cannot take a uniqueidentifier data type as a argument
Error on line 19
The count aggregate operation cannot take a uniqueidentifier data type as a argument
I'll have a look at the table structure to find out what is going on.
Regards
Ron
July 7, 2005 at 8:53 am
Change the function
from
AND XType NOT IN (34,35)
to
AND XType NOT IN (34,35,36)
Viewing 3 posts - 31 through 32 (of 32 total)
You must be logged in to reply to this topic. Login to reply