SQL Database Editing
Nov 4, 2003Can I edit database (Tables, SPs, Views,...) with ADO.NET?
View 3 RepliesCan I edit database (Tables, SPs, Views,...) with ADO.NET?
View 3 Replieshey guys,
is it possible to add or edit columns once there is data in the tables??
not the data in the columns but the columns themselves..
for example lets say i have a table with 4 columns and for some reason or
another, i want to add a 5th or 6th column after data has already been entered,
like a few months down the line..
BACKGROUND:
When SQL Server 2005 w/ SSRS2005 was installed, a database named "ReportServer" was created by the system. I use the tables in this database to generate audit/statistical reports primarily hitting the dbo.ExecutionLog & dbo.Subscriptions tables for analyzing server activity.
QUESTION:
Can I modify the tables in the system built "ReportServer" database? Or, will RS stop working? Also, if i modify the tables will it prevent an update?
DETAILS:
As for the Subscriptions table, I want to add the Field "LastRunTime" as a PK so all the history will be storeded. Curently, this table only stores the last subscription that was sent and gets over written when a that subscription is sent out again. Or, is there another way to store all history?
As for the ExecutionLog table, it only stores data for 60 days. I want to store all history. Is this possible?
All comments & suggestions are welcome & I look forward to all your respoonces!
-Jeff
If I have a *.dts file, and want to change the originating server database from SERVERA DB_A to SERVERB DB_B, is there an easy method to do this, besides editing the file in the GUI form?
View 1 Replies View RelatedI need help transferring a SQL database. I currently have my website database on a SQL 4.0.27 (vdeck) and want to transfer it to a new server (VPS) which has SQL 4.1.2
I have imported the database to my desktop computer. It will not let me import to the new server. I have to edit/reconfigurate.
Any suggestions, comments, advice, help would be greatly appreciated.
Ed
ed.sistrunk@sistrunk.net
I have scheduled a T-SQL job that runs every morning using Enterprise Manager. Now I want to change the SELECT and UPDATE statements that this job runs, but I can't find anywhere to edit a job that has already been scheduled. Any help would be appreciated.
Thanks
I keep getting "cannot update a timestamp column"!! How can I change the timestamp to all zeros? or can I not do that?
JOhn
Hi
I want to Enable Editing in the GridView
but there is a problem
the GridView take its data from 2 tables and I do this by the
build query
so I can't choose the " advance " button and check for enable update and delete statements
and when I try to build the update query in the update tap
I don't know what to write in the "new value" column
so how can enable editing in the GridView that take from
2 tables???????
please help me
and thanks
can someone help me why it produces an error....
error is: ERROR 22001 Microsoft ODBC SQL Server Driver SQL Server STRING or data of BINARY was cut short. ERROR 01000 Microsoft ODBC SQL Server Driver SQL Server statement was ended.
This is my code here for editing a record....
Protected Sub Button_save2_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button_save2.Click '||||| Create string connection Dim StrConn As String = "Dsn=MS_PKG01;UID=emiline;APP=Microsoft® Visual Studio® 2005;WSID=MSHNP200603;DATABASE=MS_PKG01;Trusted_Connection=Yes" '||||| Create connection object Dim MyConn As Odbc.OdbcConnection = New Odbc.OdbcConnection(StrConn)
'||||| Open connection MyConn.Open()
'|||| Create odbcCommand object Dim Update_record As New Odbc.OdbcCommand("UPDATE TM0001 SET TM0001.syain_name = ?, TM0001.syain_pass = ?, TM0001.office_id = ?, TM0001.birth_date = ?, TM0001.empl_date = ?, TM0001.user_iden = ? ", MyConn)
Dim hireYear As String Dim hireMonth As String Dim hireDay As String Dim date_hire As String
hireYear = DropDownList_hire_yr.Text hireMonth = DropDownList_hire_mo.Text hireDay = DropDownList_hire_day.Text
date_hire = hireYear + "/" + hireMonth + "/" + hireDay
'|||| Add command parameters Update_record.Parameters.Add("@P1", OdbcType.Char, 8).Value = TextBox_id.Text Update_record.Parameters.Add("@P2", OdbcType.Char, 20).Value = TextBox_name.Text Update_record.Parameters.Add("@P3", OdbcType.Char, 20).Value = TextBox_pswd.Text Update_record.Parameters.Add("@P3", OdbcType.Char, 40).Value = DropDownList_office.SelectedValue Update_record.Parameters.Add("@P3", OdbcType.Char, 2).Value = date_hire Update_record.Parameters.Add("@P3", OdbcType.Char, 10).Value = TextBox_bday.Text Update_record.Parameters.Add("@P3", OdbcType.Char, 1).Value = DropDownList_iden.SelectedValue
'|||| Execute command Update_record.ExecuteNonQuery()
'|||| Close connection MyConn.Close() End SubEnd Class
Hi,
I want to get (SELECT??) data from a db (SQL), edit the data (+1) and then update (UPDATE??) the table with the edited value. How do I get the value from the db and then edit it and then update the field in the db?? Does someone has an example so I get on the way??
Thanks,
Roel
Is there anyway possible to edit table design with data already entered in the table.If not, is there anyway I can cut and paste the info back in. Ive tried importing to access and then back to SQL, however, when i tried to view my table design in ASP.NET webmatrix, it gave me an error.
View 1 Replies View RelatedI've just created a new maintenance plan (sql2k sp2) and attempted to re-enter it to make a change. right click - choose properities (or double click)...I see the dialog box 'flash' very briefly but it's not making itself available for editing.
I've deleted and recreated the plan ... same result.
I _should be able to edit it, shouldn't I?
thankx
--steve...
Hi guys
Am i able to deny the SA account access to a specific database?
thanks in advance for your help.
TheGing
I have a SQL 2000 SP4 server running on Windows 2003 SP2. About 6 months ago I started experiencing problems editing existing DTS packages. At that time it was just 1 package. (I tested that I could edit all others but this one package the first time I experienced the problem.)
But now it seems like anytime we experience import problems, I cannot edit the package so that I can verify that the import file is good. (So far the initial problem is always with the import file and once we figure out what that is and resolve it the package runs ok again.)
The problem is I'm planning on migrating to SQL 2005 and since I can't import DTS packages, I'm going to have to rewrite them as Integration Service Projects. If I can't edit the workflow tasks in DTS, it will be time consuming figuring out what the actual import file is. Also, most of these imports are coming from our AS400 which we are phasing out so I have to rewrite these to work with the new ERP package we are going to as we bring on each division.
I have not installed any post SQL 2000 SP4 hotfixes. So if anyone is aware of a hotfix that resolves this issue, please let me know.
Hi to all,
We have an application that used Ms-Access for its backend.
We wanted to move up to MSDE so I wrote a conversion utility that creates the SQL database, copies all the data from the Access database, creates all the indexes and relationships.
Now, the application used a lot of sql statements which would have to be rewritten for SQL Server so we decided to create a ms-access database with linked tables to the SQL server (ODBC). Don't tell me not to do that because I have no control over it :).
The weird thing happening now is that:
All the records that were moved from access are fine.
New records can be added fine.
However, when trying to edit/delete the new records, I get an error saying that:
Write Conflict.
I can't change the record because it has been changed by another user since I started editing it.
Any ideas?
Thanks
I've recently been upgraded to Office 2003 and primaraly use Access to edit SQL stored procedures on a SQL 2000 box.
It seems though from first glance, things have gotten worse since Access 2000.
No more colour coding for example and it also opens some in a view type mode.
Any recomendations on what I can use that would allow me to edit the SQL while updating it on the server and pull down data if needed?
Someone recommened Visual Studio but I'm unsure of which version to use.
Please direct me towards good documentation about updating, inserting and deleting data using views involving multiple tables.
Thanks
I have an SP which I use to insert into a table data from another. Forexample...INSERT INTO myWorkTable(Field1, Field2)SELECTmyField1, myField2FROMmyNewTableIt's a pretty straight forward sp. Now, the data that gets insertedseems to have remained in a state that stops me updating it later. TheSP is called by one app which is then closed and not used again untilthe following month. The sp shouldn't be used by anything else.I have another application which goes to the table (in my examplemyWorkTable) and is supposed to open and edit specific records whichit does correctly navigate to (a few days after the sp). It fails andI get an error message stating that the record is being edited byanother user. This record should not be opened by any other process.If I export the data and re-import it into the table, it worksperfectly fine.The code used to edit the table is fine and has worked for a couple ofyears and I'm happy with it. The only change I have made is to use anSP to import the data instead of an old method using Access 2000. Thefunctionality is the same, even though the connection is different.The Delphi app uses BDE.Inserting directly through SQL works as I would have expected and Ican edit the record as I need.I'm guessing that Delphi (which I use for the app) is somehow notfreeing up the data locked by the SP when it finished calling the SP,even when it is closed. However, it seems a little bizarre as I wouldexpect it to free up the data affected by the SP once it has finished(maybe this is the wrong assumption).So, my question is, can an SP lock records in this way ? If so,how/why and can I stop this once finished, or is there a way ofchecking / resetting records which were locked up and should no longerbe this way. I can't see anything obvious which shows the records arelocked, but am willing to delve further.ThanksRyan
View 2 Replies View RelatedI have some software (written in Delphi 5) which has been working forseveral months without a problem.I have been given a copy of the database on our development server(SQL 7) and have pointed the software to this. So, nothing has changedwith the software. In theory the servers should be the same.However, if I try to make a small change to any record (as I would onthe 'live' system), I get an error stating that another user isediting the record. Now, I'm the only person with access to thisserver. So am I stopping myself I wonder ?If I create an ODBC connection to the database through Access 2000, Iget the same error. I feel I can reasonably assume that the softwareis not at fault.I'm sure it's something SQL based, whether it's an error orconfiguration difference, but I'm stuck.I've checked who is locking/blocking, and yes it will show me ashaving the record open, but this is me attempting to edit the recordso I would expect this.I can edit the table directly in SQL, but it takes 30 seconds or more,freezes EM and then allows the change. Table info below :if exists (select * from sysobjects where id =object_id(N'[dbo].[PostReceived]') and OBJECTPROPERTY(id,N'IsUserTable') = 1)drop table [dbo].[PostReceived]GOCREATE TABLE [dbo].[PostReceived] ([PostID] [int] IDENTITY (1, 1) NOT NULL ,[Type] [varchar] (100) NULL ,[ClientsName] [varchar] (100) NULL ,[DateReceived] [datetime] NULL ,[EnteredBy] [varchar] (100) NULL ,[AssignedTo] [varchar] (100) NULL ,[DateAssignedTo] [datetime] NULL ,[Adviser] [varchar] (100) NULL ,[TargetDate] [datetime] NULL ,[CompletionDate] [datetime] NULL ,[Completed] [bit] NULL ,[KeyAccount] [varchar] (100) NULL ,[Notes] [text] NULL ,[Specific1] [varchar] (20) NULL ,[Specific2] [varchar] (20) NULL ,[Specific3] [varchar] (20) NULL ,[Specific4] [varchar] (20) NULL ,[Specific5] [varchar] (20) NULL ,[ToDelete] [bit] NULL ,[EnterUser] [varchar] (20) NULL ,[Returned] [bit] NULL ,[ReturnDate] [datetime] NULL ,[ReturnReason] [varchar] (87) NULL ,[PrintAdviser] [bit] NULL ,[EmailAdviser] [bit] NULL ,[EmailSM] [bit] NULL ,[EmailRegionManager] [bit] NULL ,[ReturnText] [varchar] (150) NULL) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]GO(Yes I know about using Identity in the key, but it's on my list tochange before anyone says anything).
View 5 Replies View RelatedHi, I need to modify the ModelGenerationRules.smgl file to increase the mandatory filter setting of 5000 records. This is much too small for our database. I know where the file is but I need to know how to make the change. Does anyone know how to change this?
Thanks
BB
I'm not a "real" programmer. Excuse my ignorance.
I need to edit a stored procedure. I simply want to change the text that it displays. I do not intend to change its function.
I am using SQL Express and SQL Server Management Studio Express. I can select Modify for my stored procedure, but when I save it, it saves it as an SQL file to my hard disk. How do I affect the edits to the actual stored procedure?
Apologies if this has been posted before and feel free to point me to an existing thread if it has.
I currently have a dev, stage and live environment for a package
i have created a load.dtsconfig file that contains various bits such as connection strings, email to, from, etc which i created via the package configurations in the dev package. I then made a few changes via XML Notepad
I went to use the same config file on stage and decided to add a further property. I selected package configurations on stage and selected edit it the package configurations box, added the property and clicked finish. However it reset all the existing properties to the values that exist in the actual package so all the changes i made via XML notepad were overwritten.
Is there anyway you can get the Package configurations editor to retain the values from the .dtsconfig file rather than reading in the values from the package???
cheers
Scott
Our report server was being accessed by machine name, not alias, so I had an alias set up.
I was working to get the subscription emails to use the new alias, instead of machine name. I think I should have edited the rsreportserver.config file, but first I edited the rsWebApplication.config file, and added an URL into <ReportServerURL> tag.
At that point clicking on New Subscriptions stopped working - now I always get an Error page with this message "Object reference not set to an instance of an object". That's only for new subscriptions, not new Data driven subscriptions.
In the error logs, I got this message:
w3wp!library!c!2/5/2007-18:46:46:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: The report server has encountered a configuration error. See the report server log files for more information., ;
Info: Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: The report server has encountered a configuration error. See the report server log files for more information. ---> System.Exception: The configuration file contains an element that is not valid. The ReportServerUrl element is not a configuration file element.
at Microsoft.ReportingServices.Diagnostics.UIConfiguration.ParseXML(XmlNode node, RSConfiguration configObject)
at Microsoft.ReportingServices.Diagnostics.RSConfiguration.ParseDocument()
at Microsoft.ReportingServices.Diagnostics.RSConfiguration.Load()
--- End of inner exception stack trace ---
w3wp!configmanager!c!2/5/2007-18:46:46:: Error occured with a config file change. New config file will not be used. Error: The report server has encountered a configuration error. See the report server log files for more information.
Now, no matter what I do to correct the rsWebApplication.config file, it doesn't seem to fix the problem (ie, I continue to get the above error, when trying to add a new subscription.)
What do I do to fix this?
Thanks in advance for any help!
Kristi
Hello Everyone,
I have a client that stores word documents in a SQL server database and I am trying to import some text data from another database. The problem is that I need to convert the text to a word doc with minimal formating since they convert word docs to bitmaps in order to display the text on custom embedded devices that do not support unicode.
I was hoping someone could point me at the right docs/books that would give me the info on how to construct a word doc from T-SQL. Something like a word merge would work, but I'm not sure how to call it from a T-SQL stored proc.
Thanks a Million!
I have successfully created several SSIS packages in the Development Studio. I want to schedule those packages to run with SQL Agent. The only way I could schedule them was to go to File>Save copy as...(not save as) which would give me a choice of either to save it to SQL Server or SSIS Package Store. Using this method allowed me to schedule the package but then I couldn't figure out how to edit the package without going back into the Development Studio, right-clicking on SSIS packages and selecting "Add Existing Package" and selecting that package from the SSIS Package store then opening it to edit.
That seems like a lot of work to edit a package. Is that the desired way to create, save, schedule and edit a SSIS package?
Thanks for any help.
Greetings,
I migrated some DTS 2000 packages to SSIS 2005 and I'm now editing them in Visual Studio. Some transformations got wrapped in a Execute DTS 2000 Package Task so I need to edit them (to see what's in); I have installed SQL Server 2000 DTS Designer Components (version 9.00.3042.00) but whenever double-click the task and press "Edit Package" I get the following error:
SQL Server 2000 DTS Designer components are required to edit DTS packages. Install the special Web download, "SQL Server 2000 DTS Designer Components" to use this feature. (Microsoft Visual Studio)
Do I need to install anything else? I'm using SQL Server 2005 SP2 (Full Install + Backwards Compatibility components) and I've tried reinstalling the DTS Designer Components without any success
Thanks in advance
Hello,
In SQL if we want to edit a row in a table then we have two ways to do the same,
1. Execute a command to Update the records in sql through querry analyzer.
2. Go to enterprise manager and then open the table and update a new row.
But can't we do the editing in the querry analyzer is there any way to do this.
That means i select all the records from my table using the following querry.
Select * from MyTable
and then performs editing in the querry analyzer without executing any update command and without using the Enterprise manager.
Can we do this????????
Bye and TC
ung txtConPass ko is ung Confirmation input textbox
ung txtNewPass ko is ung New Password input textbox
ung oldPass ko is ung Old Password existing
ung highlighted texts ko, dat is not working. That is my problem.
I need to check if the old password that he typed is existing. When it is existing, then update the db. But if not, do not update. The problem is, even if the password that he typed does not correspond to the user that he is editing, still the data is being updated. Please help me fix it. Maybe I have to use other codes. Tnx!
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
Me.DialogResult = System.Windows.Forms.DialogResult.OK
Dim oldPass As String = frmUsers.UsersDataGridView.SelectedRows(0).DataBoundItem(2).ToString
Dim check As Boolean = True
If Me.txtConPass.Text.Length = 0 Or Me.txtNewPass.Text.Length = 0 Then
check = False
ElseIf Not Me.txtConPass.Text.ToString.Equals(Me.txtNewPass.Text.ToString) Then
check = False
ElseIf Me.PasswordTextBox.Text.ToString.Equals(oldPass) Then
check = True
Else
End If
If check = True Then
Me.UsersTableAdapter.UpdateQueryBySearchID(Me.UsernameTextBox.Text, Me.txtNewPass.Text, Me.NameTextbox.Text, frmUsers.UsersDataGridView.SelectedRows(0).DataBoundItem(0).ToString)
Me.Close()
Me.txtConPass.Text = ""
Me.txtNewPass.Text = ""
MsgBox("Your account has been updated.", MsgBoxStyle.Information)
frmUsers.Close()
Else
MsgBox("Unable to update data.", MsgBoxStyle.Exclamation)
End If
End Sub
Hello Everyone,
I'm doing work for a client that stores word documents in a SQL server database and need to be able to do a search and replace from a stored procedure. I was hoping someone could point me in the right direction. It's Microsoft. So I know there has got to be a way to do it. :-)
Thanks!
Seems that when i use the edit functionality of the formview, and there are NULLs in the record, that my sql update statement (default from the FormView wizard) doesnt work (nothing updates). However, if i populate all fields, everything works fine. I have modified the FormView edit template to add my own textboxes and dropdowns to simplify the user record editing.
Because it works when all fields are populated with non-NULL values, Seems my Bind's are all correct.
---Jim
Am i the only one who is forced to open multiple instances of SQL Server Enterprise Manager in order to edit more than one stored procedure at a time? A lot of times i'll be comparing two sprocs or writing one based off of a "template" i wrote earlier. But i have to open two instances and alt-tab between them. Is there an easier way? (aside from pasting it into a notepad and using that)
View 5 Replies View RelatedHello!
We have a SQL Server table that needs to be maintained by the actuarial department. Therefore, I was going to have them make changes to the table using something easy like Microsoft Access 2000. When I go into Access and create an ODBC link to the table, I cannot change the data. (i.e. The insert new record feature is greyed out.) I CAN change the data via Enterprise Manager, so I don't think it is SQL Server security. Any other ideas?
Thanks,
Sharon