Showing posts with label user. Show all posts
Showing posts with label user. Show all posts

Friday, March 30, 2012

Increase User connections

Can i increase the max user connections above 32767 ?
Thanks> Can i increase the max user connections above 32767 ?
What on earth for? Can your apps not utilize connection pooling? > 32K
unique users really need to maintain a persistent and active connection
indefinitely? Sounds like an architecture and/or design problem to me.|||Aaron, thats why i asked ;)
Can you please answer the other post on connection pooling for me ?
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eb3cj1Z6HHA.5424@.TK2MSFTNGP02.phx.gbl...
>> Can i increase the max user connections above 32767 ?
>
> What on earth for? Can your apps not utilize connection pooling? > 32K
> unique users really need to maintain a persistent and active connection
> indefinitely? Sounds like an architecture and/or design problem to me.
>|||> Can you please answer the other post on connection pooling for me ?
I really don't know how to answer the question. It sounds like a theory
problem to me, not an actual problem you are experiencing. Personally, I
don't do anything special with connection pooling. It is enabled on the web
application, and unless every single web user establishes a connection to
SQL Server using a different connection string (e.g. with asp session ID
embedded), it should just work.

Wednesday, March 28, 2012

Incorrect user login information showing in Enterprise Manager

When I check properties for database user x the login name says domain1\x .
If I delete that login from the server then look at the user x's properties
again it still says domain1\x in the login name!
How can this be fixed?Eric,
Since you say Enterprise Manager, I assume that you are using SQL Server
2000.
If I delete a login in SQL Server 2000 EM, it goes through and deletes the
users.
If I "sp_revokelogin 'domain1\x'" it still leaves the 'x' user behind, and I
can still see 'domain1\x' in EM if I was looking at it earlier. But, once I
refresh the EM user view I still see user 'x' but with a blank login.
EM does have some latency in refreshing (refresh a couple of times may be
necessary). Could that be your problem?
If not, have you done anything out of the ordinary, such as restoring a
database from another server, or even another domain?
RLF
"EricW" <ewientzek@.hotmail.com> wrote in message
news:OA8zHbd1HHA.4672@.TK2MSFTNGP05.phx.gbl...
> When I check properties for database user x the login name says domain1\x
> . If I delete that login from the server then look at the user x's
> properties again it still says domain1\x in the login name!
> How can this be fixed?
>
>|||I'm speaking about Managemenst Studio in SQL 2005.
"Russell Fields" <russellfields@.nomail.com> wrote in message
news:eQrTdlg1HHA.4500@.TK2MSFTNGP02.phx.gbl...
> Eric,
> Since you say Enterprise Manager, I assume that you are using SQL Server
> 2000.
> If I delete a login in SQL Server 2000 EM, it goes through and deletes the
> users.
> If I "sp_revokelogin 'domain1\x'" it still leaves the 'x' user behind, and
> I can still see 'domain1\x' in EM if I was looking at it earlier. But,
> once I refresh the EM user view I still see user 'x' but with a blank
> login.
> EM does have some latency in refreshing (refresh a couple of times may be
> necessary). Could that be your problem?
> If not, have you done anything out of the ordinary, such as restoring a
> database from another server, or even another domain?
> RLF
> "EricW" <ewientzek@.hotmail.com> wrote in message
> news:OA8zHbd1HHA.4672@.TK2MSFTNGP05.phx.gbl...
>|||Eric W,
OK, you are using SQL 2005.
When using SSMS you delete a login, you will get this message: "Deleting
server logins does not delete the database users associated with the logins.
To complete the process, delete the users in each database. It may be
necessary to first transfer the ownership of schemas to new users."
But your question is" "Why does the user entry still know the login name?"
The answer is that it records the SID in the user. If you:
select * from sys.database_principals
you will see the SIDs of the logins used to create the users. In fact, if
you copy the SID for a deleted Windows login and paste it into:
SELECT SUSER_SNAME(0x0...9)
it will still return the name of the Windows Login. (In SQL Server 2000,
sysusers maintained the login's SID, but since the rows were usually deleted
automatically, you never saw this behavior manifested.)
To get rid of this, you must also drop the user yourself. Which may mean
that you must first drop that user's schema.
RLF
"EricW" <ewientzek@.hotmail.com> wrote in message
news:OaZe5gP2HHA.4476@.TK2MSFTNGP06.phx.gbl...
> I'm speaking about Managemenst Studio in SQL 2005.
>
> "Russell Fields" <russellfields@.nomail.com> wrote in message
> news:eQrTdlg1HHA.4500@.TK2MSFTNGP02.phx.gbl...
>

incorrect syntax question

i have a table of data that the user can enter into, the data type is set to "text" and has worked in some test so far, but when i type data in '' marks such as :

'text here'


it gives me an incorrect syntax error, is there a way around this? or is the '' charectors invalid? thanks John

A single quote is a string separator. So if your data has single quotes you might have to excape it with double quotes: example:Select'test''s'

|||Are you using parameters? If not, you should. It will help avoid this kind of problem. Others might suggest doubling the apostrophes, but while it works, that is not the answer.|||

Mikesdotnetting:

Are you using parameters? If not, you should. It will help avoid this kind of problem. Others might suggest doubling the apostrophes, but while it works, that is not the answer.

Agreed.Yes

|||

parameters will stop me getting this error? awesome! thanks for your help John

|||

I have an insert query which gives me a similar error, I cant see why its not working, the error is

A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1$CommentBox="<b>test text</b>").

My code is :

Connection.Open();
SqlCommand InsertItem = new SqlCommand("INSERT INTO TestTable(Inserted) VALUES ('@.item')", Connection);
InsertItem.Parameters.Add("@.item", SqlDbType.VarChar).Value = Textbox1.Text;
InsertItem.ExecuteNonQuery();
Connection.Close();
I simply tryed to insert the text string <b>test text</b>

Thanks John

|||

You dont need to put quotes if you are using parameterized queries.

SqlCommand InsertItem = new SqlCommand("INSERT INTO TestTable(Inserted) VALUES (@.item)", Connection);


|||It's objecting to the fact that you are trying to input html tags. Set ValidateRequest to false in the @.Page directive:http://www.asp.net/learn/whitepapers/request-validation/|||

thats awesome thanks, that answered every question i could come up with! haha John

Monday, March 26, 2012

Incorrect syntax near the keyword IF

I am writing a user defined function and I get the Error 156: Incorrect
syntax near the keyword IF. My function looks like this
CREATE FUNCTION dbo.func1(@.var1 varchar(64))
RETURNS @.MaintCost TABLE (@.result1 varchar(64), @.result2 varchar(64),
@.result3 varchar(64))
AS
IF @.var1 = 'I'
BEGIN
INSERT @.MaintCost
SELECT Col1, Col2, Col3
FROM tbl1
WHERE Col3 = 'I'
RETURN
END
ELSE
BEGIN
INSERT @.MaintCost
SELECT Col1, Col2, Col3
FROM tbl1
WHERE Col3 <> 'I'
RETURN
Thanks for the Help
ENDCREATE FUNCTION dbo.func1(@.var1 varchar(64))
RETURNS @.MaintCost TABLE (@.result1 varchar(64), @.result2 varchar(64),
@.result3 varchar(64))
AS
BEGIN
...
END
AMB
"Keith" wrote:

> I am writing a user defined function and I get the Error 156: Incorrect
> syntax near the keyword IF. My function looks like this
> CREATE FUNCTION dbo.func1(@.var1 varchar(64))
> RETURNS @.MaintCost TABLE (@.result1 varchar(64), @.result2 varchar(64),
> @.result3 varchar(64))
> AS
> IF @.var1 = 'I'
> BEGIN
> INSERT @.MaintCost
> SELECT Col1, Col2, Col3
> FROM tbl1
> WHERE Col3 = 'I'
> RETURN
> END
> ELSE
> BEGIN
> INSERT @.MaintCost
> SELECT Col1, Col2, Col3
> FROM tbl1
> WHERE Col3 <> 'I'
> RETURN
> Thanks for the Help
> END|||Try this:
CREATE FUNCTION dbo.func1(@.var1 varchar(64))
RETURNS @.MaintCost TABLE
(
result1 varchar(64),
result2 varchar(64),
result3 varchar(64)
)
AS
BEGIN
IF @.var1 = 'I'
BEGIN
INSERT @.MaintCost
SELECT Col1, Col2, Col3
FROM tbl1
WHERE Col3 = 'I'
END
ELSE
BEGIN
INSERT @.MaintCost
SELECT Col1, Col2, Col3
FROM tbl1
WHERE Col3 <> 'I'
END
RETURN
END

