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

Sunday, March 25, 2012

Count from multiple tables

I have 4 tables
One is a user table and the other three contain records for the users. They all have a USERNAME column
I would like to get a count of records for each table grouped by USERNAME

My output would be:
username,totalFrom1,totalFrom2,totalFrom3

Thanks For the help!Mybe something like:

select
username,
isnull(t1.ttlfrom1,0) ttlfrom1,
isnull(t2.ttlfrom2,0) ttlfrom2,
isnull(t3.ttlfrom3,0) ttlfrom3
from <users> u
left join
(
select username, count(username) ttlfrom1
from
<t1>
group by username
) t1 on t1.username = u.username
left join
(
select username, count(username) ttlfrom2
from
<t2>
group by username
) t2 on t2.username = u.username
left join
(
select username, count(username) ttlfrom3
from
<t3>
group by username
) t3 on t3.username = u.username
|||Thanks! I would never have figured that one out on my own, but I see how it works.
Thanks again
Greg

Thursday, March 22, 2012

COUNT and TOP

I want to do something like this:

SELECT COUNT (SELECT TOP(10) * FROM MyTable order by Date Desc) FROM MyTable where User = 'Scott'

What I want is to return the number of affected rows where the column 'User' equals 'Scott'...But is should only check in the 10 latest inserted rows....

Hope you understand what I mean...

when I want to do things like that especially if performance isnt completly critical, I just take the easier to read approach and do a sub query.

Select Count(*)
FROM ( Select Top(10) * From... ) As MyAlias

That way you know for sure things will be working out as you are thinking them.|||

Hi Tigers21,

Use the following: -

SELECT COUNT(*) FROM MyTable WHERE MyTableUniqueFieldID IN
(
SELECT TOP 10 MyTableUniqueFieldID FROM MyTable
ORDER BY [DATE] DESC
)
AND [User] = 'scott'

Substitute MyTableUniqueFieldID with the primary key field of the MyTable table.

Kind regards

Scotty

|||

Thanks for your answers!...

Both ways seems to work correct for me, but which one is best for the performance?

|||

Shados has the better solution.

Tuesday, March 20, 2012

Could Someone Help me to Config SQL2005 to Connect to my Host Database Server

Hi

I'm new this .I' using SQL 2005 VWD05.Could some body tell me how to upload to my host server database to to run a membership user account.I dont know what are the procedure to do on my pc in order to transfer the file on the database.

Thanks

