Archive for the ‘DB & SQL’ Category

SQL Server Replication and Entity Framework

August 11, 2011

When setup database merge replication, rowguid columns are added to every table automatically, identity cannot be used as primary key in this replication.
This rowguid column has default value, so your app doesn’t need to be updated … but, in EF you can update model from database schema, then all these rowguid columns are imported … and EF will raise error build. 😦

Column MyTable.rowguid in table MyTable must be mapped: It has no default value and is not nullable.

The quick&dirty solution is: edit .edmx file, and delete all rowguid columns, and everything related.

A better solution is to write an EF add-in extension, in order to filter away rowguid columns …
unfortunately, I can’t provide any link because can’t remember where I read that tip 😦
here is a post: Error 3032 during EF 4.0 validation  ,  last reply by JendaPearl
hope it helps! 😉

Technorati tags: SQL Server, Entity Framework

SQL Server Replication: troubleshooting …

August 6, 2011

Well … a simple tip: always validate db schema before & after updating  … replica might stop due to some inconsistencies.

Better learn it before starting replication … perhaps you’ll have to change the way you update db schemas. 😉

SQL Server Replication: a good tutorial

August 4, 2011

Looking for a tutorial convering wide area of SQL Server Replication, SQL Server Central provided a good one by Sebastian Meine : Stairway to SQL Server Replication

splitted in 10 lessons:

Have a nice reading 😉

Technorati tags: SQL Server

SQL Server Merge Replication troubleshooting [bookmark]

July 29, 2011

Managing merge replication in SQL Server is easy, if your configuration is pretty standard.

But if you have multiple domains and forest?  and what about different SQL Server updated versions ? which user (service user) to use ?

Here is another document might help: Troubleshooting SQL Server 2008 Merge Replication

T-SQL: NULLIF and ISNULL

May 7, 2011

Well , NULLIF and ISNULL may lookup similar, expacially working with several platforms at the same time. 😦
In T-SQL they are not equivalent, at all!

  • NULLIF: Returns a null value if the two specified expressions are equal.
  • ISNULL: Replaces NULL with the specified replacement value.

Is everything clear now? 😉