Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Wednesday, March 28, 2012

Lock row.

Hello everyone,
I have a web project where users access a aspx page to view information stored in an SQL database.
My client want that one user can access a row of information and see it, allother users shouldn't be able to view or update thesame row?
it means whenever a row of data is displayed by some user, this row should be locked even for beeing viewed by all other users, when this user close this page, this row will be available. ?I should do this in code behind or something in sql...
How can I do that?

It is not easy to do but the link below will take you in the right direction. Hope this helps.

http://www.sql-server-performance.com/lock_contention_tamed_article.asp

|||

Thanks for your reply,
All I want to do is: if a userA access a row, all other users can't access this row even for reading.
I read the article but I didn't understand how can I do this.
Any help...

|||

No, not really. You'd have to roll your own method of locking out views when someone is viewing the same record.

Really, it sounds like a bad design.

|||

Goodway:

Thanks for your reply,
All I want to do is: if a userA access a row, all other users can't access this row even for reading.
I read the article but I didn't understand how can I do this.
Any help...

(UPDATE Users WITH (ROWLOCK)
SET Username = 'fred' WHERE Username = 'foobar'

By specifically requesting row-level locks, these problems are avoided.)

I got this from that link but I have told you it is not easy to lock access because as relational algebra expert Chris Date puts it a SELECT returns a table so you could be locking a table instead of one row through lock escalation managed by SQL Server. Hope this helps.

|||

That Update doesn't do what he asked for.

A) The WITH ROWLOCK really doesn't help. Sure, it (might) help with reducing contention by holding less granular locks, but... It doesn't hold the lock for any longer than the update statement takes to complete. That is unless you wrap it in a highly isolated transaction.

B) Transactions complete when the execution of the transaction variable is destroyed or the connection object is closed. This normally happens when the execution of the page completes. In order to avoid that (If it's even possible), you would need to stuff the transaction into either a session or application object so it doesn't go out of scope with the page finishes executing.

The workaround for B causes problems C,D and E.

C) Because the transaction (and locks) are now being held for LONG periods of time, you'll start having all kinds of performance and timeout problems within the database.

D) Memory usage within the webserver will skyrocket because of all the transaction/connection objects being held across postbacks. This will lead to additional scaling issues. Possibly consuming enough memory to trigger the .NET framework to recycle the application. Make sure to add plenty of memory to the webserver, and set the recycling threshold very high to avoid the locks being lost randomly when the system recycles the process.

E) Abandoned sessions will cause the record to be locked indefinately. What if the user loses power, or closes the browser? The server will continue to lock that record forever (Or until the session dies after a very long period of activity if you've stored the information in session, or until you recycle the application if you stored them in application). Sure the user can then log back in to the website, and he'll have to wait for the record to unlock itself before even he can do anything with the record.

The idea is flawed. Don't lock the record. Remember the original values, and when you go to update the record make sure the record still looks exactly the same prior to actually doing the update. The sql wizard will do this for you if you tell it to compare all values.

|||

(My client want that one user can access a row of information and see it, all other users shouldn't be able to view or update the same row?)

I was replying his original post and I understand he is trying to lock the viewing of scalar value well that is not something you could do without problems with RDBMS(relational database management systems).

Monday, March 12, 2012

Localization of reports

Hi,
We are currently working on a project where we need to deploy some reports
(Reporting Services 2005) in a multi language environment, but we struggling
to find out how to localize reports in reporting services.
1) How do I localize report texts? I can see that there's language
property and a ValueLocId property? Should I use these and how?
2) How do I localize report parameter prompts?
3) How do I localize reportname and description? For the description I
can see that there's a DescriptionLocId?
Are there any good resources on how to localize reports in Reporting
Services 2005?
Kind Regards
HenrikDuplicate, please se my other post.
"Henrik Skak Pedersen" <skak@.community.nospam> wrote in message
news:u%23H8N9x5GHA.4112@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We are currently working on a project where we need to deploy some reports
> (Reporting Services 2005) in a multi language environment, but we
> struggling
> to find out how to localize reports in reporting services.
> 1) How do I localize report texts? I can see that there's language
> property and a ValueLocId property? Should I use these and how?
> 2) How do I localize report parameter prompts?
> 3) How do I localize reportname and description? For the description
> I
> can see that there's a DescriptionLocId?
> Are there any good resources on how to localize reports in Reporting
> Services 2005?
> Kind Regards
> Henrik
>

Localization