Monday, March 12, 2012

Inconsistent Results after Update

I have never seen anything like this, so I am quite baffled:

I have a large (6 million rows) table in a data warehouse. Because of a new user requirement, I ran an update on that table to update two columns changing the value from null to a 'real' value.

I ran the update and it completed in 14 minutes.

Now I query the table searching for a count of the records where the value in one of the columns is null. And I keep getting different answers; the results vary by as much as 100,000 records.

Here are the scripts:

CREATE TABLE TASKTRN (
TASKTRNKEY VARCHAR(10) NOT NULL,
TASKHDRKEY VARCHAR(10) NOT NULL,
TASKDTLKEY VARCHAR(10) NULL,
RECEIPTKEY VARCHAR(20) NULL,
RECEIPTLINE VARCHAR(5) NULL,
TASKTYPE INT NOT NULL
)
GO

ALTER TABLE TASKTRN ADD
CONSTRAINT PK_TASKTRN PRIMARY KEY CLUSTERED (TASKTRNKEY)
GO

CREATE INDEX TASKTRN_TASKHDRKEY ON TASKTRN (TASKHDRKEY)
GO

CREATE INDEX TASKTRN_RECEIPTKEY ON TASKTRN (RECEIPTKEY)
GO

/****** Object: Table [dbo].[TASK_TMP] Script Date: 03/21/2003 12:27:40 ******/
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TASK_TMP]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN
CREATE TABLE [TASK_TMP] (
[TASKTRNKEY] [char] (10) NOT NULL ,
[TASKHDRKEY] [char] (10) NULL ,
[RECEIPTKEY] [char] (10) NULL ,
[RECEIPTLINE] [char] (5) NULL
) ON [PRIMARY]
END

Print 'Created Temp table'

CREATE INDEX TASK_TMP_TASKTRNKEY ON TASK_TMP (TASKTRNKEY)

CREATE INDEX TASK_TMP_TASKHDRKEY ON TASK_TMP (TASKHDRKEY)

Print 'created Indexes'

INSERT INTO TASK_TMP
SELECT TASKTRNKEY, TASKHDRKEY, RECEIPTKEY, RECEIPTLINE
FROM TASKTRN
WHERE TASKTYPE = 1 AND RECEIPTKEY IS NULL

Print 'Insert Records'

UPDATE TASK_TMP
SET RECEIPTKEY = B.RECEIPTKEY, RECEIPTLINE = B.RECEIPTLINE
FROM
TASK_TMP A JOIN
(SELECT TASKHDRKEY, RECEIPTKEY, RECEIPTLINE
FROM TASKTRN
WHERE TASKTYPE = 1 AND RECEIPTKEY IS NOT NULL) B ON

A.TASKHDRKEY = B.TASKHDRKEY

Print 'Updated null values in temp table'

UPDATE TASKTRN
SET RECEIPTKEY = B.RECEIPTKEY, RECEIPTLINE = B.RECEIPTLINE
FROM
TASKTRN A JOIN
TASK_TMP B ON
A.TASKTRNKEY = B.TASKTRNKEY

Print 'Updated null values in permanent table'

This is the SQL that generates the disparate results:

select count(tasktrnkey) From tasktrn_roc where tasktype = 1 and receiptkey is null

Does anyone have any idea what may be going on?

Regards,

Hugh Scottbad statistics after the update, maybe?

after the update (or large inserts), try running sp_updatestats and see if it affects your results.

running DBCC INDEXDEFRAG might be a good idea as well

-isaac|||Yep,

I did that and still came up with some funky results. Now the mystery deepens a little further.