I'm not sure what's your exact meaning, but if you want to connect to a remote SQL Server (that's a SQL Server on a different machine rather than the client website application machine), you need to configure the connection string used by the membership provider. For more information, you can refer to this article:

http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

And if you want to upload a existing database file which is being used by your website to the remote SQL Server, you'd better copy the database file to the local disk on the remote SQL machine, and then have the database file attached to the SQL intance.

|||

I'm trying run a membership page using the createuserwizard.So how do you upload to the database on

the host server inorder to run the createusewizard to accept new account.

|||Lori could you give me a walk through example on how to create a blank instance?|||

bigmike40:

Lori could you give me a walk through example on how to create a blank instance?

ScottGu made clearly answer to this question on the link I postSmile The blank instance here just mean a new database without database objects required by membership management--this can be a newly created database or some existing database. So you can use Enterprise Manager/Management Studio to create a new database, and then use aspnet_regsql.exe to create database objects on the newly created database. If you want to use existing database on the remote SQL Server, you can move the database to the remote SQL Server using Backup/Restore or Detach/Attach. Here are some useful links for moving database:

Move database with Backup/Restore:http://msdn2.microsoft.com/en-us/library/ms190436.aspx

Move database using Detach/Attach:http://msdn2.microsoft.com/en-us/library/ms187858.aspx

|||Ok i have a question.Are you suppose to upload the data explorer files... in vwd in order for the createuserwizard to work, or just the app data folder|||Sorry I'm not familiar with what you said "upload data explorer files". However to use CreateUserWizard control you need to connect to an available SQL database. So if you want to use the existing database file on the remote SQL database, you'd better copy the database file to the local disk on the remote SQL machine so that the database file can be attached to the SQL instance.|||

I'm sorry lori but i'm a newbei and some to the term i don't understand ,so can be a little more specifc on what u mean byif you want to use the existing database file on the remote SQL database, you'd better copy the database file to the local disk on the remote SQL machine so that the database file can be attached to the SQL instance.

|||OK, when you connect to a SQL database, first you need to login to the SQL instance (specified in Data Source property in connection string), right? And then you can use Database property to access an existing database on the SQL instance (for example pubs, tempdb); or use AttachDBFilename to attach a database and then access the attached database (note currently AttachDBFilename must points to a local database file, UNC, network path, HTTP are not supported), this is what I mean "using an existing database file". Apparently, no matter which database you're going to use, the database file must be on the local disk of the SQL machine, that's why I say "copy database file to the local disk on the SQL machine"Smile|||

Would this help my CreateUserWizard to configure and create new user account ? Because i cannot

Get the CreateUserWizard to work on my host server whenever... i hit the submit button it give me an error

But it work fine on my local machine

thanks

|||What's the error you got? Have you configure the membership database connection according to theScottGu's article?|||

Iori i'd like to thank you for taking the time on helping me.For the past month i've trying to get my project to work, but so far no luck.I did try setting up VWD the way scott did , but for some reason when i ran the wizard PUBS, ASPNET, NORTWIND ISSUE TRACKER STARTERKIT, doesn't shows up in the drop down box ..But the others components are listed.I do belive that my problem is that my database is not settup properly. In order to settup my database, do i need to download any other software in order for all the missing componets to show up in the drop down box. I think u did explain it another thread that you did that precedure before. So can you tell me how you went about doing setting up the database.

Thanks you

|||

bigmike40:

but for some reason when i ran the wizard PUBS, ASPNET, NORTWIND ISSUE TRACKER STARTERKIT, doesn't shows up in the drop down box ..But the others components are listed.I do belive that my problem is that my database is not settup properly.

Nevermind, it's my pleasure to share your issueSmile Did you mean you can connect to the remote SQL Server in the aspnet_regsql.exe wizard, but some existing databases (PUBS, ASPNET, NORTWIND ISSUE TRACKER STARTERKIT) on the remote SQL instance don't show up? Then what's the meaning of "others components are listed"? Did you mean other databases on the remote SQL can be listed? If so, that's really strange, as I know there is no such database setting to control the listed databases in the aspnet_regsql wizard. Are you sure the permission setting of the account you're using is proper on the remote SQL instance? Can you connect to the remote SQL instance using this account?

|||

I'm talking about the page where it say to select server and database on Scott blog.In the dropdown list he as

appservers,

ASPNET

Issue Tracker Kits

Master

model

msdb

Northwind

pubs

Those are the componets that are listed under database in Scott blogs

I did settup my config, but northwind, pubs, aspnet and the tracker kit didnt show up.

is it suppose to show up in the dropdown menu like how scott as it listed ?

And as far as can i connect to a remote SQL instance the answer is yes

On my host server i notice that there is nothing listed there in the database.

But my database name is listed in vwd and when hit test connection it said connected, so it seems that i can connect to myhost database, but i think that the info some how is not transfering over there some how.My project works

fine on my local machine but once i uploaded it on the server the CreateUserWizard doesn't work but all the other pages work fine. I belive that all the server control componets doesnt work on the server

I'm using WEB.com as my Host provider and the tech support don't seem to understaand anything about ASPNET 2.0

I think i might just get a better hosting company that don't out source their tech support

Thanks

|||

After trying to follow Scott config i cannot get this screen.

Step 3: Point your web.config file at the new SQL Database

ASP.NET 2.0 now supports a new section in your web.config file called “<connectionStrings>” which (not too surprisingly) are used to store connection strings. One nice thing from an administration perspective is that the new ASP.NET Admin MMC Snap-in now provides a GUI based way to configure and manage these:


Monday, March 19, 2012

Could not obtain information about Windows NT group/user .......error code 0x534...

== I asked this question directly to Remus and wanted to share the response to all of those people using this forum ==

We recently moved our database server from SQL Server 2000 to SQL Server 2005. All applications on our intranet development server stay the same [VS.NET 2003], but recently resources in our Dev DB server ran out of space. While doing a thorough investigation, I noticed ERRORLOG file was occupying about 35 Gig of HDD space. I immediately checked SQL Server error log and noticed an entry which says –

===========================================================================================

Date 7/7/2006 4:45:37 PM

Log SQL Server (Current - 7/7/2006 4:45:00 PM)

Source spid77s

Message

The activated proc [dbo].[SqlQueryNotificationStoredProcedure-5eaf8465-d0cb-4be7-93b6-44bb979dd41c] running on queue BW_Content.dbo.SqlQueryNotificationService-5eaf8465-d0cb-4be7-93b6-44bb979dd41c output the following: 'Could not obtain information about Windows NT group/user 'BWCINC\HoffK', error code 0x534.'

===========================================================================================

What is this SqlQueryNotificationService in my database? Is it a SQL Server 2005 thing? Why the same kind of stored procedure does not exist in other databases, but BW_Content? This error is getting repeated most probably every second and is filling up our server.

I believe our corporate IT people removed our domain accounts from BWCINC domain to BWCORP domain and probably some application which is using BWCINC\HoffK credential is getting errored out. I tried to locate this application and was not successful.

Is there anyway that I can stop this ERRORLOG from growing? How can I delete these log entries so that I can make space on our Hard Drive? Is there an easy way in SQL Server 2005 to locate which application is creating this error?

Response from Remus:

The 'SqlQueryNotificationService-...' is the service created by SqlDependency when you call SqlDependency.Start (). The problem you describe appears because the 'dbo' user of the database is mapped to the login that originally created this database. The SqlDependency created queue has an EXECUTE AS OWNER clause, owner is 'dbo' and therefore this is equivalent to an EXECUTE AS USER = 'dbo'. The error you see is reported by the domain controller when asked to give information about the original account 'dbo' mapps to (that is, BWCINC\HoffK'): Error code: (Win32) 0x534 (1332) - No mapping between account names and security IDs was done.

To solve the issue, change 'dbo' to match a correct login, using either sp_changedbowner or ALTER AUTHORIZATION ON DATABASE::[dbname] TO [somavalidlogin]

To find the databases that have this problem, run this query:

select name, suser_sname(owner_sid) from sys.databases

The databses that have the problem will show NULL on the second column.

A similar problem is described here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=65711&SiteID=1

To remove the entries, use sp_cycle_errorlog to force a new errorlog file, then delete the huge log file.

I executed ALTER AUTHORIZATION ON DATABASE::[BW_Content] TO [sa];

I got this error in SQL Error Log once and the growth of ERRORLOG was stopped.

===============================================================

Date 7/10/2006 1:16:55 PM
Log SQL Server (Current - 7/10/2006 1:17:00 PM)

Source spid20s

Message


The query notification dialog on conversation handle '{6BDE95F7-0EFB-DA11-9064-000C2921B41B}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8490</Code><Description>Cannot find the remote service &apos;SqlQueryNotificationService-c15bb868-ed56-47d2-bf91-ce18b320989a&apos; because it does not exist.</Description></Error>'.

===============================================================

Should I be concerned about this error?

Thanks

-Binoy

Thanks for sharing this!|||

Binoy Sankar wrote:

I got this error in SQL Error Log once and the growth of ERRORLOG was stopped.

===============================================================

Date 7/10/2006 1:16:55 PM
Log SQL Server (Current - 7/10/2006 1:17:00 PM)

Source spid20s

Message


The query notification dialog on conversation handle '{6BDE95F7-0EFB-DA11-9064-000C2921B41B}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8490</Code><Description>Cannot find the remote service &apos;SqlQueryNotificationService-c15bb868-ed56-47d2-bf91-ce18b320989a&apos; because it does not exist.</Description></Error>'.

===============================================================

Should I be concerned about this error?

Don't worry abouyt it. The error means that the client disconnected and the temporary service was dropped before the notification was fired.

Thanks,

~ Remus

Sunday, March 11, 2012

Could not locate entry (stored procedure error)

hello everyone,

I am using VS 2005 and sql server 2000. I have a web application which uses a connectionstring with a user id and pwd. Everything is fine, I can execute normal sql statements from the code behind. I cannot execute a stored procedure...I get this error.


Could not locate entry in sysdatabases for database 'exec usp_add2DB (my parameters are included here, deleted for simplicity reasons)

No entry found with that name. Make sure that the name is entered correctly.

I have given execute permission for the user, and the name of the storedproc is correct. the name of the server is also correct...pls pls help me what is wrong here...

Post the code you have and someone here can help.|||

Thank you for the response.here is the code...shortened for simplicity sake.

BtnClick event:

string sql = exec sp_add2DB '" + tShiptoSiteNo.Text +"','" txtShipToSiteName.Text

ClassA a = new ClassA("dev_connectionstr");

if(a.ExecuteSP(sql))

{

Response.Write("executed");

}

I am using enterprise library 2.0: (Everything is set up properly,pretty confident about it ,because many apps i am using it).

In Class A:

public class A :BaseDAO

{

public bool ExecuteSP(string sql)
{
DbCommand dbCommand = SqlDatabase.GetStoredProcCommand(sql);

int a = SqlDatabase.ExecuteNonQuery(dbCommand);
return true;}

In web.config:

<connectionStrings>
<add name ="dev_connectionstr" connectionString ="Data Source=ServerName;Initial Catalog=TestDB;User ID=test_user;Password=xxxx" providerName ="System.Data.SqlClient"/>
</connectionStrings>


Thanks for the help.

|||

Hi sankar,

When executing a stored procedure, you cannot list your parameters after the stored procedure name and execute with EXEC.

You need to create a SqlCommand object, and make CommandText as "sp_add2DB". Then use SqlCommand.Parameters.Add() method to add the parameters one by one. After this is done, open the connection and call SqlCommand.ExecuteNonQuery to execute it.

|||Thanks a lot for the reply Kevin Yu....tht explains why! Thank you very much!.

Wednesday, March 7, 2012

Could not find stored procedure

User creates a sp and the same is visible in the
enterprise manager. The user has rights to execute also.
However the isql gives the above mentioned error even for
sa!!!
No clue please help.Hi Sandip,
Make sure that you are in the right database when trying to execute the
stored procedure. Unless you specify a database with isql, it will use the
default database for that user, which is usually master.
--
Jacco Schalkwijk
SQL Server MVP
"Sandip" <bsandipk@.hotmail.com> wrote in message
news:072701c40022$9dd31140$3501280a@.phx.gbl...
> User creates a sp and the same is visible in the
> enterprise manager. The user has rights to execute also.
> However the isql gives the above mentioned error even for
> sa!!!
> No clue please help.|||Hi!
The user that creates the procedure is owner of te procedure, if it was not
created with a specific owner (i.e. CREATE PROCEDURE owner.name). The sa
loin is mapped to a specific db user dbo, so SQL Server searches dbo.name
procedure. Eithercreate all n+bjects wit dbo as owner, or use two-part name
when using it.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com
"Sandip" <bsandipk@.hotmail.com> wrote in message
news:072701c40022$9dd31140$3501280a@.phx.gbl...
> User creates a sp and the same is visible in the
> enterprise manager. The user has rights to execute also.
> However the isql gives the above mentioned error even for
> sa!!!
> No clue please help.|||Hi ,
To add on to Dejan Sarka post , Simply execute the below query in Query
analyzer
select user_name(uid) as Creator,name from sysobjects where name ='procedure_name'
Replace the procedure_name with actual name.
Incase the the creator name is not DBO then use sp_changeobjectowner (refer
books online) to change the object owner.
Thanks
Hari
MCDBA
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:ugW0lfCAEHA.2660@.TK2MSFTNGP10.phx.gbl...
> Hi!
> The user that creates the procedure is owner of te procedure, if it was
not
> created with a specific owner (i.e. CREATE PROCEDURE owner.name). The sa
> loin is mapped to a specific db user dbo, so SQL Server searches dbo.name
> procedure. Eithercreate all n+bjects wit dbo as owner, or use two-part
name
> when using it.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> Solid Quality Learning
> More than just Training
> www.SolidQualityLearning.com
> "Sandip" <bsandipk@.hotmail.com> wrote in message
> news:072701c40022$9dd31140$3501280a@.phx.gbl...
> > User creates a sp and the same is visible in the
> > enterprise manager. The user has rights to execute also.
> >
> > However the isql gives the above mentioned error even for
> > sa!!!
> >
> > No clue please help.
>

Could not find stored procedure

User creates a sp and the same is visible in the
enterprise manager. The user has rights to execute also.
However the isql gives the above mentioned error even for
sa!!!
No clue please help.Hi Sandip,
Make sure that you are in the right database when trying to execute the
stored procedure. Unless you specify a database with isql, it will use the
default database for that user, which is usually master.
Jacco Schalkwijk
SQL Server MVP
"Sandip" <bsandipk@.hotmail.com> wrote in message
news:072701c40022$9dd31140$3501280a@.phx.gbl...
> User creates a sp and the same is visible in the
> enterprise manager. The user has rights to execute also.
> However the isql gives the above mentioned error even for
> sa!!!
> No clue please help.|||Hi!
The user that creates the procedure is owner of te procedure, if it was not
created with a specific owner (i.e. CREATE PROCEDURE owner.name). The sa
loin is mapped to a specific db user dbo, so SQL Server searches dbo.name
procedure. Eithercreate all n+bjects wit dbo as owner, or use two-part name
when using it.
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com
"Sandip" <bsandipk@.hotmail.com> wrote in message
news:072701c40022$9dd31140$3501280a@.phx.gbl...
> User creates a sp and the same is visible in the
> enterprise manager. The user has rights to execute also.
> However the isql gives the above mentioned error even for
> sa!!!
> No clue please help.|||Hi ,
To add on to Dejan Sarka post , Simply execute the below query in Query
analyzer
select user_name(uid) as Creator,name from sysobjects where name =
'procedure_name'
Replace the procedure_name with actual name.
Incase the the creator name is not DBO then use sp_changeobjectowner (refer
books online) to change the object owner.
Thanks
Hari
MCDBA
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:ugW0lfCAEHA.2660@.TK2MSFTNGP10.phx.gbl...
> Hi!
> The user that creates the procedure is owner of te procedure, if it was
not
> created with a specific owner (i.e. CREATE PROCEDURE owner.name). The sa
> loin is mapped to a specific db user dbo, so SQL Server searches dbo.name
> procedure. Eithercreate all n+bjects wit dbo as owner, or use two-part
name
> when using it.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> Solid Quality Learning
> More than just Training
> www.SolidQualityLearning.com
> "Sandip" <bsandipk@.hotmail.com> wrote in message
> news:072701c40022$9dd31140$3501280a@.phx.gbl...
>

Saturday, February 25, 2012

Could not Create Publication

Hi,
I created 2 windows user named PublishUser and ReplSnapAgent with less
previllege. Ran SSMS using PublishUser and created snapshot publication.
Used RepSnapAgent user as Snapshot Agent. I got an error saying
SQL Server could not create publication 'Product'. (New Publication Wizard)
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
Proxy "Computer-Name\ReplSnapAgent" is not a valid Windows user.
Changed database context to 'ReplTesting'. (.Net SqlClient Data Provider)
Is anybody else help me out in solving this issue?
Is ReplSnapAgent a local user account on the computer Computer-Name? Is it
in the dbo_role on the distribution database and the publication?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Bharathi" <NoSpam_BB@.hotmail.com> wrote in message
news:Of7JjnPKHHA.2632@.TK2MSFTNGP06.phx.gbl...
> Hi,
> I created 2 windows user named PublishUser and ReplSnapAgent with less
> previllege. Ran SSMS using PublishUser and created snapshot publication.
> Used RepSnapAgent user as Snapshot Agent. I got an error saying
> SQL Server could not create publication 'Product'. (New Publication
> Wizard)
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.ConnectionInfo)
> Proxy "Computer-Name\ReplSnapAgent" is not a valid Windows user.
> Changed database context to 'ReplTesting'. (.Net SqlClient Data Provider)
> Is anybody else help me out in solving this issue?
>

Could not create an user to SQL Server 2005

Hi,

I am trying to add "Remote Desktop Users" as a login group to SQL Server 2005 (i.e. so they can log into management studio). I get a "Not Found Error" (see below). But it is of course found, because I selected it :-) What is going on here? I see the "Administrators" group and various SQL Server groupls added automatically there, so there must be a way, right?

I know I can add each user in the group individually, but that seems overkill when I can just use the group in which they are contained.

Here is the error I get:

TITLE: Microsoft SQL Server Management Studio

Create failed for Login 'TESTSERVER\Remote Desktop Users'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Login&LinkId=20476


ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Windows NT user or group 'TESTSERVER\Remote Desktop Users' not found. Check the name again. (Microsoft SQL Server, Error: 15401)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=15401&LinkId=20476


BUTTONS:

OK

This appears to be a defect within Management Studio: it qualifies the group using the machine name instead of "Builtin". I suggest that you open a bug at http://lab.msdn.microsoft.com/productfeedback/Default.aspx and put in it the information from this thread. Let me know if you need any help with filing the bug or if you wish that I would file it instead.

In the meantime, you can create such login by executing:

create login [Builtin\Remote Desktop Users] from windows;

Thanks
Laurentiu

|||Thank you Laurentiu. The script worked. I have indeed submitted a bug.|||Please note that I am the furthest thing from an expert that one can imagine, but...

I had a similar problem, but found an easy way to solve it.

Expand Security, right click Logins and select New Login
Click Search to the right of the Login Name box
Click the button Object Types
Select the box next to Groups|||

Hi ,

I am trying to create a new user in SQL Server 2005 with windows authentication.

This is the query i am trying to run.

create login [Builtin\User1] from windows

But i am getting error like "Windows NT user or group 'Builtin\waveset1' not found. Check the name again."

And the sql server is running on SQL and windows authuntication mode.

So anybody can help me what is the wrong.

I appreciate your response.

Thanks!

Sunday, February 19, 2012

Could not add ASPNET user to SQL Server.

10:15:50 PM Monday, December 01, 2003: [Fail] Could not add ASPNET user to SQL Server.
SQL Server does not exist or access denied.

hey guys can someone help me out on this or point me to another forum with the same problem and the answer this problem thank youcan you post your connection string?|||sure if i really no where to find it|||would this be it
10:37:20 PM Monday, December 01, 2003: [Checking system requirements]
10:37:20 PM Monday, December 01, 2003: [Pass] Detected a local instance of SQL Server.
10:37:20 PM Monday, December 01, 2003: [Pass] Determined SQL Server version (8.00.194).
10:37:20 PM Monday, December 01, 2003: [Pass] Detected .NET Framework.
10:37:20 PM Monday, December 01, 2003: [Pass] Detected Internet Information Server (IIS).
10:37:21 PM Monday, December 01, 2003: [Begin Sample Configuration]
10:37:22 PM Monday, December 01, 2003: [Pass] Created IIS virtual directory.: AspNetForums
10:37:22 PM Monday, December 01, 2003: [Pass] Determined SQL Server version (8.00.194).
10:37:38 PM Monday, December 01, 2003: [Fail] Could not add ASPNET user to SQL Server.
SQL Server does not exist or access denied.
10:37:38 PM Monday, December 01, 2003: [Done]|||<configuration
<configSections>
<section name="AspNetForumsSettings" type="System.Configuration.NameValueFileSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections
<system.web
<!-- set debugmode to false for running application -->
<compilation debug="false" /
<!-- set customeErrors off while developing -->
<customErrors mode="RemoteOnly" /
<authentication mode="Forms">
<forms name="AspNetWebAuth" loginUrl="~/login.aspx" protection="None" timeout="60" />
</authentication
</system.web
<!-- ASP.NET Forums Config Settings -->
<!--
******************************
Data Provider
-->
<AspNetForumsSettings>
<add key="DataProviderAssemblyPath" value="AspNetForums.dll" /
<!--
******************************
Application Settings
******************************
-->
<add key="availableSkins" value="default;LightBlue"/>
<add key="defaultPageSize" value="25"/>
<add key="connectionString" value="server=localhost;Trusted_Connection=true;database=" />
<add key="defaultDateFormat" value="dd MMM yyyy"/>
<add key="defaultTimeFormat" value="hh:mm tt"/>
<add key="pathToTransformationFile" value="/transform.txt" />
<add key="smtpServer" value="default" /> <!-- Can specify SMTP Server to use to send out emails. Use "default" to use the default Windows 2000 SMTP Server -->
<add key="allowDuplicatePosts" value="false" /><!-- Whether or not you wish to allow messages with duplicate bodies being posted in various forums -->
<add key="dbTimeZoneOffset" value="-6" /><!-- The timezone offset of your database server. (GMT is +0; EST = -5;) -->
<add key="siteName" value="ASP.NET Forums" /><!-- The name of your AspNetForums.NET Web site. -->
<add key="DataProviderClassName" value="AspNetForums.Data.SqlDataProvider" />
<add key="urlWebSite" value="http://localhost" /
<!--
If the ASP.NET Forums are configured to run in a directory that is not
an IIS VRoot, provide the name of that directory here.
<add key="forumsDirectory" value="/Forums" />
--
<!--
******************************
URL Resource Paths
******************************
urlHome - the Url to the home of the application
urlShowPost - The Url to show a particular post.
urlShowAllUsers - The Url to show all users.
urlSearch - The Url to show the search page.
urlSearchForUser - Searchs for posts by a given user.
urlRegister - The Url to register as a user.
urlProfile - The Url to view a user profile.
urlLogin - The Url to redirect the user to in order to login.
urlLogout - The Url to redirect a user to when they opt to logout.
urlShowForum - The Url to show a particular forum.
urlShowForumGroup - The Url to show a particular forum group.
urlShowUserInfo - The Url to show a particular user's information.
urlReplyToPost - The Url to post a reply to an existing post.
urlAddNewPost - The Url to post a new message.
urlEditExistingPostFromModeration - The Url to edit an existing post from the moderation system.
urlEditExistingPostFromAdmin - The Url to edit an existing post from the administration screen.
urlPostModeration - The Url to moderate posts awaiting approval.
urlEditForum - The Url to edit an existing forum.
urlCreateForum - The Url to create a new forum.
urlShowForumsPostsForAdmin - The Url to show a forums posts for editing/deletign (only available through the administration page).

Note, the '&' symbol cannot be parsed all '&' in URL are replaced with '^'
-->
<add key="urlHome" value="/Default.aspx" />
<add key="urlShowPost" value="/ShowPost.aspx?PostID=" />
<add key="urlShowAllUsers" value="/User/ShowAllUsers.aspx" />
<add key="urlSearch" value="/Search/default.aspx" />
<add key="urlQuickSearch" value="/Search/default.aspx?searchText=" />
<add key="urlSearchForPostsByUser" value="/Search/default.aspx?SearchFor=1^SearchText=" />
<add key="urlRegister" value="/User/CreateUser.aspx" />
<add key="urlEditUserProfile" value="/User/EditUserProfile.aspx" />
<add key="urlLogin" value="/login.aspx" />
<add key="urlAdmin" value="/Admin/default.aspx" />
<add key="urlAdminEditUser" value="/Admin/EditUser.aspx?Username=" />
<add key="urlLogout" value="/logout.aspx" />
<add key="urlShowForum" value="/ShowForum.aspx?ForumID=" />
<add key="urlShowForumGroup" value="/ShowForumGroup.aspx?ForumGroupID=" />
<add key="urlShowUserProfile" value="/User/UserProfile.aspx?UserName=" />
<add key="urlReplyToPost" value="/AddPost.aspx?PostID=" />
<add key="urlUserEditPost" value="/EditPost.aspx?PostID=" />
<add key="urlAddNewPost" value="/AddPost.aspx?ForumID=" />
<add key="urlMyForums" value="/User/MyForums.aspx" />
<add key="urlChangePassword" value="/User/ChangePassword.aspx" />
<add key="urlForgotPassword" value="/User/EmailForgottenPassword.aspx" />
<add key="urlModeration" value="/Moderate/default.aspx" />
<add key="urlModerateForumPosts" value="/Moderate/ModerateForum.aspx?ForumId=" />
<add key="urlEditPost" value="/Moderate/EditPost.aspx?PostID=" />
<add key="urlDeletePost" value="/Moderate/DeletePost.aspx?PostID=" />
<add key="urlManageForumPosts" value="/Moderate/ManageForum.aspx?ForumId=" />
<add key="urlMovePost" value="/Moderate/MovePost.aspx?PostID=" />
<add key="urlModerateThread" value="/Moderate/ModerateThread.aspx?PostId=" />
<add key="urlEditForum" value="/Admin/EditForum.aspx?ForumID=" />
<add key="urlCreateForum" value="/Admin/CreateNewForum.aspx" />
<add key="urlShowForumPostsForAdmin" value="/Admin/ShowPosts.aspx?ForumID=" />
<add key="urlMessage" value="/Msgs/default.aspx?MessageId=" />
<add key="urlModerationHistory" value="/Moderate/ModerationHistory.aspx?PostId=" />
</AspNetForumsSettings
<!--
This location tag is used to ensure that only authenticated users can add a new post or reply to
an existing post...
-->
<location path="AddPost.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location
<location path="EditPost.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location
</configuration>|||The user account that you are running the script under needs to have permissions in SQL Server to add a login for the ASPNet user. Are you logged on as a local administrator?

Cheers
Ken|||i am really not sure can u be lil more specific how will no if i am loged in or how i can log into the sql server|||If you are using Windows Integrated Authentication with SQL Server, then your Windows account needs appropriate permissions in SQL Server to be able to add new users to SQL Server.

I suggest you logon as an administrator and run the script. Otherwise, if you are using Mixed Mode security, then you should run the script under "sa" account.

The different security modes are discussed in SQL Server Books Online

Cheers
Ken|||well am running windows xp professional and my user name is has adminastative access|||well i am on windows xp pro and my user account is admin so how do i make my windows have appropriate permission in sql server|||I know above posts are a little dated but i thought that it would be nice to finish up the post.

I think the solution to the problem is to add the user account of the IIS server (typically: IUSR_<computername> ) as a trusted user on SQL server:

<computername>\IUSR_<computername
As for security concerns, I guess that would be up to those configuring thier machines to decide if this is the approach for them.

Could not add ASPNET user to SQL Server -Help plz-

hi ! someone could help me out ?
this is my log file i got

1:17:51 PM Monday, September 22, 2003: [Checking system requirements]
1:17:51 PM Monday, September 22, 2003: [Pass] Detected a local instance of SQL Server.
1:17:51 PM Monday, September 22, 2003: [Pass] Determined SQL Server version (8.00.194).
1:17:51 PM Monday, September 22, 2003: [Pass] Detected .NET Framework.
1:17:51 PM Monday, September 22, 2003: [Pass] Detected Internet Information Server (IIS).
1:17:54 PM Monday, September 22, 2003: [Begin Sample Configuration]
1:17:56 PM Monday, September 22, 2003: [Pass] Created IIS virtual directory.: AspNetForums
1:17:56 PM Monday, September 22, 2003: [Pass] Determined SQL Server version (8.00.194).
1:18:14 PM Monday, September 22, 2003: [Fail] Could not add ASPNET user to SQL Server.
SQL Server does not exist or access denied.
1:18:14 PM Monday, September 22, 2003: [Done]Does the user you are currently logged in as have rights to the sql server in question?|||What you mean about (as logged in as have rights to the sql server )?

-ok my SQL server is runing on my machine the server i am on it see like nothing wrong !

Still not understand why i could not add ASPNET user to SQL Server on the intallation AspNetForumsSetup|||You may want to try adding the user manually to the sql server. Sorry, I'm not sure what the problem is. I have never tried to install AspNetForumsSetup.