Hi,
We are currently working on a project where we need to deploy some reports
(Reporting Services 2005) in a multi language environment, but we struggling
to find out how to localize reports in reporting services.
1) How do I localize report texts? I can see that there's language
property and a ValueLocId property? Should I use these and how?
2) How do I localize report parameter prompts?
3) How do I localize reportname and description? For the description I
can see that there's a DescriptionLocId?
Are there any good resources on how to localize reports in Reporting
Services 2005?
Kind Regards
HenrikHello Henrik,
As for the Reporting Service 2005, it does support some localization
features, they include:
1)the localization of the built-in UI components, such as SSRS's
htmlviewer, report designer
2) some simple localization on the SSRS report's data
For 1), the SSRS has done the work for us already, for example, when we
visit the html report, the UI elements on the htmlviewer(button or other UI
element's text) will render the localized representation according to
client-side browser's user-language setting.
For 2), if we want to do some simple localization on the static data/text
displayed on our report, we can dynamically format them according to the
"User!Language" parameter in our report expression. Or you can even build
custom assembly that has custom code logic to generate localizaed text(from
net resource ) accordin to this parameter.
You can find all the localization support of SSRS 2005 in the BOL:
#International Considerations for Reporting Services
http://msdn2.microsoft.com/en-us/library/ms156493.aspx
Therefore, for your scenario and the questions you mentioned, my
understanding is:
1) How do I localize report texts? I can see that there's language
property and a ValueLocId property? Should I use these and how?
========================================These properties is mainly used to specify a fixed culture/locale for
text/data formatting. Our report expression's output will be affected by
these setting.
I'm wondering whether you also want to localize the data which will be
displayed on report(retrieved from datasource). If this is the case, I'm
afraid those settings can not help on this because the data is already
retrieved by data processing engine before rendering, and rendering engine
can not translate text on the fly. For report which has data dedicated to
different languages/cultures, it is recommended that we build multiple
reports for each culture/language respectively.
2) How do I localize report parameter prompts?
========================================I think the report parameter prompts is a part of the built-in report
htmlviewer which will render localized UI according to client browser's
language setting.
3) How do I localize reportname and description? For the description I
can see that there's a DescriptionLocId?
=========================================I think such LOCID is also mainly used for some date/time number formatting
, and can not help on text/data localized formatting. For displaying
multiple language specific reports, I would suggest create multiple reports
for each language(use the corresponding datasource from database) as
mentioned in #1.
Please feel freee to let me know if you have any questions or other
consideration on this.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hello Henrik,
How are you doing on this issue? I've just discussed with some other
engineers from reporting service team and they have help confirm that the
"LocId" of reportItem or the report is still an unsupported feature that
teams the SSRS runtime which generate report will ignore such properties on
each reportItem.
The only usage of this LocID property is that we can use this property to
do some static localization related transformation on the RDL file. For
example, we can use XSLT to transform the RDL into another RDL xml form and
use the "LocID" to reference certain elements in the RDL when performing
XSLT transforming.
Currently , for SSRS report localization, I've mentioned the most common
approaches in my last reply. Please feel free to let me know if you have
any further questions on this.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi all,
I'm working with local reports (rdlc) and what I'm trying to do is to
localize the static text (column headers), not displayed data.
I have my column headers in textboxes which have the 'ValueLocID'
property, but I can't figure out how to make it work.
Is it possible to accomplish what I want with a single rdlc file? (not
as many as languages)
Could somebody point me out to the right direction?
TIA,
Sebastian
On Oct 9, 7:05 am, stch...@.online.microsoft.com (Steven Cheng[MSFT])
wrote:
> Hello Henrik,
> How are you doing on this issue? I've just discussed with some other
> engineers from reporting service team and they have help confirm that the
> "LocId" of reportItem or the report is still an unsupported feature that
> teams the SSRS runtime which generate report will ignore such properties on
> each reportItem.
> The only usage of this LocID property is that we can use this property to
> do some static localization related transformation on the RDL file. For
> example, we can use XSLT to transform the RDL into another RDL xml form and
> use the "LocID" to reference certain elements in the RDL when performing
> XSLT transforming.
> Currently , for SSRS report localization, I've mentioned the most common
> approaches in my last reply. Please feel free to let me know if you have
> any further questions on this.
> Sincerely,
> Steven Cheng
> Microsoft MSDN Online Support Lead
> This posting is provided "AS IS" with no warranties, and confers no rights.

Friday, March 9, 2012

local sql to server sql

