Tuesday, March 27, 2012
Attach db ... but changing its db name
I need to import into my SQL to compare data and structure with my
own to release him some new feature. Problem is how to import it.
If I simple attach db, SQL server mustn't do it, trapping duplicate
db name or something else (I wish is so and not overwrite db).
If I detach my db, and attach customer db ... I must rename db ...
but how? until today I never read of some function that rename
db ...
Can anyone give me more info please?
--
Sincerely
Andrea Morowhile attaching db with sp_attach_db you can specify the required name of
the database to be. If you want to rename the existing database you can make
use of system stored proceudre sp_renamedb
--
-Vishal
Andrea Moro <moroandreaET@.tiscalinet.it> wrote in message
news:#kH0j9LcDHA.1204@.TK2MSFTNGP12.phx.gbl...
> I've a copy of my customer db detached from its server.
> I need to import into my SQL to compare data and structure with my
> own to release him some new feature. Problem is how to import it.
> If I simple attach db, SQL server mustn't do it, trapping duplicate
> db name or something else (I wish is so and not overwrite db).
> If I detach my db, and attach customer db ... I must rename db ...
> but how? until today I never read of some function that rename
> db ...
> Can anyone give me more info please?
> --
> Sincerely
> Andrea Moro
>sql
Tuesday, March 20, 2012
ASTrace Utility on x64 server
Hi,
I’m testing the new ASTrace service and when I’m running it on my own personal notebook it runs just
fine.
The problem starts when I try to run the service in a x64 environment. The service installs properly,
but when I try to start it, it fails.
Looking at the log file the service writes to, I noticed that the service looks for files on the path:
C:\Program Files\Microsoft SQL Server\90\Tools\Binn\
However, being an x64 server, all those files are located on:
C:\Program Files(x64)\Microsoft SQL Server\90\Tools\Binn\
Is there any way I can point the service to look for the files in the x64 folder?
Thanks,
Yaniv
I would report this issue here as they seem to be pretty responsive:
http://www.codeplex.com/MSFTASProdSamples/WorkItem/List.aspx
Note that Codeplex is having some downtime currently, but I'm sure it will be back up in the next few days.
|||Which file(s) is it looking for?
If it is only the Microsoft.SqlServer.ConnectionInfo.dll file, then you could try copying this file from the (x64) folder into the same folder where you installed ASTrace. I'm not sure if this works for a service, but it often does for a win forms app (it depends a bit on how the reference has been made)
I would still ask on the connect site, but this might get you up and runinng in the short term.
|||Thanks Darren,
The file is PFCLNT90.dll, which I have tried to copy, but it still complained about this file and “other dependency” files missing.
I figured I don’t want to start copying the entire directory...
Appreciate your help!
Saturday, February 25, 2012
ASPNETDB.MDF, My Own Database and Deployment
This question has been asked before, with vague responses
I'm using Visual Web Developer 2005 Express, SQL Server 2005 Express and SQL Server Management Studio Express.
When I create an application with Login controls, VWD automaticlly creates a ASPENTDB.MDF security database. I also create my own database for my application e.g. abc.mdf. In other words, I have two databases. However, my hosting company supports only one database. What do I (we) do?
I have seen articles on:aspnet_regsql . Does this create a new database with all the security features of ASPNETDB.MDF built into my new database i.e. abc.mdf?
(A) If yes, how do you run it with SQL Server Managment Studio Express? It sounds silly, but I need instructions here please ... Also, do you run this against abc.mdf or do you use it create abc.mdf?
(B) If not, how do you achieve a single database scenario?
I'm sure this is a very common deployment question, which is very confusing for most of us hobbyists that want to deploy their web applications
As I understand, by default the data for a application will be stored in the database (ASPENTDB.MDF ) automaticlly created by VWD--you can change your connection string to connect other databases and the data will be only put into 1 database. To understand how your website using the database, you can take a look at :
http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx
If you want to maneger the database in Management Studio, you can detach the database from your application (right click it in Server Explorer), then attach it in Management Studio. You can refer to this article:
http://msdn2.microsoft.com/en-us/library/ms187858.aspx
|||Thank you for the response. I have seen the first URL previously and have some questions on running theaspnet_regsql.exe utility
1. I do NOT have the full blown SQL Server 2005 version on my development machine (nor do I have it in my LAN). Do I need to have this in order for the aspnet_regsql utility to work?
2. I still want to develop and test locally and when satsified upload to the web hoster. If aspnet_regsql creates a full SQL Server 2005 database version for me locally, how do I manage it using VWD locally, because VWD works with the SQL Server 2005 Express version?
3. By running aspnet-regsql, does it fundamentally change VWD from using SQL Server 2005 Express thereafter for other new sites, projects and solutions on the same development machine? I do not want this to be the case
4. Can I undo or reverse the effects of running aspnet_regsql?
Cheers
Friday, February 24, 2012
ASPNETDB.MDF ... whyyyy? :(
I have my own database file, but when I run my site in debug mode it creates aspnetdb.mdf again and stores all users in there ... question is - why? :((
I've attached my own db to sql server express, ran "aspnet_regsql.exe -W" on it, so it got all the schema in there.
Here's what I have in my web.config
----
<connectionStrings>
<add name="SqlServices" connectionString="Data Source=ME\SQLEXPRESS;Initial Catalog=myOwnDB;Persist Security Info=True;User ID=user;PWD=password" providerName="System.Data.SqlClient"/>
</connectionStrings
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
<providers>
<remove name="AspNetSqlProvider" />
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
passwordFormat="Hashed"
requiresUniqueEmail="true"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
applicationName="/" />
</providers>
</membership>
----
so i connect straight to sql server, not local file (so i dont have to attach / detach the db all the time)
but when i create new user through ASP Config, it creates them in aspnetdb.mdb file :(
can anyone explain me what im doing wrong here?
thanks in advance!
As I know the aspnet_regsql.exe utility is used to create schema for hosting asp.net data in a specific database, and it doesn't mean all your web applications will push the data into the database specified by aspnet_regsql.exe. This article shows how to customize the database for storing aspnet data:
http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx