|
In your first example, OleDbConnection conn = new OleDbConnection(@"Provider=SQLOLEDB;User ID=sa;Initial Catalog=master;Data Source=(local);"); , you didn't provide a password for the 'sa' account. But in your statement about how you installed MSDE, you said that you set the password to 'sa'. So, for this connection string, you should add Password=sa; . However, it is recommended that you not use a system administrator account to connect to the database from an application.
In your second example, you are using integrated security, which means that the connection is made to the database using the currently active Windows login. I assume from the username in the error message, and your statement that it's the machine name, that you're writing a service, and it's set up to run using the system account. This would work, but you'll have to use a tool (or write an app) to configure the database server to allow this account to login, and give it access to the specific database that it needs to access. Note that since you set Integrated Security=SSPI; , the User Id=sa; part of the connection string is ignored.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
|
|
|
|
|
HI,
I have an access database using workgroup file to allow users to access it.
I want to connect this database in the ASP.net application. I want to know how to write the connection string to use authentication from the workgroup file.
Thanks
Ali Alaradi
Developer
|
|
|
|
|
|
how do I limit the selection in of my "select statement" in orale 8.1
|
|
|
|
|
Praneeth_konda wrote:
how do I limit the selection in of my "select statement" in orale 8.1
if I understand you correctly ..
limit the select using where clause..
Select col1,col2,..... from table1 where col1=XYZ and col2='ABC'
|
|
|
|
|
Can anyone help me ?
I have to change a text fileld to ntext field with very large volume of data. I am using MS-SQL 2000. updating and droping takes too much time and converting syscolumns is leading unwanted results.
|
|
|
|
|
Unfortunately, updating and dropping is the only convenient way to do it.
You COULD take the database offline, export all the data from the table to flat file, drop and recreate the table with the new layout, and then re-import the data previously exported. But This will most likely take just as long or longer than just letting Enterprise Manager do things its own way.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
|
|
|
|
|
Thanks for your answer Grimolfr, I badly need that and if I don't, it is as simple as I cannot do this.
I don't need to detatch the database, what I am currently doing is adding a col, updating the new col from prev col, deleting the actual col and updating the syscolumns to rearrange it's order. Everything works fine but, the updation time.
I wanted to know if it is possible to get EM using COM, so that I can open table in design mode and change the property from within there (possibly using sp_oacreate or sqldmo objects) and may be I Look a bit dummy suggesting all these stuffs but who knows if gurus has some hidden secreats.
|
|
|
|
|
Well, certainly you can use SQLDMO to do this. The problem is that there's really no method faster than what you're already doing. The best you can hope for, I think, is to put the database in single-user mode where you're the only user, and not perform the changes in a transaction.
BTW, be careful modifying the system tables directly. This can often have unexpected results, and cause the table to become pretty much useless.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
|
|
|
|
|
I have a datatable and performaing select method on that.
I have to pass array of values to the select method,
is there any way how i can do that?
Here goes the code
string[] emp;
dtemp.select()- How should i pass array of strings inside the function.
Regards,
|
|
|
|
|
You can only send so many parameters through the select statement. Is your array a list of those parameters?
I would do a quick "for each param in string, str = str + param + and" or something like that until you can get the string parameters out of the array. That is the only way I know how to use the dtemp.select.
|
|
|
|
|
Dear friends,
My SQL server was configured during its setup stage with userid = sa and password = sa. It means that any client application can access SQL server with this userid and password.
Now i want to change the password. but i dont know from where to change it. I opened "Enterprise manager". From "tools menu" i select "SQL Server Configuration properties". Then i select "Security" tab. But there is no such option of changing the password.
Please tell me how can i change the pasword for my SQL server. Also i want to change from SQL server authentication to domain user authentication. How can i do so ?
Imtiaz
|
|
|
|
|
hi Imtiaz,
Go to Enterprise Manager...
Expand the left tree control and navigate to the database for which you want to change the password...
Under the database name node u will find Users
Click users and in right pane you will find the user "sa"
right click and change property...
I guess I have told you the right navigation....
because I don't have SQL server or client installed on my machine... itz not open infront of me... so sorry if I have told anything wrong... but the basic funda is:
for each database therez a user section under which user list can be found...
Hope this solves your prob...
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
Aryadip's answer is close:
In Enterprise Manager, expand the node for the server, then expand "Security", then click on the "Logins" node. In the list of logins you'll see "sa." Right-click on the login and select "Properties." About halfway down the dialog you'll see the password box where you can type in a new password.
On a side note, it's really not a good idea to use the sa (System Administrator) account for normal application access. You should create special limited-access accounts for your apps, or use Windows Authentication and manage users' database access through their login accounts.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
|
|
|
|
|
You can use sp_password in the Query Analyzer
the sintaxys is as follows
sp_password [ [ @old = ] 'old_password' , ]
{ [ @new =] 'new_password' }
[ , [ @loginame = ] 'login' ]
the extra parameter is for the System Admin to change others people's passwords
ex: sp_password 'sa', 'whateveryouwant'
|
|
|
|
|
Hi,
If I have created an encrypted stored procedure with stytax below, is there a way I can edit it at later stage? Or I must keep a master copy at others machine or database?
<br />
CREATE PROCEDURE sp_MyProcedure<br />
{<br />
@CustName nvarchar(128)<br />
<br />
WITH ENCRYPTION<br />
}<br />
<br />
AS<br />
<br />
<br />
regards,
K-PAX? YOUR BUSINESS NEED, OUR CUSTOM MADE
|
|
|
|
|
From Books Online:
"Encrypting Procedure Definitions
If you are creating a stored procedure and you want to make sure that the procedure definition cannot be viewed by other users, you can use the WITH ENCRYPTION clause. The procedure definition is then stored in an unreadable form.
After a stored procedure is encrypted, its definition cannot be decrypted and cannot be viewed by anyone, including the owner of the stored procedure or the system administrator."
You'll have to keep a master copy of the stored procedures somewhere else.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
|
|
|
|
|
Hi Grim,
I get thhi note from the MsSQL help file too. Which mean, I have to save a master copy of the SP in somewhere else.
Also, I have 1 more question about the encrypted stored procedure performance. Will it decrease significantly comapre to those not encrypted?
regards,
K-PAX? YOUR BUSINESS NEED, OUR CUSTOM MADE
|
|
|
|
|
It will have an impact, of course. But the impact shouldn't be significant. The only time the SQL Server needs to decrypt the procedure's code is when it needs to do a compile/recompile of the procedure. This is already an expensive process, anyway, so I doubt you'll notice the additional performance hit.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
|
|
|
|
|
I have 1 table that connect 2 other table to it.
I mean -->
Table 1 Table 2 Table 3<br />
IDPerson IDRelation IDWorkPlace<br />
IDPerson<br />
IDWorkPlace
What I would like to know, is how can I get all the IDPerson that are not in the Table 2 ....
This is not the real name of tables and fields but believe me, it must be like this.
I am a newbie and maybe not but who cares
|
|
|
|
|
Table 1 | Table 2 | Table 3
IDPerson | IDRelation | IDWorkPlace
xxxxxxxx | IDPerson |
xxxxxxxx | IDWorkPlace|
Sorry
I am a newbie
|
|
|
|
|
I can't understand your layout. If you're saying that it's like this,
<br />
[Table 1]<br />
---------<br />
IDPerson<br />
IDRelation<br />
IDWorkPlace<br />
<br><br />
[Table 2]<br />
---------<br />
IDPerson<br />
<br><br />
[Table 3]<br />
---------<br />
IDWorkPlace<br />
then you can use
SELECT t1.IDPerson
FROM [Table 1] t1
WHERE
t1.IDPerson NOT IN (
SELECT t2.IDPerson FROM [Table 2] t2
)
I'd recommend against naming tables using spaces. -Jeff
|
|
|
|
|
Exactly what I needed Thank you.
And it's not the real table name and field.
I am a newbie
|
|
|
|
|
You can use 'not in' in query :
select * from table1 where idperson not in (select idperson from table2)
Om Prakash
|
|
|
|
|
hello, i get this error-> System.Data.SqlClient.SqlException: Login failed for user 'xxx\ASPNET'
do some one knows how to solve it?
i am new to sql and i use msde.
thank u in advance
|
|
|
|