I am working on a project that requires pc's on a production line to run a
product testing application. On each pc I would like to have a local sql
database that will have three simple tables. One for product testing
information, one for test results and one for error descriptions. I would
like to link these tables to a server based sql server. In the past, I have
accomplished the same function using Microsoft Access, by creating link
tables to the main sql server, and it has worked quite well. Can I do this
using a local sql server? I've been reading about Sql Server Compact and Sql
Server Express, but I'm not sure which would be better, or if either has the
capability to perform as I need them to. I'd appreciate any help or advice
on this.
Thanks.
Install SQL Server Express on the selected Client computers. And create
Linked Server in the Primary SQL Server to each, computer.
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005
"jfmoyn" wrote:

> I am working on a project that requires pc's on a production line to run a
> product testing application. On each pc I would like to have a local sql
> database that will have three simple tables. One for product testing
> information, one for test results and one for error descriptions. I would
> like to link these tables to a server based sql server. In the past, I have
> accomplished the same function using Microsoft Access, by creating link
> tables to the main sql server, and it has worked quite well. Can I do this
> using a local sql server? I've been reading about Sql Server Compact and Sql
> Server Express, but I'm not sure which would be better, or if either has the
> capability to perform as I need them to. I'd appreciate any help or advice
> on this.
> Thanks.
|||Thanks. I appreciate your help.
"Mohit K. Gupta" wrote:
[vbcol=seagreen]
> Install SQL Server Express on the selected Client computers. And create
> Linked Server in the Primary SQL Server to each, computer.
> --
> Mohit K. Gupta
> B.Sc. CS, Minor Japanese
> MCTS: SQL Server 2005
>
> "jfmoyn" wrote:

local sql to server sql

I am working on a project that requires pc's on a production line to run a
product testing application. On each pc I would like to have a local sql
database that will have three simple tables. One for product testing
information, one for test results and one for error descriptions. I would
like to link these tables to a server based sql server. In the past, I have
accomplished the same function using Microsoft Access, by creating link
tables to the main sql server, and it has worked quite well. Can I do this
using a local sql server? I've been reading about Sql Server Compact and Sq
l
Server Express, but I'm not sure which would be better, or if either has the
capability to perform as I need them to. I'd appreciate any help or advice
on this.
Thanks.Install SQL Server Express on the selected Client computers. And create
Linked Server in the Primary SQL Server to each, computer.
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005
"jfmoyn" wrote:

> I am working on a project that requires pc's on a production line to run a
> product testing application. On each pc I would like to have a local sql
> database that will have three simple tables. One for product testing
> information, one for test results and one for error descriptions. I would
> like to link these tables to a server based sql server. In the past, I ha
ve
> accomplished the same function using Microsoft Access, by creating link
> tables to the main sql server, and it has worked quite well. Can I do thi
s
> using a local sql server? I've been reading about Sql Server Compact and
Sql
> Server Express, but I'm not sure which would be better, or if either has t
he
> capability to perform as I need them to. I'd appreciate any help or advic
e
> on this.
> Thanks.|||Thanks. I appreciate your help.
"Mohit K. Gupta" wrote:
[vbcol=seagreen]
> Install SQL Server Express on the selected Client computers. And create
> Linked Server in the Primary SQL Server to each, computer.
> --
> Mohit K. Gupta
> B.Sc. CS, Minor Japanese
> MCTS: SQL Server 2005
>
> "jfmoyn" wrote:
>

Wednesday, March 7, 2012

local sql to server sql