I ran a two different queries:

SELECT COUNT(TASKTRNKEY) WHERE RECEIPTKEY IS NULL AND TASKTYPE = 1

SELECT COUNT(TASKTRNKEY) WHERE RECEIPTKEY IS NOT NULL AND TASKTYPE = 1

In theory the sum of these two queries should add up to:

SELECT COUNT(TASKTRNKEY) WHERE TASKTYPE = 1

Didn't work; the sum of the results from the first two queries is slightly less than twice the actual number of records where TASKTYPE = 1.

Finally, I ran this query:

SELECT
CASE
WHEN RECEIPTKEY IS NULL THEN 'Null'
ELSE 'Not Null'
END as 'RECEIPTKEY',
COUNT(TASKTRNKEY)
FROM
TASKTRN
WHERE
TASKTYPE = 1
GROUP BY
CASE
WHEN RECEIPTKEY IS NULL THEN 'Null'
ELSE 'Not Null'
END

This returned what I expected it to return. But I am baffled to explain why or why the other select statements return such bizarre and conflicting results.

Regards,

Hugh Scott

Originally posted by isaacfain
bad statistics after the update, maybe?

after the update (or large inserts), try running sp_updatestats and see if it affects your results.

running DBCC INDEXDEFRAG might be a good idea as well

-isaac

Wednesday, March 7, 2012

Including ActiveDirectory Data in a SQL query

Hi, I am hoping someone may have tried this before.......

Our application takes user details from Active directory, and stores the Guid in the database against an autonumber field for an easy to use userid. Any time the application wants to know anything about the user, it gets the information from Active Directory based upon the stored Guid.

I am writing a query to be used in generating reports, so I don't want to use .NET, Only SQL. I would like to be able to extract the username from Active Directory using SQL, so that the user's name, and not just their ID can be used in the report.

So far I have been able to extract all of my users names and their Guids from Active Directory using SQL, and I can extract the user Guid from our database. The problem I am having is comparing the 2! Visually they look the same, however the datatypes are different. If I convert the ActiveDirectory Guid to varchar I get gobbledegook, and if I convert the stored database Guid to varbinary then it's value is changed.

The query as it stands is below:

SELECT convert(varchar(50), [Name]) as FullName,objectGUID,ADSPath
FROM openquery(ADSI, 'SELECT name, objectGuid, ADSPath
FROM ''<LDAP Path>'' WHERE objectClass = ''User''')
WHERE objectGuid in(Select ADObjectGUID FROM users WHERE UserId='1')

I am working with SQL Server 2000 - as many of our clients are still using this system, so solutions based on SQL Server 2005 would not be practical. (I beleive there are ways of running .NET code from SQL 2005 which would solve this problem)

Any ideas anyone has would be much appreciated

Thanks

Gillian

Have you tried converting them to the uniqueidentifier datatype in SQL Server? That is the GUID datatype in SQL Server.|||

Thanks Cam - that did the trick.

For anyone trying to do the same kind of thing, the query looks like:

SELECT CONVERT(varchar(50), Rowset_2.name) AS FullName, Users.UserID

FROM OPENQUERY(ADSI, 'select name, objectGuid, ADSPath

from''<LDAP Path inserted here>''

whereobjectClass = ''User''') Rowset_2

INNER JOIN Users ON CONVERT (uniqueIdentifier, Rowset_2.objectGuid) = Users.ADObjectGUID

Cheers

Gillian

Include User's Parameters in Report Header?

Hi, I'm getting stuck on what is probably a very simple/common task: Adding a textbox that displays the parameters that a user has selected for the current report.

For example, if the user chooses a @.startdate and @.enddate using date-pickers, a textbox in the header will display/print those parameters:

="Report by Department from " + @.startdate+ " to " + @.enddate

Seems simple, but I keep getting errors:

"Return statement in a Function, Get or Operator must return a value".

Can anyone help out with the proper syntax for repeating a user's parameters in the header or body of a report?

Thanks!

try

="Report by Department from " & Parameters!startdate.value " to " & Parameters!enddate.value

you can also right click at your textbox in the header and choose Expression to edit expression..

in there , choose Parameters in the left pane and double click the needed parameters in the right pane...

the expression will show at the top pane...

HTH

|||Ah, of course - Thankl you!|||What about something more general like looping through the parameters and writing them out by name and value? Any ideas?|||

do you mean multivalue parameters ?

if it is, u can try =Join(Parameters!status.label, ",")

.label for name; .value for value

Sunday, February 19, 2012

In use by another user..?

Hi all,
I have a liked SQL-server 2000 table in an Access database.
This table have worked fine for 6 months.
But now it start to say: 'In use by another user..' when I try to edit a
record. The table looks like this:
=====================================
CREATE TABLE [dbo].[Tbl_IS_Flagga](
[Orgnr] [nvarchar](11) NOT NULL,
[Flagga1] [bit] NOT NULL,
[Flagga1Ben] [nvarchar](max) NULL,
[Flagga2] [bit] NOT NULL,
[Flagga2Ben] [nvarchar](max) NULL,
[Flagga3] [bit] NOT NULL,
[Flagga3Ben] [nvarchar](max) NULL,
[FtgBeskrivning] [nvarchar](max) NULL,
[FtgLnk] [nvarchar](max) NULL
) ON [PRIMARY]
======================================
It seems to me that the problems are related to the records in the
table. What can I do about it?
Kent J.
My guess is that Access is acting up for any of below reasons:
The primary key for the table was removed.
Someone created a trigger on the table,. which does some strange things (like returning "rows
affected" messages).
Only guesses...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Kent J" <kent.johnson@.telia.com> wrote in message news:5LtLj.5924$R_4.4639@.newsb.telia.net...
> Hi all,
> I have a liked SQL-server 2000 table in an Access database.
> This table have worked fine for 6 months.
> But now it start to say: 'In use by another user..' when I try to edit a record. The table looks
> like this:
> =====================================
> CREATE TABLE [dbo].[Tbl_IS_Flagga](
> [Orgnr] [nvarchar](11) NOT NULL,
> [Flagga1] [bit] NOT NULL,
> [Flagga1Ben] [nvarchar](max) NULL,
> [Flagga2] [bit] NOT NULL,
> [Flagga2Ben] [nvarchar](max) NULL,
> [Flagga3] [bit] NOT NULL,
> [Flagga3Ben] [nvarchar](max) NULL,
> [FtgBeskrivning] [nvarchar](max) NULL,
> [FtgLnk] [nvarchar](max) NULL
> ) ON [PRIMARY]
> ======================================
> It seems to me that the problems are related to the records in the table. What can I do about it?
> Kent J.
|||What about locks or transaction log?
If I create new table with 'old' and new records then I have problem
with the old ones but not with the new records. Strange!
Kent J.
Tibor Karaszi skrev:
> My guess is that Access is acting up for any of below reasons:
> The primary key for the table was removed.
> Someone created a trigger on the table,. which does some strange things
> (like returning "rows affected" messages).
> Only guesses...
>
|||Have you tried to "edit a record" using an UPDATE statement in a query
window?
Why does the table not have a key? How do you identify a single row?
"Kent J" <kent.johnson@.telia.com> wrote in message
news:5LtLj.5924$R_4.4639@.newsb.telia.net...
> Hi all,
> I have a liked SQL-server 2000 table in an Access database.
> This table have worked fine for 6 months.
> But now it start to say: 'In use by another user..' when I try to edit a
> record. The table looks like this:
> =====================================
> CREATE TABLE [dbo].[Tbl_IS_Flagga](
> [Orgnr] [nvarchar](11) NOT NULL,
> [Flagga1] [bit] NOT NULL,
> [Flagga1Ben] [nvarchar](max) NULL,
> [Flagga2] [bit] NOT NULL,
> [Flagga2Ben] [nvarchar](max) NULL,
> [Flagga3] [bit] NOT NULL,
> [Flagga3Ben] [nvarchar](max) NULL,
> [FtgBeskrivning] [nvarchar](max) NULL,
> [FtgLnk] [nvarchar](max) NULL
> ) ON [PRIMARY]
> ======================================
> It seems to me that the problems are related to the records in the table.
> What can I do about it?
> Kent J.
|||Yes, I can use UPDATE instead.
I have primary key on the first field.
CONSTRAINT [PK_Tbl_IS_Flagga] PRIMARY KEY CLUSTERED
(
[Orgnr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY =
OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Aaron Bertrand [SQL Server MVP] skrev:
> Have you tried to "edit a record" using an UPDATE statement in a query
> window?
> Why does the table not have a key? How do you identify a single row?
>
> "Kent J" <kent.johnson@.telia.com> wrote in message
> news:5LtLj.5924$R_4.4639@.newsb.telia.net...
>
|||Hi all,
I figured it out!
[bit] NOT NULL,
...if it's null and you're trying to edit you'll get: "Edited by another
user".
Kent J.
Kent J skrev:
> Hi all,
> I have a liked SQL-server 2000 table in an Access database.
> This table have worked fine for 6 months.
> But now it start to say: 'In use by another user..' when I try to edit a
> record. The table looks like this:
> =====================================
> CREATE TABLE [dbo].[Tbl_IS_Flagga](
> [Orgnr] [nvarchar](11) NOT NULL,
> [Flagga1] [bit] NOT NULL,
> [Flagga1Ben] [nvarchar](max) NULL,
> [Flagga2] [bit] NOT NULL,
> [Flagga2Ben] [nvarchar](max) NULL,
> [Flagga3] [bit] NOT NULL,
> [Flagga3Ben] [nvarchar](max) NULL,
> [FtgBeskrivning] [nvarchar](max) NULL,
> [FtgLnk] [nvarchar](max) NULL
> ) ON [PRIMARY]
> ======================================
> It seems to me that the problems are related to the records in the
> table. What can I do about it?
> Kent J.

In use by another user..?

Hi all,
I have a liked SQL-server 2000 table in an Access database.
This table have worked fine for 6 months.
But now it start to say: 'In use by another user..' when I try to edit a
record. The table looks like this:
===================================== CREATE TABLE [dbo].[Tbl_IS_Flagga](
[Orgnr] [nvarchar](11) NOT NULL,
[Flagga1] [bit] NOT NULL,
[Flagga1Ben] [nvarchar](max) NULL,
[Flagga2] [bit] NOT NULL,
[Flagga2Ben] [nvarchar](max) NULL,
[Flagga3] [bit] NOT NULL,
[Flagga3Ben] [nvarchar](max) NULL,
[FtgBeskrivning] [nvarchar](max) NULL,
[FtgLänk] [nvarchar](max) NULL
) ON [PRIMARY]
======================================
It seems to me that the problems are related to the records in the
table. What can I do about it?
Kent J.My guess is that Access is acting up for any of below reasons:
The primary key for the table was removed.
Someone created a trigger on the table,. which does some strange things (like returning "rows
affected" messages).
Only guesses...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Kent J" <kent.johnson@.telia.com> wrote in message news:5LtLj.5924$R_4.4639@.newsb.telia.net...
> Hi all,
> I have a liked SQL-server 2000 table in an Access database.
> This table have worked fine for 6 months.
> But now it start to say: 'In use by another user..' when I try to edit a record. The table looks
> like this:
> =====================================> CREATE TABLE [dbo].[Tbl_IS_Flagga](
> [Orgnr] [nvarchar](11) NOT NULL,
> [Flagga1] [bit] NOT NULL,
> [Flagga1Ben] [nvarchar](max) NULL,
> [Flagga2] [bit] NOT NULL,
> [Flagga2Ben] [nvarchar](max) NULL,
> [Flagga3] [bit] NOT NULL,
> [Flagga3Ben] [nvarchar](max) NULL,
> [FtgBeskrivning] [nvarchar](max) NULL,
> [FtgLänk] [nvarchar](max) NULL
> ) ON [PRIMARY]
> ======================================> It seems to me that the problems are related to the records in the table. What can I do about it?
> Kent J.|||What about locks or transaction log?
If I create new table with 'old' and new records then I have problem
with the old ones but not with the new records. Strange!
Kent J.
Tibor Karaszi skrev:
> My guess is that Access is acting up for any of below reasons:
> The primary key for the table was removed.
> Someone created a trigger on the table,. which does some strange things
> (like returning "rows affected" messages).
> Only guesses...
>|||Have you tried to "edit a record" using an UPDATE statement in a query
window?
Why does the table not have a key? How do you identify a single row?
"Kent J" <kent.johnson@.telia.com> wrote in message
news:5LtLj.5924$R_4.4639@.newsb.telia.net...
> Hi all,
> I have a liked SQL-server 2000 table in an Access database.
> This table have worked fine for 6 months.
> But now it start to say: 'In use by another user..' when I try to edit a
> record. The table looks like this:
> =====================================> CREATE TABLE [dbo].[Tbl_IS_Flagga](
> [Orgnr] [nvarchar](11) NOT NULL,
> [Flagga1] [bit] NOT NULL,
> [Flagga1Ben] [nvarchar](max) NULL,
> [Flagga2] [bit] NOT NULL,
> [Flagga2Ben] [nvarchar](max) NULL,
> [Flagga3] [bit] NOT NULL,
> [Flagga3Ben] [nvarchar](max) NULL,
> [FtgBeskrivning] [nvarchar](max) NULL,
> [FtgLänk] [nvarchar](max) NULL
> ) ON [PRIMARY]
> ======================================> It seems to me that the problems are related to the records in the table.
> What can I do about it?
> Kent J.|||Yes, I can use UPDATE instead.
I have primary key on the first field.
CONSTRAINT [PK_Tbl_IS_Flagga] PRIMARY KEY CLUSTERED
(
[Orgnr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY =OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Aaron Bertrand [SQL Server MVP] skrev:
> Have you tried to "edit a record" using an UPDATE statement in a query
> window?
> Why does the table not have a key? How do you identify a single row?
>
> "Kent J" <kent.johnson@.telia.com> wrote in message
> news:5LtLj.5924$R_4.4639@.newsb.telia.net...
>> Hi all,
>> I have a liked SQL-server 2000 table in an Access database.
>> This table have worked fine for 6 months.
>> But now it start to say: 'In use by another user..' when I try to edit
>> a record. The table looks like this:
>> =====================================>> CREATE TABLE [dbo].[Tbl_IS_Flagga](
>> [Orgnr] [nvarchar](11) NOT NULL,
>> [Flagga1] [bit] NOT NULL,
>> [Flagga1Ben] [nvarchar](max) NULL,
>> [Flagga2] [bit] NOT NULL,
>> [Flagga2Ben] [nvarchar](max) NULL,
>> [Flagga3] [bit] NOT NULL,
>> [Flagga3Ben] [nvarchar](max) NULL,
>> [FtgBeskrivning] [nvarchar](max) NULL,
>> [FtgLänk] [nvarchar](max) NULL
>> ) ON [PRIMARY]
>> ======================================>> It seems to me that the problems are related to the records in the
>> table. What can I do about it?
>> Kent J.
>|||Hi all,
I figured it out!
[bit] NOT NULL,
..if it's null and you're trying to edit you'll get: "Edited by another
user".
Kent J.
Kent J skrev:
> Hi all,
> I have a liked SQL-server 2000 table in an Access database.
> This table have worked fine for 6 months.
> But now it start to say: 'In use by another user..' when I try to edit a
> record. The table looks like this:
> =====================================> CREATE TABLE [dbo].[Tbl_IS_Flagga](
> [Orgnr] [nvarchar](11) NOT NULL,
> [Flagga1] [bit] NOT NULL,
> [Flagga1Ben] [nvarchar](max) NULL,
> [Flagga2] [bit] NOT NULL,
> [Flagga2Ben] [nvarchar](max) NULL,
> [Flagga3] [bit] NOT NULL,
> [Flagga3Ben] [nvarchar](max) NULL,
> [FtgBeskrivning] [nvarchar](max) NULL,
> [FtgLänk] [nvarchar](max) NULL
> ) ON [PRIMARY]
> ======================================> It seems to me that the problems are related to the records in the
> table. What can I do about it?
> Kent J.