Say for example I have the following 2 database tables, the first one contains the old employee data, and has the fields shown below:
oldEmployeeID
FirstName
LastName
DateOfBirth
HiringDate
TerminationDate
and another one containing the new employee data with similar fields but instead of oldEmployeeID, it is showing the newEmployeeID.
During the conversion process, something were messed up and instead of putting in the original hiring date of the workers into the new employee database, the conversion date was put in, which, depending on the mood of HR ladies, could be any date, and at the same time, of course, new employee join the company, and we assume their hiring dates were entered correctly. On top of that, there are some employee who were terminated before the conversion took place but we still need to keep a record of that.
And I created a third table, say, emplyeeAll with similar fields to the employee data tables.
So here is what I need to do: if the firstName, lastName and DateOfBirth in the old employee data table and the new employee data table matches, I would assume they are the same employee, hence I would put the information for the employee obtained from the new employee data table to the employeeAll table, with the Hiring Date changed to the Hiring Date of the old employee data table (and do not copy the record from the old employee table to prevent duplicates), otherwise, I would simply copy and paste the data in new and old employee table to my employeeAll table.
I know this is really confusing, but...well...hope you know what I am saying...
Is it possible to have a SQL statement for all these? If so, how should the statement looks like?
Hi I had sql server 2005 standard edition and express edition and sql 2000 desktop edition all installed on my xp notebook.
Whe i tried to create a maintenance plan in sql 2005 standard edition i got an error saying that it couldn't load something (which looked like it might be dll) so I tried to reinstall sql 2005 standard edition over the top to replace the dlls. However the install wizard told me that it can't do anything as all components are already installed! So i decided to remove SQL 2005 and start again. In add remove programs i removed various components (like vss writer, and one or two others) then when i clicked on SQL 2005 to remove it I got a message saying that it had already been removed and would i like to remove it from the add remove programs list.. so i said yes. It actuallly appears that it is installed (after a fashion) although i can't connect to it anymore in ssms. If i put the cd in to try to reinstall it still tells me that it's already installed....i'm stuck now!
So.. i need to do something drastic to remove sql 2005 (as i can't remove it from the add remove programs and the CD won't let me reinstall over the top) Can anyone help me with any suggestions to physicall remove it
I also check to make sure the username doesn't already exist in the PATWEB table
here is what I have so far that is not working (table reference not unique - BILTOS)
INSERT INTO PATWEB (PatientID, UserName, PIN, Question, Answer, LastAccess) SELECT PATIENTS.PatientID, 'bcolladay@pdsmed.com', 'osx5ief7*', 'What', 'green', CurDate() FROM PATIENTS, BILLTOS JOIN PATIENTS BILLTOS ON PATIENTS.BillToID = BILLTOS.BillToID WHERE not exists (select * from PATWEB Where PATWEB.PatientID = PATIENTS.PatientID) AND PATIENTS.BirthDate = '1971-05-03' AND PATIENTS.Name LIKE 'lui%' AND STMTHIST.BillToID = PATIENTS.BillToID AND STMTHIST.PatBal = '215.00' AND STMTHIST.PrepDate = '2008-03-05' AND BILLTOS.Address1 = '987 Worley St' AND BILLTOS.Name LIKE 'Lui@'
so I am checking to see if the billing statement and other info they supplied matches before I create the account in PATWEB.
"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString MM_valUsername=CStr(Request.Form("userId")) If MM_valUsername "" Then MM_fldUserAuthorization="" MM_redirectLoginSuccess="/private/private.asp" MM_redirectLoginFailed="/private/privatelogin.asp" MM_flag="ADODB.Recordset" set MM_rsUser = Server.CreateObject(MM_flag) MM_rsUser.ActiveConnection = MM_conConsumer_STRING MM_rsUser.Source = "SELECT LastName, Password" If MM_fldUserAuthorization "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization MM_rsUser.Source = MM_rsUser.Source & " FROM dbo.PLStaff WHERE supervisor != 570 and LOWER( left(firstname,1)) + LOWER(lastname) ='" & Replace(MM_valUsername,"'","''") &"' AND Password='" & Replace(Request.Form("password"),"'","''") & "' and Emp_state = 1 " MM_rsUser.CursorType = 0 MM_rsUser.CursorLocation = 2 MM_rsUser.LockType = 3 'response.Write(MM_rsUser.Source) MM_rsUser.Open If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then ' username and password match - this is a valid user Session("MM_Username") = MM_valUsername session.Timeout = 30
If (MM_fldUserAuthorization "") Then Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value) Session("manager") = 1 Else Session("MM_UserAuthorization") = "" End If if CStr(Request.QueryString("accessdenied")) "" And false Then MM_redirectLoginSuccess = Request.QueryString("accessdenied") End If MM_rsUser.Close Response.Redirect(MM_redirectLoginSuccess) End If MM_rsUser.Close Response.Redirect(MM_redirectLoginFailed) End If %>
Where do I find out the name of the table being accessed to authenticate the user?
first db has a user called 'bob'.. that's the login on the server and also the login name on the db in question.
this db has several SP's owned by 'bob' which need to copied to the second db.
Here's where the problem starts.
Somehow, this second db has the standard users it needs, however the db User has a LoginName of 'bob'..
So basically if I try and create a user of 'bob' on the second server which will then allow me to copy these SP's across it says it already exists.. but if I just go ahead and try and copy the SP's it says the User does not exist.
Just to clarify what I mean..
I go into the 2nd db using EM.
go to users:
the visual that appears shows me several users in order with their
Name | Login Name | DB Access
the dbo user is set as:
dbo | bob | 2nd db
basically what I need (I think) is for that login Name to be removed from the dbo user and applied to specific user called bob...
Fairly new to DBA work. In error log receiving message Error 1105 Can't allocate space for object 'Syslogs' in database 'msdb' because the logsegment is full.
I've looked in books and is this a serious problem, as I've tried to increase the size of the MSBD device but it will not allow me it says the Max size allowed is -1197MB...Is this right
Hey EveryoneI have a desktop machine and a laptop machine. Both have XP Pro. I prefer to code on my laptop, but I want to use my desktop machine as a home server/development environment because its always on. I have IIS (HTTP and FTP), .NET 2.0, my mp3 server, etc up and running just fine on my desktop.When I'm working on an application, I access the site with VWD through a network share. It's worked great so far. What I haven't been able to do, however, is connect to the database with VWD or Management Studio Express. I don't even really know where to begin with this one. What I don't want to do is open this up to the internet. I'd like to just keep it accessible from the LAN (the database, not the website)I'm new to database stuff, and I don't really know where to look to figure out how to do this. Basically, I want to have the same functionality with VWD or Management Studio that I would have if I was physically on the machine with the SQL Express server.If anyone can provide some advice, I'd really appreciate it.Thanks!Brandon
Hello,I am working on an ASP.NET web site using an SQL database. Is there a way to Insert/Delete and Update data in the database without creating all the forms in ASP.NET?Since I am the only person to work with the database it would be easier for me than creating all ASP.NET forms.Thanks,Miguel
I have worked with mysql for sometimes now and everywhere there was a mysql there was phpmyadmin for managing it but now on my new windows hosting with plesk I don't see such program. The only thing I see is a pothetic program called ASP.NET enterprise manager that doesn't allow uploading data.
In a previous application i stored about 100.000 actions ( coming from an external system )in an access database for each day. Therefore i created everyday a new accessdatabase to have enough performance. Each month i copied automatically all databases in a new 'month' map as a backup.
The goal of the application is the view all actions of one day of week in one grid. This is a kind of history of the external system.
I'm afraid the application will become to slow if i save all actions in one database. ( after 1 month i will have 3.000.000 actions.
How this is done in an sql server ? Do i have to use a different kind of method ?
Hi, I'm currently migrating to Sql 2005 from 2000 and have a quick question about indexes. In 2000 i used to click on Table > All Tasks > Manage Indexes... to view and create all my table indexes. There doesn't seem to be anything similar in 2005 Management Studio. I thought it was under Table > Modify but there's nothing there for indexes. I've had to create all my indexes manually through t-sql but this doesn't help when needing to view and manage current indexes. Can anyone help me on this?
Hi All It´s my DropDownList data source from my page1.aspx: <asp:DropDownList ID="ddlChampionships" runat="server" DataSourceID="sdsSearchChampionships" DataTextField="name" DataValueField="id_championship"> </asp:DropDownList><asp:SqlDataSource ID="sdsSearchChampionships" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>" ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [Tupi_Campeonatos]"></asp:SqlDataSource> When I put a new championship name in a TextBox and click on the button "ADD", this button event click is called: Protected Sub btAddChampionship_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btAddChampionship.Click insertNewChampionshipIntoDataBase() End Sub The Page then reloads but my DropDownList is not updated. The way I found to do it is to put the DDList update code after the calling of the insertNewChampionshipIntoDataBase() method, but how??? thnx
1. The user may browse any website on the internet that may be in any language and enter the data into my application. 2. The data entered can be in English or any other language. 3. That’s were the problem arises; the data that enters the database other than English is displayed in wrong format like small boxes. 4. The user who had previously entered the data in the database can also alter that data. So when I display the data (other than English) to him it is not in the format in which the user had entered.
So can anybody help me out how to manage multilingual data?
I have a user that I have granted the server role "securityadministrator" and a database role "db_securityadmin". When logged inas this user I can create new logins but not run sp_adduser to add thenew login to as this says I don't have permission to do this. I canhowever run sp_revokedbaccess to get rid of a user from the database.
Hello,We have an XP workstation containing a very important MSDE-basedapplication. Its MSDE database isn't likely to change for quite awhile.The app contains an internal backup method (File, Backup, Backup) andan auxiliary app/script for shrinking the database and logs. I wouldlike to automate the backup and shrinking so end users don't have toremember to do them.The workstation has a static IP so it can go out to the Internet whennecessary.The workstation is presently not joined to the domain.1. Can I install SSMS Express *only* as a local app (without SQLExpress 2005) and thus use SSMS to set up nightly backups and periodicshrink database/logs jobs??2. We have SSMS running on SQL 2005 server box in the domain. If Ijoin the workstation only to the domain (local account logon is notchanged, still used), could I use SSMS from the SQL 2005 box?? Would Ineed a domain login on the XP box to make this work??Thank you, Tom
I want to manage my sql express .mdf database file (e.g. set Roles) but I seem to only be working with a temporary instance of my database when I attach to .sqlexpress and manage in SQL Server Management Studio Express (SSMSE). The Role I set is gone when I detach and re-attach.
If I try to manage my file in Visual Studio under Server Explorer, I do not see the "Roles" folder to modify roles.
I have SQL server admin id and password, and I want to do some create/delete new database, or mimium do some select statements. What do I need to install on my workstation in order to connect to SQL server remotely? What's the equivalent tools as SQLPlus in Oracle?
At our facility, we have a > 350 gigs database and the DB is breaking into 2 files. One file is our Image table with the size of 300 gigs. The other file contains all of the other tables. The image file is getting bigger and bigger everyday, I am worry that eventually when a data file getting too big it could lead into problem. - DB fragmentatio, hard to manage etc
My question is anyone has run into this problem, and how do you solve it?
i've a server which is reside in remote area. my database store in drive E where disk capacity is 1000 GB and DB size reached 800GB , now disk free space showing 10 GB only . how to manage space.couple of week back i've tried to shrink the database but it is not completed successfully and since the time db size drastically increase. now i'm sitting in corner.can we perform partial shrink only on MDF. so that we can manage the space (starting from 10 gb only)
How to manage sql server runtime message to users understand it?
In my web form I added folowed code
If Session("Action") = "Edit" Then
Try
ObjectDataSource1.Update()
Catch ex As Exception
lblMessage.Text = ex.GetBaseException.Message
End Try
for manage user input for update the record.
This is message returned by sql server 2005
The UPDATE statement conflicted with the REFERENCE constraint "FK_DEVIZE_RELATION__DRZAVE". The conflict occurred in database "Trgo2006", table "dbo.Devize", column 'Drzava'. The statement has been terminated
This message not understand for users. How to manage messages retrned by sql server, or prepare exception to return message understanded for users.
I am pretty new in SSIS 2005, and I have some problems... I want to add logging and error management in my package. I found how to made logging. But for errors managing i have some difficulties.
In my package I have only a flat file source and an ole db destination. I want add errors management for both of them. So I create a connection manager for errors on a file. For both element i add redirect row for all available error type and then i add 2 flat file destination. I branch red arrows of flat file source and ole db destination to the flat file destination.
When i run packge i have an error which indicate me that file error is already take by another process... I don't understand why. And i don't want to create on file for each element on package. Have you any idea on why i have this error? Or how can i made what i want do?
Hi, it's my first time to use MSDE. So would you guys please recommend me a third party software or application which has interface to manage it? thank you!