Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Tuesday, March 27, 2012

Attach db from installer (only read mode)

Hi,

I have made setup of my program,

I need to attach a db to the server. To do this:

- Copy mdf and ldf files into default data folder of instance of sqlexpress

- run scrip from custom action in the installer that:

a. attach the db

b. create login

c. create user for login in db

There is a problem...I run script slq file by sqlcmd and launch it from a c# process.

The rusult is that the db was attacched but in only read mode, and the point c not work.

If I execute manually the same script sql with sqlcmd in dos window, it work without problem in all point: a,b and c

What are the reason of this?

I think that start process in c# not work correctly....this is the code:

process = new Process();

process.StartInfo.FileName = "sqlcmd.exe";

process.StartInfo.Arguments = commandLine;

process.Start();

process.WaitForExit();

help me, plese!

thanks in advance

andrea

SInce you have posted this in Express forum, i strongly feel that you should use SQL Server Express User Instance feature. Its nothing but Embedded Database.

Refer this.

http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx

Madhu

Sunday, March 11, 2012

Assigning User to a Database

Hi

I am using SQL SERVER 2000. Until now my application used the default user "sa", but now the illigal access to my database make me move to a more secure login.

i am new to this concept.

i need to create a login, which i am successful in creating, but my problem is

I need to allow only this user to access my database and no other user should login my database.

please can any one explain how to do this.

its very urgent.

regards

James Alvin

Noone is granted access to a database unless you allow it, so go ahead and create a user and give him the appropiate permissions on the database. Make in addition sure, that if you want to restrict the sysadmin users (which is by default the sa and the members of the sysadmin group, e.g. the local administrators) you will have to remove them from the groups / disable the sa account.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

hi

how can we disable sa account in sql server 2000

|||

You can't disable sa on a SQL Server 2000 instance. Not in any way that would be supported. Some time ago, a few people hacked at the system tables and eventually removed sa but then they had continual problems, couldn't apply service packs and were on an unsupported system. So not in any way that would be supported or stable.

Another option, depending on your application, would be to use just Windows Authentication and use impersonation in your application to log in with just the one windows account you add to the users for this database.

Sysadmins will still be able to access that database though. If it's that critical to lock out everyone, you would want to look at auditing as well as explore third party options for encryption.

-Sue

.

|||

Yes, I ment dismanteling instead of disabling. What I do in reality is to give the sa a cryptic (long and non-guessable) password and lock this in the (virtual) safe. Noone should use that account beside emergencies (like locked accounts etc.) Then I create a new login which has the same rights but a non well-known name (like sa, everyone know that this is the system adminstrator and therefore you only have to guess the password as you already know the name). This account is then mainly used for tasks that cannot be done with the Windows authentication (like users which are not present in the AD). If you are able only use Windows authentication you can even discard this task.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Thursday, March 8, 2012

Assigning default aggregate function to calculated member

Is there any way to assign a default aggregate function (e.g. SUM) to a calculated member just like we can do this with a regular measure?

What I need to do is assign a custom calculation in my calculated member at the lowest grain (e.g. scoped at Date.Members and Customer.Members). Everything above this should be summed by default, e.g. Sales Territory.

Unfortunatelly, it is not possible to assign aggregation function to calculated members. If you need to aggregate them - you will have to do it manually with MDX.

The workaround is to use regular dimension members without data instead of calculated members, and assign MDX expressions to them.

|||

Hi, Mosha

Assuming the workaround, Is there difference in performance between a calculated member and a regular measure?

Assigning default aggregate function to calculated member

Is there any way to assign a default aggregate function (e.g. SUM) to a calculated member just like we can do this with a regular measure?

What I need to do is assign a custom calculation in my calculated member at the lowest grain (e.g. scoped at Date.Members and Customer.Members). Everything above this should be summed by default, e.g. Sales Territory.

Unfortunatelly, it is not possible to assign aggregation function to calculated members. If you need to aggregate them - you will have to do it manually with MDX.

The workaround is to use regular dimension members without data instead of calculated members, and assign MDX expressions to them.

|||

Hi, Mosha

Assuming the workaround, Is there difference in performance between a calculated member and a regular measure?

Friday, February 24, 2012

ASPNETDB.MDF is readonly

I have downloaded and installed ASP.NET Ajax Sample applications from

http://ajax.asp.net/default.aspx?tabid=47&subtabid=471

I am trying to run the AJAX TaskList example under C:\Program\Microsoft ASP.NET\ASP.NET AJAX Sample Applications\v1.0.61025\TaskList

