2

I am trying to figure out a way to share a single Users table in a database across multiple websites, in the most painless way possible. I'm specifically looking at NOP Commerce.

The issue with modifying the source code, is that plugins/etc aren't guarenteed to work due to the modified code. So I thought about SQL Server.

If I installed NOP Commerce onto two different databases, couldn't I "FORCE DROP" the entire user table in one, and replace it with a "SYNONYM" pointing it to the other?

(What is the use of SYNONYM in SQL Server 2008?)

(How can foreign key constraints be temporarily disabled using T-SQL?)

I'm not a pro on SQL Server, and am wondering of this is even feasible. iknow NOP 3+ has multstore support - but my concept is varied enough to where different code bases would be preferential.

Community
  • 1
  • 1
Jeffrey Kern
  • 2,024
  • 20
  • 40
  • "a way to share a single Users table in a database across multiple websites". Perhaps I'm missing something but for that you just have multiple websites configured to point at the same SQL server. – Nick.Mc Mar 14 '15 at 11:11
  • Theyd share the same everything else then. Nop creates its owm users table.. I would like just the users. – Jeffrey Kern Mar 14 '15 at 12:23
  • So you want to share the users but everything else (i.e. the product master and transactions) needs to be standalone in their own instance? You could try replacing the table with a synonym, but without knowing the specifics of how NOP uses this table I couldn't say if its reliable. If NOP wants to alter (DDL) the table but it's a synyonym it will fail. Another option is putting triggers on both tables to keep them synchronised but there are lots of merge type issues there. You'll just have to try and see! – Nick.Mc Mar 15 '15 at 05:38
  • I did get it working, but then realized that roles and other tables needed to get sent over as well. Additional rows were added successfully. – Jeffrey Kern Mar 15 '15 at 07:21

0 Answers0