.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links


Posted By:      Posted Date: April 10, 2011    Points: 0   Category :

Scenario,  regular Transactional Replication (sql server 2005 to sql server 2005) using pull subscription, initialized from backup instead of snapshot,    Had some issues with identity columns so I ran a script using the 2005 stored procedure sys.sp_identitycolumnforreplication to loop through each table and change the identity columns to YES (not for replication) on the publisher database.    I'll just mention here too that 300 or the 1427 tables that I'm replicating have triggers but I have scripted a few of them out and it looks like they have already been set for NOT for REPLICATION.   Since this is initiated from a backup, the subscriber database will have that flag set already as I've read that it needs to set at both the publisher and the subscriber.   I then tried to set up replication again but now its erroring with a 545 error, Explicit value must be specified for identity column in table <var>TableName</var> either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column.   So, so far, it hits this one table which is about halfway down the list of tables and it bombs.   I have googled and googled and found the IDENTITY_INSERT functionality that I could

View Complete Post

More Related Resource Links

Simple but unusual SQL 2008 peer2peer replication concept and question

Hi, I am not an SQL expert, but have to set up 3 remote SQL databases that need to be synchronised with each other. This is unusual because the locations are tiny atolls in the middle of the Pacific.  Communication between them is by satellite only which has limited bandwidth and is expensive.  The total population (thats all the people) on each atoll is only 500.  There is likely to be a maximum of 40 potential users per atoll and each SQL database is for internet login authentication only (Radius).  So the databases are tiny and have a very low update rate. What is the simplest way to synchronise the databases?  Doing this just once each night at around 4:00am would be best.  Peer to peer replication sounded right, but I do not want our extremely limited bandwidth taken up by this traffic when all we need is for the databases to be synchronised by the next day.  Also we are running MS SQL 2008 R2 Workshop edition and I am reading that this does not support peer2peer replication. The hardware is a laptop - since hot moisture laden salty air is very corrosive for traditional servers and power is intermittant at best.  Each atoll gets an identical system. Can anyone suggest a solution or ideas?  I am happy yo answer questions.  Thank you.

Transactional Replication Account question


1.How can i set up replication to run on a different account?

2.what is the standard best practice for this? right now it runs under my account.

3.Can a proxy account help? if so how? Please help.

merge replication and a locking question


We had a user yesterday that ran a report and their system froze.

i connected and looked and the replication processes is what was blocking. i stopped the synchrnozing, everyone could continue working, then i started the synch and everything was fine.

This is SQL 2005, merge replication.

The report is driven by a SELECT that has a user defined function that also only does SELECTs, and the report query takes about 30 minutes to run.

Does a SELECT lock a record in a table while it is reading it? If so, i don't want a SELECT to lock anything, but i also don't want the SELECT to read dirty records (NOLOCK/REUNCOMMITED).

This might not be enough information to start with, but i am trying to figure out if the report query is what caused the replication to cause blocking - somehow - and if so what can i do to stop a SELECT statement from locking records.



Simple question but very new to Replication - Design question


Hi All,


I have a requirement of desiging a good system.


I have 5-6 servers. and i want to keep 2 servers up to date.

Server List

1) Read

2) Write

3) Backup

4) Staging


Read connects to Application.

Application is getting data from Read Server,. but Writing data to Write server.

Write server is being written by Application and it writes and keep the Read Server upto date.


Backup server takes backup of Read, Write Servers.

Also, from Staging server, everything should be written to write Server. and then write server makes Read Server upto date.


SQL Server 2008 will be used in this design.


Please help. I'm very very new to admin advanced side.


Thanks in Advance.

SQL SERVER AGENT ACCOUNT: Replication Question

SQL Server Agent is running on a <Local Service> account. I need to change it so that it can run on SQL SERVER's Domain Account. Replication has been configured on this server with a remote distributor. Will this change cause any errors? Thank you. 

Newbie question: Are there any code changes required in an app when introducing SQL Replication?



We are investigating introducing SQL Replication (transactional model) to mitigate the usage of our main database from a remote site (so, we would have a replication at the remote site).

What we want is for users to write only to the Publisher, and read from the local Subscribers.

I have just assumed so far that SQL Replication will be completely transparent and handle the replication internally, so that we won't need to change anything in our client applications connecting to the DB, but I can't actually find any documentation that confirms this (it just seems to be the most obvious way for this to work).

Can you please point me to some documentation that clarifies this, or just confirm the actual behaviour here?

Thank you!


Some basic MVC question

  1. In regular asp net I can run (debug) the application but I can either "view in browser" that gives me the option to view the application and write code on same time.

In MVC I can't find this option.

  1. What is the basic DATA MODEL for working with SQL DB.

