Showing posts with label solve. Show all posts
Showing posts with label solve. Show all posts

Monday, March 19, 2012

A thought this would be simple...

I had originally thought a full outer join would solve this, but alas I'm a roadblock. Perhaps it's because it's a Friday!

The goal is to create the most efficient query that will display results of the daily calls and sales as
this:

Date EmpID Calls Sales
7/1/2006 1 20 5
7/1/2006 2 25 7
7/1/2006 3 NULL 1
7/1/2006 4 10 NULL

The problem is a simple full outer join ends up ignoring EmpID 3 who has no Calls in t1, but I still want that row displayed in the results. Any ideas? TIA

create table t1 (Date smalldatetime, EmpID int, Calls int)

create table t2 (Date smalldatetime, EmpID int, Sales int)

insert into t1
values ('7/1/2006', 1, 20)

insert into t1
values ('7/1/2006', 2, 25)

insert into t1
values ('7/1/2006', 4, 10)

insert into t2
values ('7/1/2006', 1, 5)

insert into t2
values ('7/1/2006', 2, 7)

insert into t2
values ('7/1/2006', 3, 1)

what about this?

select coalesce(t1.date,t2.date) as date,coalesce(t1.empid,t2.empid) as empid,calls,sales
from t1 full outer join t2 on t1.empid =t2.empid

Denis the SQL Menace

http://sqlservercode.blogspot.com/

|||

Thanks for the response.

The problem I was running into is I need to include both EmpID and Date in the full outer join since the results need to be report only for a single date. So, when I exec this it does not return EmpID 3...

select coalesce(t1.date,t2.date) as date,coalesce(t1.empid,t2.empid) as empid,calls,sales
from t1 full outer join t2 on t1.empid =t2.empid and t1.date = t2.date

Any thoughts? TIA

|||

are you sure?

I get this back with both queries

2006-07-01 00:00:00 1 20 5
2006-07-01 00:00:00 2 25 7
2006-07-01 00:00:00 3 NULL 1
2006-07-01 00:00:00 4 10 NULL

|||

You're right!

I was doing this...

select coalesce(t1.date,t2.date) as date,coalesce(t1.empid,t2.empid) as empid,calls,sales
from t1 full outer join t2 on t1.empid =t2.empid and t1.date = t2.date where t1.date = '7/1/2006'

When I should have had the WHERE clause this...

select coalesce(t1.date,t2.date) as date,coalesce(t1.empid,t2.empid) as empid,calls,sales
from t1 full outer join t2 on t1.empid =t2.empid and t1.date = t2.date where t1.date = '7/1/2006' or t2.date = '7/1/2006'

That seems to work. Thanks!

Sunday, February 19, 2012

A query I''ve encounter that has me stumped ... anybody?


Hello Everyone,

I was hoping somebody could help me out with a query I've been trying to solve.

My Table Structure:

[UserMessages]

MessageID int
ToUserID int
FromUserID int
Subject varchar(200)
Message varchar(max)
isNew bit

[UserMessageReplies]

ReplyMessageID int
MessageID int
ToUserID int
FromUserID int
Message varchar(max)
isNew bit

Sample Data:

[UserMessages]

MessageID | ToUserID | FromUserID | Subject | Message | isNew
-
1 1 2 test subject Message Body 0
2 2 1 test subject Message Body 0
3 1 4 test subject Message Body 1
4 1 5 test subject Message Body 1

[UserMessageReplies]

ReplyMessageID | MessageID | ToUserID | FromUserID | Message | isNew

1 1 2 1 re: Message Body 0
2 1 1 2 re: Message Body 0
3 1 2 1 re: Message Body 0
4 1 1 2 re: Message Body 0
5 1 2 1 re: Message Body 1
6 2 1 2 re: Message Body 1

Explanation:

ReplyMessageID = 1-4 signfies that there is a thread response to MessageID 1 but they have been opened (isNew =0).
ReplyMessageID = 5 signfies that there is a new thread response to MessageID 1.
ReplyMessageID = 6 signifies that there is a reply from a message UserID=1 sent out (MessageID 2)

