Copying Database Disables Pwd And Must Enter New
Jan 24, 2008
I'm copying some of my development databases over to a new server and have noticed that even when I enable the acct the original password will no longer work. I have to then reenter each pwd for every acct that is in the database. I'm on sql server 2005 and I'm using the Task >> Copy Database.
View 3 Replies
ADVERTISEMENT
Nov 2, 2001
hi all, I have backup schedule for full and transaction log backup which is
recurring with no end date. But recently these schedule started getting
disable once a day by itself and I have to manually enable and run them,
then it runs for couple of times as scheduled and disables itself. In the sqlserver agent error file I found "Date calculation spin detected for schedule 129". Now what does it mean, how can I solve this. Please help. I am using sqlserver7, sp 2.
Note: the database is also published for transactional replication.
Thanks.
View 1 Replies
View Related
Feb 1, 2008
Hi i am trying to enter more than one value into my constructor field in my database, at the moment when the values are entered into the database through the front end, they appear in the database as seperate records however they have the same ID, the only thing that changes is are the data in the fields which i want in just one. This is the part of the stored procedure I am sure is causing this to happen;
IF @Access_Right_ID=8 or @Access_Right_ID=3 or @Access_Right_ID=9 BEGIN DECLARE @Delimiter char(1) SET @Delimiter = ',' DECLARE @CommaPos int SET @CommaPos = Charindex(@Delimiter,@Constructor_IDs) DECLARE @Remaining_Constructor_IDs VARCHAR(8000) SET @Remaining_Constructor_IDs = @Constructor_IDs DECLARE @Constructor_ID int WHILE (@CommaPos>=0) BEGIN
SET @CommaPos = Charindex(@Delimiter,@Remaining_Constructor_IDs) if @CommaPos >0 SET @Constructor_ID = ltrim(rtrim(Substring(@Remaining_Constructor_IDs,1,@CommaPos-1))) else SET @Constructor_ID = @Remaining_Constructor_IDs INSERT INTO tblUser_Constructor ( User_ID, Constructor_ID) VALUES (@User_ID, @Constructor_ID ) SET @Remaining_Constructor_IDs = SUBSTRING(@Remaining_Constructor_IDs,@CommaPos+1,LEN(@Remaining_Constructor_IDs)-@CommaPos) if @CommaPos=0 set @CommaPos = -1 END
View 2 Replies
View Related
Jun 4, 2008
Hi,
On my page I am using a wizard control with textboxes to collect data from the visitor.
When they click the finish button - this inserts their data into a Sql database.
On the form is a checkbox.
I dont know what type to use in the database column to accept this and also
how to configure the checkbox on the page so I know if its checked.
Also what would be inserted into the database column "yes" "no" or a numerical value??
Thanks for any advice?
amereto
View 1 Replies
View Related
Mar 25, 2008
Hi all,
In the Programmability/Stored Procedure of Northwind Database in my SQL Server Management Studio Express (SSMSE), I have the following sql:
USE [Northwind]
GO
/****** Object: StoredProcedure [dbo].[SalesByCategory] Script Date: 03/25/2008 08:31:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SalesByCategory]
@CategoryName nvarchar(15), @OrdYear nvarchar(4) = '1998'
AS
IF @OrdYear != '1996' AND @OrdYear != '1997' AND @OrdYear != '1998'
BEGIN
SELECT @OrdYear = '1998'
END
SELECT ProductName,
TotalPurchase=ROUND(SUM(CONVERT(decimal(14,2), OD.Quantity * (1-OD.Discount) * OD.UnitPrice)), 0)
FROM [Order Details] OD, Orders O, Products P, Categories C
WHERE OD.OrderID = O.OrderID
AND OD.ProductID = P.ProductID
AND P.CategoryID = C.CategoryID
AND C.CategoryName = @CategoryName
AND SUBSTRING(CONVERT(nvarchar(22), O.OrderDate, 111), 1, 4) = @OrdYear
GROUP BY ProductName
ORDER BY ProductName
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
From an ADO.NET 2.0 book, I copied the code of ConnectionPoolingForm to my VB 2005 Express. The following is part of the code:
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.Common
Imports System.Diagnostics
Public Class ConnectionPoolingForm
Dim _ProviderFactory As DbProviderFactory = SqlClientFactory.Instance
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
'Force app to be available for SqlClient perf counting
Using cn As New SqlConnection()
End Using
InitializeMinSize()
InitializePerfCounters()
End Sub
Sub InitializeMinSize()
Me.MinimumSize = Me.Size
End Sub
Dim _SelectedConnection As DbConnection = Nothing
Sub lstConnections_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles lstConnections.SelectedIndexChanged
_SelectedConnection = DirectCast(lstConnections.SelectedItem, DbConnection)
EnableOrDisableButtons(_SelectedConnection)
End Sub
Sub DisableAllButtons()
btnAdd.Enabled = False
btnOpen.Enabled = False
btnQuery.Enabled = False
btnClose.Enabled = False
btnRemove.Enabled = False
btnClearPool.Enabled = False
btnClearAllPools.Enabled = False
End Sub
Sub EnableOrDisableButtons(ByVal cn As DbConnection)
btnAdd.Enabled = True
If cn Is Nothing Then
btnOpen.Enabled = False
btnQuery.Enabled = False
btnClose.Enabled = False
btnRemove.Enabled = False
btnClearPool.Enabled = False
Else
Dim connectionState As ConnectionState = cn.State
btnOpen.Enabled = (connectionState = connectionState.Closed)
btnQuery.Enabled = (connectionState = connectionState.Open)
btnClose.Enabled = btnQuery.Enabled
btnRemove.Enabled = True
If Not (TryCast(cn, SqlConnection) Is Nothing) Then
btnClearPool.Enabled = True
End If
End If
btnClearAllPools.Enabled = True
End Sub
Sub StartWaitUI()
Me.Cursor = Cursors.WaitCursor
DisableAllButtons()
End Sub
Sub EndWaitUI()
Me.Cursor = Cursors.Default
EnableOrDisableButtons(_SelectedConnection)
End Sub
Sub SetStatus(ByVal NewStatus As String)
RefreshPerfCounters()
Me.statusStrip.Items(0).Text = NewStatus
End Sub
Sub btnConnectionString_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnConnectionString.Click
Dim strConn As String = txtConnectionString.Text
Dim bldr As DbConnectionStringBuilder = _ProviderFactory.CreateConnectionStringBuilder()
Try
bldr.ConnectionString = strConn
Catch ex As Exception
MessageBox.Show(ex.Message, "Invalid connection string for " + bldr.GetType().Name, MessageBoxButtons.OK, MessageBoxIcon.Error)
Return
End Try
Dim dlg As New ConnectionStringBuilderDialog()
If dlg.EditConnectionString(_ProviderFactory, bldr) = System.Windows.Forms.DialogResult.OK Then
txtConnectionString.Text = dlg.ConnectionString
SetStatus("Ready")
Else
SetStatus("Operation cancelled")
End If
End Sub
Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click
Dim blnError As Boolean = False
Dim strErrorMessage As String = ""
Dim strErrorCaption As String = "Connection attempt failed"
StartWaitUI()
Try
Dim cn As DbConnection = _ProviderFactory.CreateConnection()
cn.ConnectionString = txtConnectionString.Text
cn.Open()
lstConnections.SelectedIndex = lstConnections.Items.Add(cn)
Catch ex As Exception
blnError = True
strErrorMessage = ex.Message
End Try
EndWaitUI()
If blnError Then
SetStatus(strErrorCaption)
MessageBox.Show(strErrorMessage, strErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
SetStatus("Connection opened succesfully")
End If
End Sub
Sub btnOpen_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnOpen.Click
StartWaitUI()
Try
_SelectedConnection.Open()
EnableOrDisableButtons(_SelectedConnection)
SetStatus("Connection opened succesfully")
EndWaitUI()
Catch ex As Exception
EndWaitUI()
Dim strErrorCaption As String = "Connection attempt failed"
SetStatus(strErrorCaption)
MessageBox.Show(ex.Message, strErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Sub btnQuery_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnQuery.Click
Dim queryDialog As New QueryDialog()
If queryDialog.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
Me.Cursor = Cursors.WaitCursor
DisableAllButtons()
Try
Dim cmd As DbCommand = _SelectedConnection.CreateCommand()
cmd.CommandText = queryDialog.txtQuery.Text
Using rdr As DbDataReader = cmd.ExecuteReader()
If rdr.HasRows Then
Dim resultsForm As New QueryResultsForm()
resultsForm.ShowResults(cmd.CommandText, rdr)
SetStatus(String.Format("Query returned {0} row(s)", resultsForm.RowsReturned))
Else
SetStatus(String.Format("Query affected {0} row(s)", rdr.RecordsAffected))
End If
Me.Cursor = Cursors.Default
EnableOrDisableButtons(_SelectedConnection)
End Using
Catch ex As Exception
Me.Cursor = Cursors.Default
EnableOrDisableButtons(_SelectedConnection)
Dim strErrorCaption As String = "Query attempt failed"
SetStatus(strErrorCaption)
MessageBox.Show(ex.Message, strErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Else
SetStatus("Operation cancelled")
End If
End Sub
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
I executed the code successfully and I got a box which asked for "Enter the query string".
I typed in the following: EXEC dbo.SalesByCategory @Seafood. I got the following box: Query attempt failed. Must declare the scalar variable "@Seafood". I am learning how to enter the string for the "SQL query programed in the subQuery_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnQuery.Click" (see the code statements listed above). Please help and tell me what I missed and what I should put into the query string to get the information of the "Seafood" category out.
Thanks in advance,
Scott Chang
View 4 Replies
View Related
Mar 28, 2007
Hi all can you help me please, I need the users to be able to enter in a date for a self generating report. Usually I use the @Enter_Date but I need them to be able to enter a start date and a end date
But when I run this query SQL gives me an error message Server: Msg 207, Level 16, State 3, Line 1
Invalid column name 'Enter the Start Date'.
Server: Msg 207, Level 16, State 1, Line 1
Invalid column name 'Enter the End Date'.
What should use in place of BETWEEN [Enter the Start Date] And [Enter the End Date]??
SELECT [Main Table].[IR Number], [Main Table].Date, [Main Table].Inspector, [Main Table].Area, [Main Table].Violation, [Main Table].[Violation Type], [Main Table].Loss, [Main Table].[Loss Type], [Main Table].Employee, [Main Table].Action, [Main Table].[Action Type], [Main Table].Notes
FROM [Main Table]
WHERE ((([Main Table].Date) Between [Enter the Start Date] And [Enter the End Date]))
ORDER BY [Main Table].[IR Number]
View 4 Replies
View Related
Mar 9, 2000
How to maintain Database User Permissions when copying the Database from One SQL Server to another(Either through backups or sp_detach). The reason is the login sid is different in the target server and as a result the database user is not able to map to the login existing in the target server. The only way I can correct this is through dropping and recreating the user's again and assign the permissions, or change the system catalog - sysusers to remap the login to the user in the database.
I do not wish to use the sp_addalias as it is available only for backward compatibility.
Is there a better way of doing this ?
View 4 Replies
View Related
May 5, 2008
I am trying to copy one database to another using copy wizard for SQL Server 2005. The destination database is on another server/box.
I get the following errors when executing the SSIS package: "The job failed. The Job was invoked by User abcd. The last step to run was step 1 (abcd_0_Step).".
"Executed as user: BILLSVRSYSTEM. ...ion 9.00.3042.00 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 11:30:55 AM Progress: 2008-05-05 11:30:56.81 Source: crmtest_BILLSVR_Transfer Objects Task Task just started the execution.: 0% complete End Progress Error: 2008-05-05 11:30:57.34 Code: 0x00000000 Source: abcd_abcd_Transfer Objects Task Description: Failed to connect to server crmtest. StackTrace: at Microsoft.SqlServer.Management.Common.ConnectionManager.Connect() at Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.OpenConnection(Server& server, ServerProperty serverProp) InnerException-->Login failed for user 'abcdabcd$'. StackTrace: at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.... The package execution fa... The step failed."
Can this be done? Is there something that needs to be set security wise for this to work?
View 9 Replies
View Related
Mar 27, 2004
Hi all,
I want to copy a database from my SQL Server system and install it on another. Can anyone suggest me how I can copy the same along with log info, login info, permissions, etc. and install it on another system. Thanks!
Vik!
View 4 Replies
View Related
Aug 18, 2004
Hi,
I am changing my hosting from one company to another company. How can I copy my full database along with views and stored procedures. I have only access to query analyzer and enterprise manager from where I am not able to backup the database on my local computer. As it is very urgent please suggest me a way to do this.
Thanks in advance,
Uday
View 2 Replies
View Related
Oct 11, 2004
hi,
i m new 4 sql server.
i create one app. in asp.net.
i create one database in sql server.
now,
i want to make setup for my app.
so,
i want copy database and put on c:/..../wwwroot/app folder.
how can i do this?
one more things,
i create database using enterprise manager.
i want to see my database file.
where it is stored?
somebody help me.
it's urgent.
thanks in advance.
View 1 Replies
View Related
Nov 9, 2005
I created a DB on the server. i would like to make a copy of it (structure and data) on my local machine to play with. Then i try using the wizard i get this error:
Your SQL Server Service is running under the local account. You need to change your SQL Server Service account to have rights to copy over the net work.
Where do I go to change my rights to copy over the net work?
View 9 Replies
View Related
Apr 13, 2007
HI I'm quite new to the admin side of SQL server 2005
and I need help copying a SQL database to my colleagues laptop (we are not on a network)
Basically I try to copy the .mdf file so that he can attach it onto his server, but I get the following error:
"Cannot copy ....mdf as it is being used by another person or program"
Although I am not using it. i.e. i re-start my pc and try to copy it and get the same error.
I also try to detach the database from SQL and copy it, but still no luck.
Please can anybody give me assistance.
Many thanks!!!
View 5 Replies
View Related
Jan 21, 2008
Hi all,
New member here...
I've used SQL2000 before (Enterprise Mgr, Query Analyzer), but, now I'm at a company without any DBAs so I'm on my own as far as administration goes which I haven't done before on SQL2000.
We have a production database about 100MB in size. As of now there is no development DB. They won't pay for a new server, so I'd like to create a new development database on the same prod server. Then, I want to copy the existing prod database into the new dev DB.
I've read up some on DTS, but I wanted to check with the community to see if anyone had other recommendations or if this is the best way to go about it.
Also, is this a process that should run at off-hours? Would the copy of production lock the DB up?
Thanks a lot...
View 4 Replies
View Related
Apr 5, 2008
Hello,I'm trying to make a copy of a database with this code
Code Snippet
private void button1_Click(object sender, EventArgs e)
{
string dbname = @"D:Documents and SettingsBeheerderMijn documentenVisual Studio 2005ProjectsTest12Test12inDebugDatabase1.mdf";
string constr = string.Format("Data Source=(local)\SQLEXPRESS;AttachDBFilename="{0}";Integrated Security=True;Connect Timeout=30;User Instance=True", dbname);
using (SqlConnection connection = new SqlConnection(constr))
{
connection.Open();
connection.Close();
}
File.Copy("Database1.mdf", "Database1Copy.mdf");
}
but once the code tries to execute the File.Copy line it comes with an error that the database is currently in use by another program, and also when I'm debugging the program and I try to copy this database with windows explorer it says that the program is currently in use.I've read up some stuff and found that you can stop the SQLServer Service, wich I did but then my program gave an error about not being able to connect to the database, when starting upand also detaching and attaching a database, wich I don't know how to do.So my question is are any of these above methods correct to do, and how do write the code for it? If not is there any other way to copy a database?Thanks in advance,Ruben Pieters
View 7 Replies
View Related
Jun 10, 2007
Hey
in query analyzer, how do you copy a table form one db to another db
i thort it was something like
select * into dbo.databaseA.tableNew from dbo.databaseB.tableOld
cheers
View 6 Replies
View Related
Sep 5, 2007
Hi, I have a database diagram on my sql server 2005, how can i copy that diagram to my pen drive so that i can build the database using that diagram on another computer...well the bottom line is i want to copy the datbase from one computer to another. thanksVishal
View 4 Replies
View Related
Mar 25, 2008
Can anyone advise me of a convenient way to make a copy of a database in SQL2005. I need to make a complete copy - including all Stored procedures, functions tables and table contents.
I want the place the copy ont he sae SQL server but obviously under a different name.
View 1 Replies
View Related
Jun 17, 2008
Hi,Whats the best and easiest way to copy a table from one database to another via ASP.net?I want to copy from SQL Server to Oracle. I have an ODBC connection for Oracle.I was thinking I could use a DataSet, but wasn't sure of the details on doing this. Am I off base on this?What I have so far..1) I can get the data from SQL Server into a DataSet.2) I can establish a connection to Oracle via ODBC and the database has the appropriate table structure.How do I 'use' the SQL Server DataSet to copy the data to Oracle?Thanks,Scott
View 4 Replies
View Related
Oct 21, 2004
Hi, I'm trying to copy one SQL Server Database into another SQL Server DB within the same server. I learnt a bit about this copying, that it copies only the Database structure, the Tabels, constraints view stored procedures etc etc. Is there a tutorial where I can get clear instructions to do this. I just need the table structure without any data to be copied into this. Have even tried exploring creating and executing DTS packages but cudn't get much help with this. Any help wud be really appreciated.
Thanks
View 4 Replies
View Related
Apr 24, 2005
Hi. im shortly going to have to submit my project for uni which ive created using sql server. How can i copy everything that ive made so i can submit everything and it can be replicated if necessary. Do i use the backup database task in enterprise manager or do i have to do that and export data or..?
ive used tables and stored procedures and a diagram btw.
thanks for any advice
View 1 Replies
View Related
Aug 8, 2005
Hi All,I have a database that I would like to copy for another project. The instance is SQLEXPRESS, I have copied the MDF file, renamed and then copied it back but how to I attach this.I have read a small article about XCOPY but could really understand it, and are there limitation of doing it this way ... i just want an exact copy in the same instance ?Anyone got any links to tuttorials for doing this?Thanks in advancelee
View 1 Replies
View Related
Apr 26, 2001
Hi,
Does anyone know how to copy a database from one server to another? I want to backup a production database and restore it to a different server (a test server) as a test.
I used a sample from the MCDBA study book and all I got was two copies of Northwind on the same server. Any idea what I did wrong? Seems like you should be able to backup on one server and restore on another. Here's the code I used:
BACKUP DATABASE Northwind
TO DISK = 'Sd-appsmssql7DataNwind.bak'
RESTORE FILELISTONLY
FROM DISK = 'Sd-appsmssql7DataNwind.bak'
RESTORE DATABASE Northwind2
FROM DISK = 'Sd-appsmssql7DataNwind.bak'
WITH MOVE 'Northwind' TO 'Sd-sqlmssql7DataNorthwind.mdf',
MOVE 'NorthwindLog1' TO 'Sd-sqlmssql7DataNorthwindLog1.ldf'
GO
Thanks for your help.
View 5 Replies
View Related
Jan 31, 2002
What is a good way to do such a thing?
Kevin
View 1 Replies
View Related
Feb 25, 2001
I have a question regarding copying users from one server to another that are running different versions of Microsoft Sequel Server.
I have Server A running 6.5 version and Server B running 7.0 version. How can I copy just the list of users from Database1 on Server A to Database2 on Server B.
Can anyone help me.
Thanks.
Lakshmi.
View 2 Replies
View Related
Oct 25, 2005
Hello,
I have created a complete database with its tables, views, procedures, everything in SQL Server for a system. Now I am creating another system and I have realised that I can use almost the same fields I have and only do small changes, therefore I want to copy the existing one and rename it
I have been trying to copy it but I don't know how to copy exactly everything. Could you help me please?
Any help would be really appreciated!
Thank you
Gloria
View 1 Replies
View Related
Nov 23, 2004
Hi All,
I need to take a copy of a database present in a SQL server to other SQl server using VB.net code.
I can make it out with wizards but i need the query to execute it thru vb.net.
Thanks
Aravind....
View 2 Replies
View Related
Sep 30, 2004
We recently got a new SQL Server 2000. I'm not really a SQL/Network admin but I was tasked to migrate some of our databases in the SQLSVR7 to SQLSVR2K.
I tried using DTS EXPORT but getting errors. Is there a better way to do this?
Any info would be appreciated.
View 6 Replies
View Related
Feb 20, 2004
I have a MSDE database on a laptop and need to copy it to another machine in order to use Access 2000 to inspect the tables and view the data using an Access project adp file.
Could someone please tell me how to do this and whether there are any relevant issues/problems.
thanks
View 1 Replies
View Related
Mar 5, 2004
Hi
I am new to SQL Server. I am required to make a copy of a live database, or bring the database down and then make a copy of it.
I need to create a webpage to query the database, but another scheduling program also connects to the database, so that shceduling can be performed
Any help
View 2 Replies
View Related
Apr 13, 2004
Hi guys,
I can't find what is wrong.
I am copying a database via DTS and I get an error mid way "Invalid object dbo.fx_get_role_from_ownerid". But the object does exist and it has benn in production for a while now.
Why would I get his error, if the object does exist?
View 5 Replies
View Related
Apr 10, 2008
I am attempting to move a User Database from the Production Server to a Training Server. What is the best/most simplistic way for me to accomplish this task and place this copying action on a schedule of say "every saturday morning @ 7am"
I tried the "Copy Database Wizard" within Enterprise Manager and it successfully copies the database, however when I try to schedule it to happen at a different time...it does not copy the database. It seems to only work when I tell it to perform this action now.
Please help.
Thanks,
JC
View 11 Replies
View Related
Jun 24, 2008
Hi,
How can prevent from stoping sql-server sevice and copying database,
note user has a access right to pc/server.
Kind Regards,
sasan.
View 4 Replies
View Related