First I moved the content of the TaskList folder to a virtual IIS directory, making it possible to debug the website on my local IIS server.

When I run the example I get prompted to Login or register as a new user. When I submit the registration form I receive the following error message:

Failed to update database "C:\INETPUB\WWWROOT\TASKLIST\APP_DATA\ASPNETDB.MDF" because the database is read-only.

How can I modify the permissions forASPNETDB.MDF in order to run the TaskList example.

Thanks

Additional information:

I have installed SQL Server Management Studio Express as I figured this tool might help me to change the permissions. It did not help. I also tried to delete ASPNETDB.mdf, and recreate it by going Website -> Asp.net configuration by adding a new user. I still receive the same error message.

When I point the connection string to a remote SQL database of mine it is possible to register users in ASPNETDB.mdf. But I havn't figured out how to add users using a local version of ASPNETDB.mdf.

I am running Visual Studio on Windows XP. In windows XP you can't just modify permissions for folders as far as I know. I have recently installed SQL Server Management Studio Express as I said before.

I read somewhere that the read/write property for ASPNETDB.mdf may be enabled by checking a box somewhere.

But in SQL Server Management Studio Express tried the following:

*Right click on databases and click attach

*Click Add and select the database ASPNETDB.mdf

*Click OK

*Right Click on the path for ASPNETDB.mdf and click properties

When I click 'Options' under select a page Database Read-Only is already set to false.

If there is not way to use a local version of ASPNETDB.mdf (App_Data folder) I simply have to put up with my remote MS SQL 2005 database. But the subscription fee for this database is outrageous, and therefore I hope that someone might help me and everyone else by providing the appropriate steps to use ASPNETDB.mdf located to the App_Data folder, both on the local IIS server and server side.

Thanks
Svenbro

|||This can be a permission ?issue. Open Management Studio Express->connect to SQL Express instance->go to Security->Logins->make?sure the 'NT AUTHORITY\NETWORK SERVICE' account is there.|||

The 'NT AUTHORITY\NETWORK SERVICE' account is not in the list, but there is a similar item: NT INSTANS\SYSTEM

Should I add 'NT AUTHORITY\NETWORK SERVICE' as a new account with the Windows authentication property checked?

Thanks,

|||NETWORK SERVICE?is?hidden, just type it and click check name in the browse text, you should get it.

ASPNET user with network resources elsewhere on a domain

I've been trying to workout how, without impersonation, I can allow an application running under the default ASPNET user to access a network resource (SQL Server/ADAM) not on the same physical machine.

It seems that because the ASPNET user is a local user not a domain user I can't setup windows authentication on the network resource. That seems to leave impersonation which MS et al say is unwise.

Have I mised something here?

Regards,

Steve.Yes.

You can change the user running the asp.net process. ONly the STANDARD user is a local user. It CAN also be a domain user, per your choosing.

Sunday, February 19, 2012

ASPNET 2.0 Strange StyleSheet

When I name it Default.css, it doesn't work.
When I change it to StyleSheet.css, it works automagically.
(Certainly in both cases, I ensure the href is pointing to the correct
location).
Tried and it failed repeatedly. Is this Default.css a reserved
filename or something like that?
Your question doesn't seem to be related to SQL Server. Try posting to an
ASP.NET group.
Hope this helps.
Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/
<ckkwan@.my-deja.com> wrote in message
news:b0b5e6d7-4146-4756-a696-14522560c75e@.2g2000hsn.googlegroups.com...
> When I name it Default.css, it doesn't work.
> When I change it to StyleSheet.css, it works automagically.
> (Certainly in both cases, I ensure the href is pointing to the correct
> location).
> Tried and it failed repeatedly. Is this Default.css a reserved
> filename or something like that?

ASPNET 2.0 Strange StyleSheet

When I name it Default.css, it doesn't work.
When I change it to StyleSheet.css, it works automagically.
(Certainly in both cases, I ensure the href is pointing to the correct
location).
Tried and it failed repeatedly. Is this Default.css a reserved
filename or something like that?Your question doesn't seem to be related to SQL Server. Try posting to an
ASP.NET group.
--
Hope this helps.
Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/
<ckkwan@.my-deja.com> wrote in message
news:b0b5e6d7-4146-4756-a696-14522560c75e@.2g2000hsn.googlegroups.com...
> When I name it Default.css, it doesn't work.
> When I change it to StyleSheet.css, it works automagically.
> (Certainly in both cases, I ensure the href is pointing to the correct
> location).
> Tried and it failed repeatedly. Is this Default.css a reserved
> filename or something like that?