There needs to be a filter to check UserMessages.TOUserID=1 OR UserMessageReplies.ToUserID=1 to ensure that we can capture a msg that UserID=1 had sent out but now there is a reply to the Message by the User (in this example data i've setup MessageID = 2 to handle that possibility)

My Goal:

To select all messages for a ToUserID and order them by UserMessages.isNew or UserMessageReplies.isNew. This must include a message the user has sent but now has received a reply. (This means the first filter; UserMessages.ToUserID, must be overwritten with UserMessageReplies.ToUserID)

Thanks very much!

Chris

I can't quite follow what you want. Could you do a few additional things:

1. Turn your table structures into DDL and DML, so test SQL Statements can be written

2. Put out the results you want to see exactly. That would be a big help.

Thanks

|||CREATE TABLE [dbo].[UserMessages](
[MessageID] [int] IDENTITY(1,1) NOT NULL,
[ToUserID] [int] NOT NULL,
[FromUserID] [int] NOT NULL,
[Subject] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Message] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[isNew] [bit] NOT NULL CONSTRAINT [DF_UserMessages_isNew] DEFAULT ((1)),
[DateSent] [datetime] NOT NULL CONSTRAINT [DF_UserMessages_DateSent] DEFAULT (getdate()),
CONSTRAINT [PK_UserMessages] PRIMARY KEY CLUSTERED
(
[MessageID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

CREATE TABLE [dbo].[UserMessagesReplies](
[ReplyMessageID] [int] IDENTITY(1,1) NOT NULL,
[MessageID] [int] NOT NULL,
[ToUserID] [int] NOT NULL,
[FromUserID] [int] NOT NULL,
[Message] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[isNew] [bit] NOT NULL CONSTRAINT [DF_UserMessagesReplies_isNew] DEFAULT ((1)),
[DateSent] [datetime] NULL CONSTRAINT [DF_UserMessagesReplies_DateSent] DEFAULT (getdate()),
CONSTRAINT [PK_UserMessagesReplies] PRIMARY KEY CLUSTERED
(
[ReplyMessageID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

Result Set:

MessageID | ToUserID | FromUserID
-
1 1 2
2 2 1
3 1 4
4 1 5

MessageID=2 should appear because there is a response (ReplyMessageID=6) ToUserID=1

Select From UserMessages Where ToUserID=1

Thank you!
|||

It looks like you need to union the first table with the second table:

create view messagesTogether

as

select messageId, toUserId, fromUserId

from userMessages

union

select replyMessageId, toUserId, fromUserId

from userMessages

then get it where the toUserId is the same

But MessageId and ReplyMessageId don't match. I am uncomfortable with these table structures, so this is probably my best current guess. Am I close, does this make sense?

A query I''ve encounter that has me stumped ... anybody?


Hello Everyone,

I was hoping somebody could help me out with a query I've been trying to solve.

My Table Structure:

[UserMessages]

MessageID int
ToUserID int
FromUserID int
Subject varchar(200)
Message varchar(max)
isNew bit

[UserMessageReplies]

ReplyMessageID int
MessageID int
ToUserID int
FromUserID int
Message varchar(max)
isNew bit

Sample Data:

[UserMessages]

MessageID | ToUserID | FromUserID | Subject | Message | isNew
-
1 1 2 test subject Message Body 0
2 2 1 test subject Message Body 0
3 1 4 test subject Message Body 1
4 1 5 test subject Message Body 1

[UserMessageReplies]

ReplyMessageID | MessageID | ToUserID | FromUserID | Message | isNew

1 1 2 1 re: Message Body 0
2 1 1 2 re: Message Body 0
3 1 2 1 re: Message Body 0
4 1 1 2 re: Message Body 0
5 1 2 1 re: Message Body 1
6 2 1 2 re: Message Body 1

Explanation:

ReplyMessageID = 1-4 signfies that there is a thread response to MessageID 1 but they have been opened (isNew =0).
ReplyMessageID = 5 signfies that there is a new thread response to MessageID 1.
ReplyMessageID = 6 signifies that there is a reply from a message UserID=1 sent out (MessageID 2)

There needs to be a filter to check UserMessages.TOUserID=1 OR UserMessageReplies.ToUserID=1 to ensure that we can capture a msg that UserID=1 had sent out but now there is a reply to the Message by the User (in this example data i've setup MessageID = 2 to handle that possibility)

My Goal:

To select all messages for a ToUserID and order them by UserMessages.isNew or UserMessageReplies.isNew. This must include a message the user has sent but now has received a reply. (This means the first filter; UserMessages.ToUserID, must be overwritten with UserMessageReplies.ToUserID)

Thanks very much!

Chris

I can't quite follow what you want. Could you do a few additional things:

1. Turn your table structures into DDL and DML, so test SQL Statements can be written

2. Put out the results you want to see exactly. That would be a big help.

Thanks

|||CREATE TABLE [dbo].[UserMessages](
[MessageID] [int] IDENTITY(1,1) NOT NULL,
[ToUserID] [int] NOT NULL,
[FromUserID] [int] NOT NULL,
[Subject] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Message] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[isNew] [bit] NOT NULL CONSTRAINT [DF_UserMessages_isNew] DEFAULT ((1)),
[DateSent] [datetime] NOT NULL CONSTRAINT [DF_UserMessages_DateSent] DEFAULT (getdate()),
CONSTRAINT [PK_UserMessages] PRIMARY KEY CLUSTERED
(
[MessageID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

CREATE TABLE [dbo].[UserMessagesReplies](
[ReplyMessageID] [int] IDENTITY(1,1) NOT NULL,
[MessageID] [int] NOT NULL,
[ToUserID] [int] NOT NULL,
[FromUserID] [int] NOT NULL,
[Message] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[isNew] [bit] NOT NULL CONSTRAINT [DF_UserMessagesReplies_isNew] DEFAULT ((1)),
[DateSent] [datetime] NULL CONSTRAINT [DF_UserMessagesReplies_DateSent] DEFAULT (getdate()),
CONSTRAINT [PK_UserMessagesReplies] PRIMARY KEY CLUSTERED
(
[ReplyMessageID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

Result Set:

MessageID | ToUserID | FromUserID
-
1 1 2
2 2 1
3 1 4
4 1 5

MessageID=2 should appear because there is a response (ReplyMessageID=6) ToUserID=1

Select From UserMessages Where ToUserID=1

Thank you!
|||

It looks like you need to union the first table with the second table:

create view messagesTogether

as

select messageId, toUserId, fromUserId

from userMessages

union

select replyMessageId, toUserId, fromUserId

from userMessages

then get it where the toUserId is the same

But MessageId and ReplyMessageId don't match. I am uncomfortable with these table structures, so this is probably my best current guess. Am I close, does this make sense?

A query I''ve encounter that has me stumped ... anybody?


Hello Everyone,

I was hoping somebody could help me out with a query I've been trying to solve.

My Table Structure:

[UserMessages]

MessageID int
ToUserID int
FromUserID int
Subject varchar(200)
Message varchar(max)
isNew bit

[UserMessageReplies]

ReplyMessageID int
MessageID int
ToUserID int
FromUserID int
Message varchar(max)
isNew bit

Sample Data:

[UserMessages]

MessageID | ToUserID | FromUserID | Subject | Message | isNew
-
1 1 2 test subject Message Body 0
2 2 1 test subject Message Body 0
3 1 4 test subject Message Body 1
4 1 5 test subject Message Body 1

[UserMessageReplies]

ReplyMessageID | MessageID | ToUserID | FromUserID | Message | isNew

1 1 2 1 re: Message Body 0
2 1 1 2 re: Message Body 0
3 1 2 1 re: Message Body 0
4 1 1 2 re: Message Body 0
5 1 2 1 re: Message Body 1
6 2 1 2 re: Message Body 1

Explanation:

ReplyMessageID = 1-4 signfies that there is a thread response to MessageID 1 but they have been opened (isNew =0).
ReplyMessageID = 5 signfies that there is a new thread response to MessageID 1.
ReplyMessageID = 6 signifies that there is a reply from a message UserID=1 sent out (MessageID 2)

There needs to be a filter to check UserMessages.TOUserID=1 OR UserMessageReplies.ToUserID=1 to ensure that we can capture a msg that UserID=1 had sent out but now there is a reply to the Message by the User (in this example data i've setup MessageID = 2 to handle that possibility)

My Goal:

To select all messages for a ToUserID and order them by UserMessages.isNew or UserMessageReplies.isNew. This must include a message the user has sent but now has received a reply. (This means the first filter; UserMessages.ToUserID, must be overwritten with UserMessageReplies.ToUserID)

Thanks very much!

Chris

I can't quite follow what you want. Could you do a few additional things:

1. Turn your table structures into DDL and DML, so test SQL Statements can be written

2. Put out the results you want to see exactly. That would be a big help.

Thanks

|||CREATE TABLE [dbo].[UserMessages](
[MessageID] [int] IDENTITY(1,1) NOT NULL,
[ToUserID] [int] NOT NULL,
[FromUserID] [int] NOT NULL,
[Subject] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Message] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[isNew] [bit] NOT NULL CONSTRAINT [DF_UserMessages_isNew] DEFAULT ((1)),
[DateSent] [datetime] NOT NULL CONSTRAINT [DF_UserMessages_DateSent] DEFAULT (getdate()),
CONSTRAINT [PK_UserMessages] PRIMARY KEY CLUSTERED
(
[MessageID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

CREATE TABLE [dbo].[UserMessagesReplies](
[ReplyMessageID] [int] IDENTITY(1,1) NOT NULL,
[MessageID] [int] NOT NULL,
[ToUserID] [int] NOT NULL,
[FromUserID] [int] NOT NULL,
[Message] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[isNew] [bit] NOT NULL CONSTRAINT [DF_UserMessagesReplies_isNew] DEFAULT ((1)),
[DateSent] [datetime] NULL CONSTRAINT [DF_UserMessagesReplies_DateSent] DEFAULT (getdate()),
CONSTRAINT [PK_UserMessagesReplies] PRIMARY KEY CLUSTERED
(
[ReplyMessageID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

Result Set:

MessageID | ToUserID | FromUserID
-
1 1 2
2 2 1
3 1 4
4 1 5

MessageID=2 should appear because there is a response (ReplyMessageID=6) ToUserID=1

Select From UserMessages Where ToUserID=1

Thank you!
|||

It looks like you need to union the first table with the second table:

create view messagesTogether

as

select messageId, toUserId, fromUserId

from userMessages

union

select replyMessageId, toUserId, fromUserId

from userMessages

then get it where the toUserId is the same

But MessageId and ReplyMessageId don't match. I am uncomfortable with these table structures, so this is probably my best current guess. Am I close, does this make sense?

A query I''ve encounter that has me stumped ... anybody?


Hello Everyone,

I was hoping somebody could help me out with a query I've been trying to solve.

My Table Structure:

[UserMessages]

MessageID int
ToUserID int
FromUserID int
Subject varchar(200)
Message varchar(max)
isNew bit

[UserMessageReplies]

ReplyMessageID int
MessageID int
ToUserID int
FromUserID int
Message varchar(max)
isNew bit

Sample Data:

[UserMessages]

MessageID | ToUserID | FromUserID | Subject | Message | isNew
-
1 1 2 test subject Message Body 0
2 2 1 test subject Message Body 0
3 1 4 test subject Message Body 1
4 1 5 test subject Message Body 1

[UserMessageReplies]

ReplyMessageID | MessageID | ToUserID | FromUserID | Message | isNew

1 1 2 1 re: Message Body 0
2 1 1 2 re: Message Body 0
3 1 2 1 re: Message Body 0
4 1 1 2 re: Message Body 0
5 1 2 1 re: Message Body 1
6 2 1 2 re: Message Body 1

Explanation:

ReplyMessageID = 1-4 signfies that there is a thread response to MessageID 1 but they have been opened (isNew =0).
ReplyMessageID = 5 signfies that there is a new thread response to MessageID 1.
ReplyMessageID = 6 signifies that there is a reply from a message UserID=1 sent out (MessageID 2)

There needs to be a filter to check UserMessages.TOUserID=1 OR UserMessageReplies.ToUserID=1 to ensure that we can capture a msg that UserID=1 had sent out but now there is a reply to the Message by the User (in this example data i've setup MessageID = 2 to handle that possibility)

My Goal:

To select all messages for a ToUserID and order them by UserMessages.isNew or UserMessageReplies.isNew. This must include a message the user has sent but now has received a reply. (This means the first filter; UserMessages.ToUserID, must be overwritten with UserMessageReplies.ToUserID)

Thanks very much!

Chris

I can't quite follow what you want. Could you do a few additional things:

1. Turn your table structures into DDL and DML, so test SQL Statements can be written

2. Put out the results you want to see exactly. That would be a big help.

Thanks

|||CREATE TABLE [dbo].[UserMessages](
[MessageID] [int] IDENTITY(1,1) NOT NULL,
[ToUserID] [int] NOT NULL,
[FromUserID] [int] NOT NULL,
[Subject] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Message] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[isNew] [bit] NOT NULL CONSTRAINT [DF_UserMessages_isNew] DEFAULT ((1)),
[DateSent] [datetime] NOT NULL CONSTRAINT [DF_UserMessages_DateSent] DEFAULT (getdate()),
CONSTRAINT [PK_UserMessages] PRIMARY KEY CLUSTERED
(
[MessageID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

CREATE TABLE [dbo].[UserMessagesReplies](
[ReplyMessageID] [int] IDENTITY(1,1) NOT NULL,
[MessageID] [int] NOT NULL,
[ToUserID] [int] NOT NULL,
[FromUserID] [int] NOT NULL,
[Message] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[isNew] [bit] NOT NULL CONSTRAINT [DF_UserMessagesReplies_isNew] DEFAULT ((1)),
[DateSent] [datetime] NULL CONSTRAINT [DF_UserMessagesReplies_DateSent] DEFAULT (getdate()),
CONSTRAINT [PK_UserMessagesReplies] PRIMARY KEY CLUSTERED
(
[ReplyMessageID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

Result Set:

MessageID | ToUserID | FromUserID
-
1 1 2
2 2 1
3 1 4
4 1 5

MessageID=2 should appear because there is a response (ReplyMessageID=6) ToUserID=1

Select From UserMessages Where ToUserID=1

Thank you!
|||

It looks like you need to union the first table with the second table:

create view messagesTogether

as

select messageId, toUserId, fromUserId

from userMessages

union

select replyMessageId, toUserId, fromUserId

from userMessages

then get it where the toUserId is the same

But MessageId and ReplyMessageId don't match. I am uncomfortable with these table structures, so this is probably my best current guess. Am I close, does this make sense?

Thursday, February 16, 2012

A problem in memory when I run sp with a large number of records !

I will describe my problem and I hope that you will help me to find the way to solve it !

My task is how to find the "similiar" words in our database ! Now, I have to use my software to find the similiar name. For example :

The name : "Donaldson Filtration Slovensko s.r." and the name : "PENTA Slovensko Donaldsin spol. sro" are "similiar". In that case : the word "Donaldson" and "Donaldsin" can be called similiar because they are diffrence not more one character in the same positon in the string.

I used stored procedure to sovle this problem because it is a larg number of records in each table (for over 1 million records for each table).

The way I had used first is create a temperary table to contain

CREATE TABLE #SeperateString1
(
String1 nvarchar(100)
)

CREATE TABLE #SeperateString2
(
String2 nvarchar(100)
)

So that, I will analyze those string into 2 tables by detecting the blank character between 2 words !

Then, I compare values between 2 tables,

_

DECLARE ST1_Cursor CURSOR FOR
SELECT String1 FROM #SeperateString1
OPEN ST1_Cursor

FETCH NEXT FROM ST1_Cursor INTO @.String1
WHILE @.@.FETCH_STATUS = 0
Begin

DECLARE ST2_Cursor CURSOR FOR
SELECT String2 FROM #SeperateString2
OPEN ST2_Cursor

FETCH NEXT FROM ST2_Cursor INTO @.String2
WHILE @.@.FETCH_STATUS = 0
Begin

Exec CompareString @.String1, @.String2, @.Result = @.KetQua Output

If @.KetQua = 1
Begin
Exec SetCol1 @.ID, @.Rescol1 = @.Rescol1 Output
Exec SetCol2 @.IDCI, @.Rescol2 = @.Rescol2 Output
Select @.ResCol3 = 'Name: '+ Char(13) + Char(10) + @.String1 + ' <==> ' + @.String2
Select @.ResCol4 = 0

Select @.ResCol5 = GetDate()

If (Not Exists(Select * From Result Where IAdata like @.ResCol1 And DataFound like @.ResCol2 And Reason like @.Rescol3)) And (Not Exists(Select * From Dictionary Where Value = @.String1)) And (Not Exists(Select * From Dictionary Where Value = @.String2))
Begin
INSERT INTO Result (IAData, DataFound, Reason, Decide, DateNow) VALUES (@.ResCol1, @.ResCol2, @.ResCol3, @.ResCol4, @.ResCol5)
End

End
FETCH NEXT FROM ST2_Cursor INTO @.String2
End

CLOSE ST2_Cursor
DEALLOCATE ST2_Cursor

FETCH NEXT FROM ST1_Cursor INTO @.String1
End


CLOSE ST1_Cursor
DEALLOCATE ST1_Cursor

__
Results will be add to "Result" table

After that, I will deallocate my temporary tables which I have created.

_
drop table #SeperateString1
drop table #SeperateString2
_

This SP will be run in about 3 hours !
Problems occour is memory ! For about an hour to run, my memory I detected in "Task Manger" grown up to 200MB --> 300 MB (Amazing and suprised !) and my computer "run" slowlier than before ! I don't know why ! Can you help me to explain.

For me, the way to explain in this case is Microsoft SQL Server 2000, he was not able to free memory after each session, it was still in my RAM (and even over my RAM, because there is no room to contain them)! So that, it was grown up in an amazing way !

My solution in this case is use an array of string to compare (not simulate a virtual array)! But, in data type of SP not have "array" !

What can I do now ? Please help me to find the way to solve this problem, thanks for all !

I think the fuzzy lookup and fuzzy grouping transforms in Integration Services work very well for solving problems like the one you described. If you need more details, here is the Integration Services dedicated forum: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=80&SiteID=1

Hope this helps

|||

Thanx to Bogdan Crivat on your suggest,

I tried to find Integration Services from your link of forum and found out that I can use this thing :

go

sp_configure 'show advanced options', 1

go

reconfigure

go

sp_configure 'max server memory', 400

go

reconfigure

go

sp_configure 'min server memory', 100

go

reconfigure

go

But, It is does not apply to maximize my memory, it is over 400 when I run my program !

Note : I use Microsoft SQL Server 2000 in Windows XP SP2.

Regards,

Tran Quang Phuong.

A Probelm with sqlConnection Command ....

I have met a problem in the ASP.NET project creation with SQL Server Database Connection.

"Can't Login to My ServerName/ASPNET

How to solve the problem?

You need to give the ASPNET account a login and permissions to your database in SQL Server.