MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 3rd, 2004, 07:33 AM
i96ucm i96ucm is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 i96ucm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question 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

Reply With Quote
  #2  
Old May 10th, 2004, 01:32 AM
i96ucm i96ucm is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 i96ucm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question more facts

In the upper example the field ‘command’ is represented as bigendian. In order to eliminate this, I published the database with heterogeneous subscribers. The problem now, is that It might be possible that sp_replcmds doesn’t return the entire command, but only a chunk of it (maybe the first 1024 Bytes). Does anybody know how does this stored procedure works?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > sp_replcmds in SQL Server 6.5 vs. 2000


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway