Showing posts with label objects. Show all posts
Showing posts with label objects. Show all posts

Monday, March 26, 2012

please help -- 512 error when generating replication script

Hi,

I'm trying to script out my replication objects using
the 'Generate SQL Script...' option under Tools >
Replication in Enterprise Manager. Under 'Replication
components to script', I check 'Distributor properties'
and 'Publications in these databases:' and choose all
databases listed. I get a 512 error:

Error 512: Subquery returned more than 1 value. This is
not permitted when the subquery follows =, !=, <, <=, >,
>= or when the subquery is used as an expression.

The server is 2000 sp2, and the Ent Mgr client is 2000.
Using the same Ent Mgr client to script replication
objects in other 2000 sp2 servers, I don't receive any
errors.

I appreciate any help you can provide.

Thanks,
LB
.Try scripting individually.

Monday, February 20, 2012

pivot on dynamic columns

I have a table with 40k terms and I need to map these to a set of objects where each object is represented as a column(tinyint). The object/column name is represented as a guid and columns are added/removed dynamically to support new objects for a set of terms.

I can get the rows needed:

guid1 guid2 guid3 guid4 guid5
================================
0 1 1 0 0
0 1 1 0 1

I think I need to then convert this set of rows to a table which I can join to the object runtime table to start these objects if the column has a count/sum greater than 0. This is the table I think I need in order to join on guids to the runtime table:

NAME Count
===========
guid1 0
guid2 2
guid3 2
guid4 0
guid5 1

I don't know how to construct this table for the former table. I think it may be a pivot table, but I don't know. I have the column names:

SELECT NAME
FROM SYSCOLUMNS
WHERE ID = OBJECT_ID(#Temp)
ORDER BY COLID

NAME is a sysname, which doesn't seem to cast into a guid, also a problem when joining the runtime table with this #Temp table.

I also don't want to use a cursor to construct a table.

Thanks for any help,
Jameshttp://www.sqlteam.com/item.asp?ItemID=2955

HTH