, не объявляя переменную или подобное, трудно ссылаться на вводимое жестко закодированное значение. Если это ваша цель, вы должны рассмотреть решение Даниэля Хилгарта. Обычно вы будете иметь значение под рукой. В таком случае, вот как вы могли бы это сделать.
declare @t table (col1 varchar(10))
insert @t values ('hello')
insert @t values ('bye')
declare @newvalueforallrows varchar(10)
set @newvalueforallrows = 'hello'
update @t set col1 = @newvalueforallrows
where col1 <> @newvalueforallrows
-- 1 row updated
When newing up a DataContext, one of the overloads takes a connection string. I would therefore have a compiler switch something like:
#if Debug
string connectionString = ....
#else
string connectionString = ...
#endif
DbDataContext db = new DbDataContext(connectionString);
Using a connection string in the web/app config. Have multiple configs for dev/test/prod. Each should have the appropriate connection string. Switch the config for each environment.
using (MyDataContext dc = new MyDataContext(connectionString) )
{
//do a unit of work.
}