That query doesn't work. You need to use sys.indexes and sys.objects.
Moreover, since Primary Keys are Indexes indeed in Sql Server, if you follow a naming convention where creating indexes, you can use the prefix for filtering out Primary Keys from 'other' indexes.
In the following example, i use IX as prefix for indexes, but any other will work:
DECLARE @Sourcedb SYSNAME
DECLARE @Destdb SYSNAME
DECLARE @IndexPrefix VARCHAR(max)
DECLARE @SQL VARCHAR(max)
SELECT @Sourcedb = '@Sourcedb'
SELECT @Destdb = '@Destdb'
SELECT @IndexPrefix = 'IX'
SELECT @SQL = ' SELECT ix.name,ob.type,ob.type_desc FROM '
+ @Sourcedb + '.SYS.indexes ix inner join '
+ @Sourcedb
+
'.sys.objects ob on ob.object_id = ix.object_id where ob.type <> ''S'' and ix.name like '' '
+ @IndexPrefix
+ '%'' and ix.name not in ( select db2.name from (SELECT ix.name,ob.type,ob.type_desc FROM '
+ @Destdb + '.SYS.indexes ix inner join '
+ @Destdb
+
'.sys.objects ob on ob.object_id = ix.object_id where ob.type <> ''S'' and ix.name like '' '
+ @IndexPrefix + '%'') db2) '
EXEC (@Sql)