Changing Database Name
Nov 19, 2002hi, I have created a database in sql server 2000. I need to duplicate the database under different name, how can I do that?
Also, can I rename a database name?
thanks
Ali
hi, I have created a database in sql server 2000. I need to duplicate the database under different name, how can I do that?
Also, can I rename a database name?
thanks
Ali
Hi
I am trying to change the host database (MSDB) of Database Mail to some new database (say NewDB) and
unable to make DatabaseMail90.exe point to this new database (NewDB).
Is it possible to do this?
Thanks
Uddemarri
I have come across a problem having developed my DTS packages on one database (dev server) which has a different name to the database on the Test/Live servers. I had planned for this in that I was changing the server and database source before executing the package. When I tested this it turns out that the file import transformation that references the table to import into specifies the whole database.owner.table name and the database portion has not changed and therefore the package fails. I've dumped the package using the dts utility to view the vb script and have found the property DestinationObjectName (part of the custom task object for the relevant step...) which looks like the one to change but is this really what has to be done?
regards
Ken
Hi all,
I have an application that executes the USE command as it's first order of businees with the database. According to the SQL Books On-line, all USE commands will result in the following message being generated:
Error 5701
Severity Level 10
Message Text:
Changed database context to '%.*ls'.
However, my application has never reported this message, execept for at one customer site. I cannot figure out why at this one particular site, the customer is seeing this message each time the application starts. Once they ok the message, everything else with the application is fine, but it is a nuisance for them (gotta love customers!).
Any ideas why this would start happening?
Hi.
I thought I had this solved but after running aspnet_regiis again
I am having the same problem.
I can't log onto my sql server because the default DB is master.
The following command using sqlcmd gives me the master db:
Code:
SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
GO
So, to try to fix this i ran:
Code:
EXEC sp_defaultdb 'sa', 'my_default_db'
GO
and no luck. I went over to the DB server and checked
the permissions under SERVER/SQLEXPRESS > SECURITY > LOGINS. All except NTAuthority and Administrators have
my intended DB as the default (including ASPNET).
This is frustrating because I know I have figured it out
before but I can't remember what I did. Help appreciated.
Thanks.
Hi there,
We currently install some of client's databases on SQL Server 2000 with the collation set to Latin1_General_BIN but we have one client that was installed and now running on SQL_Latin1_General_CP1_CI_AS and I was wondering if we can change the collation on the database to Latin1_General_BIN?
Would this have any adverse affects on the DB or the data within it? Our strings are nvarchar.
Thanks for your help
Hi,
I currently have a web application connected to a MSSQL 2005 database. We are signing some new clients to our web application who will be using a different language set. So were going have to change the database to Unicode? Anyone have any experience with this, or what are the steps implications involved?
Thanks.
d
that sounds obvious but I'm stuck...
I have an ASP.net application which someone else started and I continue.
on the SQL server there was a user X which was used to access the database from the ASP website.
I accidently changed the password in the SQL server and now I cant restore the prior settings
(trying to reset password to blank or embedding the username and password in the connection string didnt work).
it stops on "connection.open" with - "SQLException Login failed for user 'X'"
any ideas why that happens and how I can fix it?
thanks
Hey guys,
I uploaded my website from VWD Express to ipower. My database did not work, which I have learned upon some research should have not been a shock to me, but most definetely was. When I contacted tech support they told my that my web.config files were pointing to my local paths. That I should change them and I should be fine. Elsewhere, in the knowledge base I found the strConnect that I am under the impression I need to use.
strConnect = "Provider=SQLOLEDB; Server=SQL-A1; UID=account_username; PWD=account_password; Database=user_db_name" oSQLServer.Connect strServer,strLogin,strPwd
The problem is, I'm a complete newbie, learning as I go and I can't find anything on where or how I insert this into my web.config to correct my paths. IPower will not help with coding. I know my current connection string is in web.config in the appsettings, that's about as far as my knowledge goes.
So, could anyone show me how I go about putting this into my web.config? Examples are very helpful :]
On a side note, I've been reading that this is a common problem among newbies like myself. So, is changing these files actually going to work, or am I wasting my time? Also, before I get knee-deep into it, is the database-publishing kit put out by MS the way to go here?
Thanks for any and all replies, you guys are always awesome.
My sql database is in suspect mode, please help me with step by step how can i change the suspect status to normal status, please dont provid eme the links of other site and help me in your own language
iam getting following error:
TITLE: Microsoft SQL Server Management Studio------------------------------
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------ADDITIONAL INFORMATION:
Database 'msdb' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information. (Microsoft SQL Server, Error: 926)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=926&LinkId=20476
------------------------------BUTTONS:
OK------------------------------Thanks in advance
Hi
I want to change collation_name of my SqlServer Database by running a script. But I don't know how.
Please help me.
Thanks
I am having a hard time finding materials on this subject. I am guessing I am using the wrong keywords to search. Basically, I want to be able to modify database tables through a web form. They can add columns and delete columns through the form. I would just want to default the type of column and the length. I am sure it has been done, I was just wondering if anyone had some resources they could throw my way. I would appreciate it. Thanks.
View 1 Replies View RelatedIf you enter "Create Database test", the database files (mdf file & log file) are created, by default, in:-
C:Program FilesMicrosoft SQL ServerMSSQLData
I want to change that to:-
D:Database Files
I sucessfully moved the model database to this location (using the instructions in BOL) assuming that all new databases would now get created in the same location, but they don't. They still get created in:
C:Program FilesMicrosoft SQL ServerMSSQLData
So how do I change the default?
(It's not satisfactory to have to move each database after it's created)
Thanks, Andy Abel
I currently have a server with the collation set to SQL_Latin1_General_CP1_CI_AS.
However, some of the databases within the server are set to Latin1_General_BIN, probably because they were restored from another server some time ago. Also, even within the databases that have Latin1_General_BIN, some of the columns are set to SQL_Latin1_General_CP1_CI_AS, very confusing to say the least.
What i would like to do is change the database collation settings for these databases to match the server setting. I would also like to change all of the tables within these databases to have the columns also set to the server collation settings.
I'm looking for the steps that i would need to take to make sure i don't mess anything up as these databases have there own sets of views and sp's that run each day.
Hi there
I am using SQL server 2000 and
I want to Change Server Collations from SQL_Latin1_General_CP850_BIN to
SQL_Latin1_General_CP1_CS_AS.
Can anybody help me in this regard.
Rgds
Wilson
I had a query that executed in about 20 seconds pulling from database 1. The only changes I made were to make it pull from database 2. It is currently running and has been for over an hour and a half.
View 2 Replies View RelatedI need to create a stored procedure in the master database that canaccess info to dynamically create a view in another database. Itdoesn't seem like it should be very hard, but I can't get it to work.Here's an example of what I want to do.CREATE PROCEDURE create_view @dbname sysnameASBEGINDECLARE @query varchar(1000)SELECT @query = 'use ' + @dbname + ' go CREATE VIEW ........'EXEC(@query)ENDIn this case, I get an error with the word "go". Without it, I get a"CREATE VIEW must be the first statement in a batch" error. I tried asemicolon in place of "GO" but that didn't help either.Thanks
View 4 Replies View RelatedI need to change the table codes to in memory optimized but every time I try to change I got an error message like you need to change database to memory optimize.
So, I try to change it using this code:
ALTER DATABASE Coralreef_ ADD FILEGROUP Coralreef__mod CONTAINS MEMORY_ OPTIMIZED_ DATA.
When I used this I got an another error:
Msg 10797, Level 15, State 2, Line 1..Only one MEMORY_OPTIMIZED_DATA filegroup is allowed per database.
So, How can I change database to in memory optimized database.
Hi,
I am building a data warehouse for a customer who has systems located in two different countries.
I need to import that data from four seperate databases, which all share the same structure.
To do this i have created 20 packages to import that data from the source database. What i would like to do, is at run time set which database the SSIS package should get its data from.
In sql 2k this was easy with a global variable that was set, then use a dynamic properties task to set the data source.
How can i achieve the same result in SSIS? the data source is an ODBC connection, with the four ODBC connections having similar names, eg ABC_NZ, ABC_AU
Thanks in Advance!
Truby
I am working on an application that was initially set to connect to a SQL database.
The application is for a Pocket PC and now I have converted the original SQL database to a SQL Mobile database.
Does anyone know if there is a way to change the the code to be able to access the SQL mobile database without having to go through all the code and manually make the changes?
Thanks
Hello, We are re-writing our site in asp.net using sql server. Most of the site uses asp classic and it was to an access database. During the conversion we have everything working correct to SQL Server except for the asp.net connection string. There is an important part of the application using asp.net which works fine with our connection string to the access database. To recap our problem is the connection string from asp.net to sql server. This code works fine for the asp.net to access in the web.cnfg file </microsoft.web> <connectionStrings> <add name="SalesConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:inetpubvhosts hemarketingvp.comsubdomainsvphttpdocsfpdbsalesMain.mdb" providerName="System.Data.OleDb"/> <add name="ODBCSalesConnectionString" connectionString="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=E:inetpubvhosts hemarketingvp.comsubdomainsvphttpdocsfpdbsalesMain.mdb"/> <add name="RawConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:inetpubvhosts hemarketingvp.comsubdomainsvphttpdocsfpdbsalesMain.mdb" providerName="System.Data.OleDb"/> <add name="ConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|inventoryStatus.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient"/> </connectionStrings> <system.web> The code in the global.asa which works fine for classic asp to sql server also works fine and is as follows '--Project Data Connection Application("sales_ConnectionString") = "Driver={SQL Native Client};Server=DMSERVER01;Database=SQLsalesMain;UID=nTrack;PWD=nTrack2k3" Application("sales_ConnectionTimeout") = 15 Application("sales_CommandTimeout") = 30 Application("sales_CursorLocation") = 3 Application("sales_RuntimeUserName") = "" Application("sales_RuntimePassword") = "" Our programmer who set this up is out for a couple of weeks and I would appreciate any help in the correct connection string from asp.net to the sql server database in the web.cnfg file Thanks
View 5 Replies View RelatedHi,
I have an ASP.NET application that uses VARCHAR extensively in the tables and, more importantly, stored procedures (a couple hundred of them).
This app needs to start accepting foreign language in some areas, so I was wondering if there was some way to go through the tables and, more importantly, the stored procedures and change all "VARCHAR" references to "NVARCHAR" ?
Are the stored procedures stored as a text file somewhere on the server? If so I could use some sort of "replace" software utility to go through and change all VARCHAR to NVARCHAR
thanks!
-Bret
I have installed my modell database onto c:mssql7data...
How do I now change the properties of this so that when someone creates a database, the path it will get created to is set to d:
I thought that I could just move model, but it seems that this isn't possible.
Any advice?
thanks
derek
changing master database location in sql server 2000
HELLO PLEASE HELP ME I AM TRYING TO CHANGE THE LOCATION OF MASTER DATABASE ( MDF AND LDF ) AND ERRORLOG FILES I HAVE TRIED EDITING STARTUP PARAMETERS IN ENTERPRISE MANAGER I FAILED ,I TRIED IN COMMAND
PROMPT "SQLSERVR.EXE " I SUCCEEDED IN CHANGING THE DATA FILE AND ERROR LOG BUT UNABLE TO CHANGE THE LOG FILE PATH FROM DEFAULT LOCATION C:PROGRAM ............
TO D:DATA
PLEASE GIVE ME THE PROCESS TO CHANGE DATA ,LOG AND ERROR LOG FILES of master database
thanq in advance
Hi
After install the mdf and log files are stored in the Program Files directory tree.
How do I change the place were they are stored to a path of my own choice, so that new DBs get created there too?
I've looked though the docs, but I can't find this.
Thanks
John
I am new to Reporting Services and need some advice. We have to move a Reporting Services' databases to a different machine. One MS doc says to use the Reporting Services Configuration Tool, and one doc says to use RSConfig.exe. Is there any reason to choose one over the other? What are the gotcha's?
Thanks
I'm using SQL Server 2005 Express.
In my main database table I have many fields but the two following fields are my main concern.
1) email_address
2) unsubscribe
In my secondary database table I have one record only.
1) email_address
What I want to accomplish... I want to compare the email_address of the secondary database table to the email_address of the main database table and if it exist, change the value of the unsubscribe field. (or if I can't do that, then delete the record within the main database table completely.)
I'd really appreciate any help I can get.
Thanks,
Bill
Hi,
I have a small problem. I've gone through the SSIS wizard and created a dtsx file which imports data from an access file into a SQL Server 2005 database. It has been set to delete existing rows and enable identity insert.
I then edited the .dtsx package in SQL Server Management Studio and added an environment variable configuration to allow me to change the destination database. In the script which runs the dtsx, here is what I have (it's an x64 system, so hi have to use DTExec):
"C:Program Files (x86)Microsoft SQL Server90DTSBinnDTExec.exe" /file e: estimport.dtsx /set Package.Connections[DestinationConnectionOLEDB].Properties[InitialCatalog];newdatabasename
and here is the error I get:
Description: The configuration environment variable was not found. The envir
onment variable was: "InitialCatalog". This occurs when a package specifies an e
nvironment variable for a configuration setting but it cannot be found. Check th
e configurations collection in the package and verify that the specified environ
ment variable is available and valid.
I got the package.connections.etc etc path from originally creating the environment variable as an xml config file, then I could open the config file and see what the path was...
Any help would be appreciated :)
hello,
i recently changed the machine name of my development computer and am now no longer able to create or view any diagrams for the sql database that was created by the old machine name user. i receive an error where I cannot make myself "the dbo of this database." i can see the old name in the "owner" properties field of the mdf database, but the box is grayed out and i am unable to change it to the new machine/user name. is there a way to change the owner of the database to my new machine/user name? the new name has admin rights and the computer is a standalone workstation not connected to a network.
i am using sql server 2005 express edition with visual web developer.
thanks!
I am running an application with an SQL database and it works fine. My question is about a customer changing his information. We will need to be able to produce copies of old orders/invoices even after that company's info has changed (e.g. he moved or changed the company's name).
Assuming he changes his company's name, for example, do I,
1. Enter him as a "new" company? This allows me to keep the old info in the database if I query the "old" name but does not provide any portability of "old" information forward to the "new" company like payment patterns, past orders, etc. since he is "new" and has no past.
2. Or do I change the record of the"old" company to reflect the "new" name? Here I can keep the "old" past under the "new" name but I now cannot retrieve an old document that reflects the "old" name.
3. Or, the third alternative is to export to alternative storage all the files of the "old" company and go to number 2 above?
I thought about copying the "old past" into a "new" customer but then I'd have double sales, receipts, etc and I just can't see an end to that debacle.
None of these sound like fun but I'm sure I'll soon have to do one of these. I can't be the first one to ask this and I'm sure there is someone out there who is smarter than me/has a more elegant solution. Any suggestions?
I also posted this to Small Business Development forum but thought the SQL guys might have another idea.
Hello...
When I migrated data from one SQL Server to another I got collection problems because collation of the target server was different from the source one.
The best solution I thought about was to change collation of the database in target server to be equal to the server collation so that when a temporary table is created, and the collation used would be the server collation, no error would occur. All sounds logic, but, after I ran ALTER DATABASE command and changed the collation of the database, I verified that all varchar fields of all database tables retained the old collation, not the new database collation I set.
Is there any way to change the collation of all fields at once when I change the database collation?
Thanks for your help
Jaime
Hi all,
I'm trying to get an understanding of a serious problem I have with a large DB in production. This is going to be obvious to someone (everyone probably) <bg>
I have a table which consists of numerous varchars and ints but also a Text type field. This table resides in a SQL 2000 Database. This DB currently has a data file size of 16Gb and a Transaction Log size of 17Gb. When I edit the table and increase the size of a Varchar field from 50 to 100 these files grow to more than double their size!
Why is this happening and how can I prevent this?
TIA
NozFx
Hi!
Can I process a cube without error if there is an application that writes data into the source SQL Server database?
Do I have to stop that application every time when I want to process the cube?