I am working on a project that requires pc's on a production line to run a
product testing application. On each pc I would like to have a local sql
database that will have three simple tables. One for product testing
information, one for test results and one for error descriptions. I would
like to link these tables to a server based sql server. In the past, I have
accomplished the same function using Microsoft Access, by creating link
tables to the main sql server, and it has worked quite well. Can I do this
using a local sql server? I've been reading about Sql Server Compact and Sql
Server Express, but I'm not sure which would be better, or if either has the
capability to perform as I need them to. I'd appreciate any help or advice
on this.
Thanks.Install SQL Server Express on the selected Client computers. And create
Linked Server in the Primary SQL Server to each, computer.
--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005
"jfmoyn" wrote:
> I am working on a project that requires pc's on a production line to run a
> product testing application. On each pc I would like to have a local sql
> database that will have three simple tables. One for product testing
> information, one for test results and one for error descriptions. I would
> like to link these tables to a server based sql server. In the past, I have
> accomplished the same function using Microsoft Access, by creating link
> tables to the main sql server, and it has worked quite well. Can I do this
> using a local sql server? I've been reading about Sql Server Compact and Sql
> Server Express, but I'm not sure which would be better, or if either has the
> capability to perform as I need them to. I'd appreciate any help or advice
> on this.
> Thanks.|||Thanks. I appreciate your help.
"Mohit K. Gupta" wrote:
> Install SQL Server Express on the selected Client computers. And create
> Linked Server in the Primary SQL Server to each, computer.
> --
> Mohit K. Gupta
> B.Sc. CS, Minor Japanese
> MCTS: SQL Server 2005
>
> "jfmoyn" wrote:
> > I am working on a project that requires pc's on a production line to run a
> > product testing application. On each pc I would like to have a local sql
> > database that will have three simple tables. One for product testing
> > information, one for test results and one for error descriptions. I would
> > like to link these tables to a server based sql server. In the past, I have
> > accomplished the same function using Microsoft Access, by creating link
> > tables to the main sql server, and it has worked quite well. Can I do this
> > using a local sql server? I've been reading about Sql Server Compact and Sql
> > Server Express, but I'm not sure which would be better, or if either has the
> > capability to perform as I need them to. I'd appreciate any help or advice
> > on this.
> > Thanks.

Friday, February 24, 2012

local data

I am implementing an MSDE database and I would like to keep some data (like
user preferences) in the Access project so that I can filter data for each
user based on their selected preferences. In Access I just kept user
preferences in the application database on each workstation and used queries
to get only the data I wanted from the linked tables.
How can I do this in MSDE/Access projects?
thanks!
Jerry
hi Jerry,
JerryWendell wrote:
> I am implementing an MSDE database and I would like to keep some data
> (like user preferences) in the Access project so that I can filter
> data for each user based on their selected preferences. In Access I
> just kept user preferences in the application database on each
> workstation and used queries to get only the data I wanted from the
> linked tables.
> How can I do this in MSDE/Access projects?
Access is an application and a kind of integrated development environment,
where MSDE is just (<g>) a database management system that only stores
"data" (as long as other database objects to manipulate it...)
if you need a feature like that, you can perhaps save that kind of
information in a general user table related with the user and filter
depending on SYSTEM_USER
(http://msdn.microsoft.com/library/de...-us/tsqlref/ts
_sysusr_3c8i.asp ) , or you can write the same stored procedure but with
different owners, where each user will execute his/her "private" procedure,
but this can lead to management nightmares..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.11.1 - DbaMgr ver 0.57.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

local data

I am implementing an MSDE database and I would like to keep some data
(like user preferences) in the Access project so that I can filter data
for each user based on their selected preferences. In Access I just
kept user preferences in the application database on each workstation
and used queries to get only the data I wanted from the linked tables.
How can I do this in MSDE/Access projects?

thanks!
JerryOne way is simply to have a user table in MSDE - when your application
connects, you query the table based on the current user's login name
(see SYSTEM_USER in Books Online), then retrieve what you need from the
table.

Simon

Monday, February 20, 2012

Local and Remote Index Servers returning different resultsets

I have a project that uses a linked server in SQL Server 2000 to query a
local Index Server. This works fine.
I've been experimenting with moving the catalog to a remote Index Server and
querying it via Index Server running on the SQL Server machine (using the
four-part SCOPE syntax). I've followed plenty of other pointers relating to
syntax and security and seem to be getting there, but have noticed some
strange behaviour.
I seem to be getting a different number of results returned from the local
and remote index servers when I query them through Query Analyzer. My test
queries (which run over a catalog of about 12,000 documents) are very
simple:
select * from openquery (ImpelHR, 'select filename from
"NTS-1".ImpelHR..scope()')
This returns 12,012 results from NTS-1 (where the Index Server actually is)
and only 9,915 results when run from NTS-2 (where the SQL Server instance
and linked server are set up).
As soon as I add a CONTAINS clause:
select * from openquery (ImpelHR, 'select filename from
"NTS-1".ImpelHR..scope() where contains(''microsoft'')')
...I get 2,691 results on NTS-1 and no results on NTS-2. Changing the search
term makes no difference - no results (or errors) are returned from NTS-2 as
soon as I add the CONTAINS clause.
The two machines are setup very similarly - two Win2K Servers with SQL
Server 2000 Ent. Ed. Could the database and collation settings of the linked
server be acting up? Does anyone know what this strangeness is due to? I
seem to be passed all the permissions problems but this one is weird.
Thanks,
Alan
NZ! I used to live in New Plymouth!
results are trimmed by security and scope. You have to verify that
1) you are using the same catalogs
2) the account you are querying with in SQL Server is present on the remote
server and on both servers they have identical rights
3) the content is the same on both servers
4) the default scope (\) is the same on both servers. To verify this open up
ciadv.msc and expand your default catalog. expand the directories folder and
ensure the directories which show up there are the same and they are both
physical, ie don't have globes on them
5) when you are not doing a contains, you are basically enumerating the file
system on the local and remote servers. If AllowEnumeration is turned off,
this will account for this behavior
6) try something like this
select * from openquery (ImpelHR, 'select filename from
"NTS-1".ImpelHR..scope(''shallow traversal of ""c:\""'')')
thats scope ( ' ' deep traversal of " " c:\ " " ' ' ) ' )
I think your problems are due to different content and probably that the
index is not finished building on one or more servers.
BTW - are all IS servers on the same version? IE is one on IS 2 (NT 4.0) and
the other on IS 3.x?
"Alan Howard" <Xalan.howardX@.Xparadise.net.nzX> wrote in message
news:%23iKyiIYaEHA.2840@.TK2MSFTNGP11.phx.gbl...
> I have a project that uses a linked server in SQL Server 2000 to query a
> local Index Server. This works fine.
> I've been experimenting with moving the catalog to a remote Index Server
and
> querying it via Index Server running on the SQL Server machine (using the
> four-part SCOPE syntax). I've followed plenty of other pointers relating
to
> syntax and security and seem to be getting there, but have noticed some
> strange behaviour.
> I seem to be getting a different number of results returned from the local
> and remote index servers when I query them through Query Analyzer. My test
> queries (which run over a catalog of about 12,000 documents) are very
> simple:
> select * from openquery (ImpelHR, 'select filename from
> "NTS-1".ImpelHR..scope()')
> This returns 12,012 results from NTS-1 (where the Index Server actually
is)
> and only 9,915 results when run from NTS-2 (where the SQL Server instance
> and linked server are set up).
> As soon as I add a CONTAINS clause:
> select * from openquery (ImpelHR, 'select filename from
> "NTS-1".ImpelHR..scope() where contains(''microsoft'')')
> ...I get 2,691 results on NTS-1 and no results on NTS-2. Changing the
search
> term makes no difference - no results (or errors) are returned from NTS-2
as
> soon as I add the CONTAINS clause.
> The two machines are setup very similarly - two Win2K Servers with SQL
> Server 2000 Ent. Ed. Could the database and collation settings of the
linked
> server be acting up? Does anyone know what this strangeness is due to? I
> seem to be passed all the permissions problems but this one is weird.
> Thanks,
> Alan
>
|||Hi Alan,
can you share the "..plenty of other pointers relating to syntax and security.."
to set up the configuration you used: Index Server and SQLServer on different
machines ?
Many guys (including me..) posted in this group questions on the argument, but
got no aswer..
Many THX,
Max
"Alan Howard" wrote:

> I have a project that uses a linked server in SQL Server 2000 to query a
> local Index Server. This works fine.
> I've been experimenting with moving the catalog to a remote Index Server and
> querying it via Index Server running on the SQL Server machine (using the
> four-part SCOPE syntax). I've followed plenty of other pointers relating to
> syntax and security and seem to be getting there, but have noticed some
> strange behaviour.
> I seem to be getting a different number of results returned from the local
> and remote index servers when I query them through Query Analyzer. My test
> queries (which run over a catalog of about 12,000 documents) are very
> simple:
> select * from openquery (ImpelHR, 'select filename from
> "NTS-1".ImpelHR..scope()')
> This returns 12,012 results from NTS-1 (where the Index Server actually is)
> and only 9,915 results when run from NTS-2 (where the SQL Server instance
> and linked server are set up).
> As soon as I add a CONTAINS clause:
> select * from openquery (ImpelHR, 'select filename from
> "NTS-1".ImpelHR..scope() where contains(''microsoft'')')
> ...I get 2,691 results on NTS-1 and no results on NTS-2. Changing the search
> term makes no difference - no results (or errors) are returned from NTS-2 as
> soon as I add the CONTAINS clause.
> The two machines are setup very similarly - two Win2K Servers with SQL
> Server 2000 Ent. Ed. Could the database and collation settings of the linked
> server be acting up? Does anyone know what this strangeness is due to? I
> seem to be passed all the permissions problems but this one is weird.
> Thanks,
> Alan
>
>