Friday, March 30, 2012
how do I add a user?
Using SQL Server 2000, SP4, on Windows 2000 Server.
I'm moving an ASP-built web app from one machine to another. It works on the
old one, not on the new. Specifically, the error I get is:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'XXX'.
(where I replaced the login name with X's.)
So I am looking on the old machine (the one that works) and the new one, to
see what differences I notice, and sure enough, in the old one, under Users,
I see the user called XXX. So I go to my new one, which doesn't have a user
by that name, and I attempt to add it. But it doesn't let me add it. In
fact, I am not sure how to add it. I right-click on Users, and try to fill
in the user name but it says that that user doesn't exist, so I can't add
it. Which is ridiculous. I mean, how does any user exist if you don't get a
chance to add them?
Middletree wrote:
> Seems like such a simple thing. But I am pulling my hair out.
> Using SQL Server 2000, SP4, on Windows 2000 Server.
> I'm moving an ASP-built web app from one machine to another. It works on the
> old one, not on the new. Specifically, the error I get is:
> Microsoft OLE DB Provider for SQL Server (0x80040E4D)
> Login failed for user 'XXX'.
> (where I replaced the login name with X's.)
>
> So I am looking on the old machine (the one that works) and the new one, to
> see what differences I notice, and sure enough, in the old one, under Users,
> I see the user called XXX. So I go to my new one, which doesn't have a user
> by that name, and I attempt to add it. But it doesn't let me add it. In
> fact, I am not sure how to add it. I right-click on Users, and try to fill
> in the user name but it says that that user doesn't exist, so I can't add
> it. Which is ridiculous. I mean, how does any user exist if you don't get a
> chance to add them?
>
>
You have to first create a LOGIN, then map that LOGIN to a database as a
USER. When you moved the database from the old server to the new, how
did you do it? If you did a backup/restore, you'll have to first drop
the user from the database before mapping the login. The user SID (an
internal ID) is stamped in the database referencing the user from the
original server.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||I did a detach/reattach.
Your suggestion worked. Thanks!
how do I add a user?
Using SQL Server 2000, SP4, on Windows 2000 Server.
I'm moving an ASP-built web app from one machine to another. It works on the
old one, not on the new. Specifically, the error I get is:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'XXX'.
(where I replaced the login name with X's.)
So I am looking on the old machine (the one that works) and the new one, to
see what differences I notice, and sure enough, in the old one, under Users,
I see the user called XXX. So I go to my new one, which doesn't have a user
by that name, and I attempt to add it. But it doesn't let me add it. In
fact, I am not sure how to add it. I right-click on Users, and try to fill
in the user name but it says that that user doesn't exist, so I can't add
it. Which is ridiculous. I mean, how does any user exist if you don't get a
chance to add them?Middletree wrote:
> Seems like such a simple thing. But I am pulling my hair out.
> Using SQL Server 2000, SP4, on Windows 2000 Server.
> I'm moving an ASP-built web app from one machine to another. It works on t
he
> old one, not on the new. Specifically, the error I get is:
> Microsoft OLE DB Provider for SQL Server (0x80040E4D)
> Login failed for user 'XXX'.
> (where I replaced the login name with X's.)
>
> So I am looking on the old machine (the one that works) and the new one, t
o
> see what differences I notice, and sure enough, in the old one, under User
s,
> I see the user called XXX. So I go to my new one, which doesn't have a use
r
> by that name, and I attempt to add it. But it doesn't let me add it. In
> fact, I am not sure how to add it. I right-click on Users, and try to fill
> in the user name but it says that that user doesn't exist, so I can't add
> it. Which is ridiculous. I mean, how does any user exist if you don't get
a
> chance to add them?
>
>
You have to first create a LOGIN, then map that LOGIN to a database as a
USER. When you moved the database from the old server to the new, how
did you do it? If you did a backup/restore, you'll have to first drop
the user from the database before mapping the login. The user SID (an
internal ID) is stamped in the database referencing the user from the
original server.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||I did a detach/reattach.
Your suggestion worked. Thanks!
Wednesday, March 28, 2012
How do a get a listing of all available SQL Servers on a network.
Thanks in advance,
Jeremyi answered my own question... hope this helps some one
To restate my problem.
I need an app that will list all of the available SQL Servers on a network. There are many ways to do this ... this is one. I would like to see better ways if anyone has time.
1. Download the SQLUtils.dll from (watch for line wrap)
http://codeproject.com/useritems/listsqlservers.asp?print=true
2. Register the SQLUtils.dll using regsvr32.exe
> regsvr32 c:/inetpub/wwwroot/lib/sqlutils.dll
3. Build your web form
// C#
using SQLUtils;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.ListBox ListBox1;
private void Button1_Click(object sender, System.EventArgs e)
{
SQLUtils.ListServers oSqlUtils = new SQLUtils.ListServers();
// String svr = new String();
oSqlUtils.Domain = TextBox1.Text;
oSqlUtils.GetSQLServers();
foreach( String svr in oSqlUtils.Servers )
{
ListBox1.Items.Add(svr);
} // end of foreach loop
} // end of Button1_Click()
4. You will need to add a reference in your project to the .dll file. Right click on the project and select "Add Reference". Browse to the location and select.
I also found these... (watch for line wrap)
http://www.windows2000faq.com/Articles/Index.cfm?ArticleID=14327
Friday, March 23, 2012
How could I obtain the domain name from SQL?
I would need from T-SQL job or through any friendly-user function (VB
front-end app) the aforementioned value.
With EXEC xp_cmdshell 'IPCONFIG /ALL' I get values such as HOST NAME or
IP Adress. Problem is the following: if oneself launch IPCONFIG /ALL from a
DOS session it is obtained DNS suffixes list with values hoped: domain,
Active Directory and so on. But launched from Query Analyzer due to it
returns more than a row appear as NULL value.
Does anyone know how/where it is available?
Best regards,> But launched from Query Analyzer due to it
> returns more than a row appear as NULL value.
Is this the only problem?
CREATE TABLE #foo(cmd VARCHAR(1024))
INSERT #foo EXEC master..xp_cmdshell 'IPCONFIG /ALL'
SELECT * FROM #foo WHERE cmd IS NOT NULL
DROP TABLE #foo|||Dear Aaron,
Is this the only problem?
No!
Your solution not works because of appers the line empty.
Thanks a lot for your support,
"Aaron Bertrand [SQL Server MVP]" wrote:
> Is this the only problem?
>
> CREATE TABLE #foo(cmd VARCHAR(1024))
> INSERT #foo EXEC master..xp_cmdshell 'IPCONFIG /ALL'
> SELECT * FROM #foo WHERE cmd IS NOT NULL
> DROP TABLE #foo
>
>|||> Your solution not works because of appers the line empty.
Okay, so is this really that difficult?
SELECT * FROM #foo WHERE cmd > ''
Friday, March 9, 2012
How can my c#.net app open a rs report?
I have just developed the c# app and the rs report...how does my c# app
open the report (and how does it pass parameters)?
Thanks,
TrintTwo ways to integrate. Either with URL integration (embed the IE control and
give it the appropriate URL) or web services. URL integration is easier.
With Widbey and Yukon their will be available a winform and webform controls
but for now you need to use one of these other integration methods.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"trint" <trinity.smith@.gmail.com> wrote in message
news:1104503150.525220.298270@.c13g2000cwb.googlegroups.com...
> Ok,
> I have just developed the c# app and the rs report...how does my c# app
> open the report (and how does it pass parameters)?
> Thanks,
> Trint
>|||Look at the ReportViewer control that is part of the Sample
Applications that are installed with RS. It is designed to view the
report in a web page, but might be helpfull.
Sunday, February 19, 2012
How can I track the queries being issued against my sql server 2000 instance?
I have an ASP.NET app built on top of SQL Server 2000. My app is running slowly and I think I'm issuing too many queries to the database.
How can I track the queries, and when they are being issued, against my sql server 2000 instance? Is there a tool to view the queries, or is it all in a log file somewhere?
This will help me tune my ASP.NET caching strategy.
Any help is greatly appreciated!
Franco
Use SQL Server Profiler|||Choose: SQL Server, Tools, SQL Profile, File, New, Trace, Choose Server...On the filters tab of the new window you see you can choose various filters. These include database name, application name, NT UserName, there are many to choose from.
SQL Profiler is an amazing tool for seeing whats happening "under the hood" I suggest you really read up on it in SQL Books Online as its extremely powerful.
Keep us all up to date with how you are getting on.
hth
Pace
|||Fantastic... just what I needed. Thanks!
How can I track the queries being issued against my sql server 2000 instance?
I have an ASP.NET app built on top of SQL Server 2000. My app is running slowly and I think I'm issuing too many queries to the database.
How can I track the queries, and when they are being issued, against my sql server 2000 instance? Is there a tool to view the queries, or is it all in a log file somewhere?
This will help me tune my ASP.NET caching strategy.
Any help is greatly appreciated!
Franco
Use SQL Server Profiler|||Choose: SQL Server, Tools, SQL Profile, File, New, Trace, Choose Server...On the filters tab of the new window you see you can choose various filters. These include database name, application name, NT UserName, there are many to choose from.
SQL Profiler is an amazing tool for seeing whats happening "under the hood" I suggest you really read up on it in SQL Books Online as its extremely powerful.
Keep us all up to date with how you are getting on.
hth
Pace
|||Fantastic... just what I needed. Thanks!