I mean with no any framework (entity framework, Sub sonic, Link to SQL etc')

I look for basic application that works with data but with no fw.

  1. What is the popular DB framework that working with data.
  2.  I am looking on  mvc series


C# Soup To Nuts  (the best series ever)


I watch some of the MVC video, seems that the music store is good but I have to wait to the other part.

Does any one know and recommend   a Microsoft MVC tutorial?





Web Site to Web Application Question


I've been building web sites and for my next project I will be creating a web application.  I use a 'BasePage' class in all my projects but, since web applications do not contain the 'App_Code' folder, what is the best place/practice for the 'BasePage' class?



connection string question from a newbie


when publishing  in the webmatrix dialogue it asks for "destination connection string" for my "database.mdf"

I was not sure what it was so I pasted this from my web.config file :

Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\database.mdf;Integrated Security=True;User Instance=True

it all published ok, but wont run, so I guess it has somthing to do with this connection string or some kind of configuration issue.

My question is this, What should go in the field for "Destination connection string"

Security Question Answer Retrieval


I know there is a method built in for retrieving the encrypted password, but how do I retrieve the encrypted security answer?

What I want to do is have a member profile update screen that the end user can update their password and security question and answer. However, when they get to this page, I want to already be showing the security question (the easy part) and its answer (the not so easy part).

I have updated web.config with passwordFormat=Encrypted and have added a machineKey with the generator (forgot the link, but located on eggheadcafe somewhere).

I haven't done ANYTHING yet, since I already have a user store with hashed information. I wanted to get some functionality done before publishing, wiping the store and recreating users (only a couple developers).


Very Basic Question - Error message running first page


Hi Everyone,

I am running Windows 7 and I have gone into Control Panel and activated all of the IIS Functions.

The web application I am running was downloaded from the net (and has worked on other machines previously).  Once I downloaded it, I moved it into C:/inetpub/wwwroot/code/main.asp

I am a bit of a novice at this!  But I am hoping someone can point me in the right direction!


I get the following error when I try and run the web application through IE:

"An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here to find out more about this error."

(When i click the "click here" button it just goes to the IIS site).


Appreciate any help I can get!




C#, LINQ: (List<>) Question???


Hi Everyone,

I have a strange problem:


There is an entity (Table) called "Filters" in my .edmx which has all my tables and stuff in it (to use it for LINQ queries)

I have created a class called "CustomFilters" which inherits "Filters". So now my cutom class has all the properties of the original "Filters" class (table) and 1 more additional property that i wanted which is a List of "CustomFilters":

List<CustomFilters> children = new List<CustomFilters>();

Now i get all my records into:

List<CustomFilters> theOriginalList = new List<CustomFilters>();

NOTE: first all records are tken into a List<Filters> and then these are added into List<CustomFilters> where List<CustomFilters> for children of that record is added, and then children of the child records, and so on......

so now, every record is an instance of CustomFilters which has a property named "children" which is a list again; and each child again has instanaces of "CustomFilters", and each instance again has children...and on and on and on.....

(basiacally its a data source for a treeview in my silverlight control)

every thing is good and working as expected.


linqdatasource parameters question



I'm currently getting to know the linqdatasource control. What would happen if several WHERE parameters are added to the linqdatasource control declaritively in the aspx page but no WHERE clause is defined? 

1. is there any issue with setting up multiple WHERE parameters in the aspx markup for linqdatasource but then deciding which ones actually get used at runtime by setting the actual WHERE clause at run time? Would the unused parameters simply be ignored and cause no issues?

2. when you need to modify WHERE clause or WHERE parameters at runtime do you need to do so in an event handler? such as linqdatasource.selecting?
I see from the above link it is possible, but is that the standard way to handle controlling filtering in code behind for linqdatasource?

2b. if you use an event such as linqdatasource.selecting to add where parameters and/or modify the where clause in code will that also break the builtin sorting and paging support of the linqdatasource with a gridview? 

database interface design question


For handy database interface, is it good to use SqldataSources exclusively intead of EntLib functions?

Thanks for any feedback.

A Challenging Question for Advanced user....


Using  dot net How will you release .exe applicattion for 1000 clients.this question was asked by manager but i could not answer him.tell me if you can!!!

Question in Get method in C#


I got a recent working code from client.I see errors in the get methods when i compile , below are some place where the error happens.Can any one help me out?


Error 2 'System.Environment.NewLine.get': cannot explicitly call operator or accessor C:\Documents and Settings\shankar\My Documents\Visual Studio 2008\Projects\DKCLwin\DKCLwin\LocalizationAdmin.cs 150 170 DKCLwin

Error 2 'System.Environment.NewLine.get': cannot explicitly call operator or accessor C:\Documents and Settings\shankar\My Documents\Visual Studio 2008\Projects\DKCLwin\DKCLwin\LocalizationAdmin.cs 150 170

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend