
May 3rd, 2004, 07:33 AM
|
|
Registered User
|
|
Join Date: May 2004
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
sp_replcmds in SQL Server 6.5 vs. 2000
I have a problem related to the results, returned by sp_replcmds. In SQL Server 6.5, sp_replcmds returns the field command as a varchar, whether in SQL Server 2000, the same field is varbinary. Can I convert this value from varbinary to varchar so that I may execute it on SQL Server 6.5?
I have tried:
SELECT CAST(0x5600000005007B00430041004C004C0020007300700 05F004D00530069006E0073005F0043004F004E00540044004 F0042005F00490053005400200028003F002C0020003F002C0 020003F002C0020003F002C0020003F0029007D000E0000002 E0032003000300034002D00300034002D00320037002000300 030003A003000 AS varchar)
SELECT CONVERT(varchar, 0x5600000005007B00430041004C004C002000730070005F00 4D00530069006E0073005F0043004F004E00540044004F0042 005F00490053005400200028003F002C0020003F002C002000 3F002C0020003F002C0020003F0029007D000E0000002E0032 003000300034002D00300034002D0032003700200030003000 3A003000)
but it doesn’t seem to work because it returns just ‘V’ (NULL).
If I execute sp_replshowcmds, I can see the command as varchar, but I can’t block the log reader as sp_replcmds does. I've looked at the sp_replshowcmds script but I can’t see how does the xp_printstatements really works. Is this command encrypted when it is returned by the sp_replcmds; or what kind of information holds the ‘command’ field? How can I write a stored procedure so that I get the same effect as sp_replcmds (blocking all other log readers) but with the command field in readable format?
Thank you, in advance, for your help,
Catalin
|