Simple Update Kills TEMPDB Database In SQL2005 64-bit

Oct 6, 2006

Following update runs 20 hours till TEMPDB grows up to 400GB and runs out of space with error message:

Msg 1105, Level 17, State 2, Line 8
Could not allocate space for object 'dbo.Large Object Storage System object: 440701391536128' in database 'tempdb' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

T_PERF_LOC has 30,000,000 rows and T_MASTER_LOC has 2,000,000 rows
There is and index on V_KEY in both tables. CHANNEL_KEY is of Integer datatype and not indexed.
F_MAP function performs simple lookup on very small table (10 rows)

UPDATE A
SET CHANNEL_KEY = OTHERDB.DBO.F_MAP(b.ID)
FROM T_PERF A
JOIN dbo.T_MASTER b
on a.V_KEY = b.V_KEY

Any ideas why?
Thanks

View 4 Replies


ADVERTISEMENT

Insert Into Statment Kills My Database Connection?

Sep 13, 2006

Hi

Simple statment is giving me a logout on the server

INSERT INTO Angebot (Nummer,Variante,Bearbeiter,Datum,Geld,Kurs,Language,Flag,AngebotStatus,TStatus)
VALUES (90360,3,'Admin',DEFAULT,'CPI_BE-D',1,'CPI_AG-1',4,NULL,59)

The statment works fine on production, however i have played a backup from production to my laptop to test something and as soon as I add a record to the database my connection to the database is droped (the data is not added to the table).

the error message I get is double, however I execute the statement only once.

Msg 0, Level 11, State 0, Line 0
Für den aktuellen Befehl ist ein schwerwiegender Fehler aufgetreten. Löschen Sie eventuelle Ergebnisse.

Msg 0, Level 20, State 0, Line 0
Für den aktuellen Befehl ist ein schwerwiegender Fehler aufgetreten. Löschen Sie eventuelle Ergebnisse.

Sugestions anyone?

PS: the message in English is:



Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.

View 1 Replies View Related

Permission Issue With Tempdb Works Fine In SQL2000 But Not SQL2005

Sep 17, 2007

the following SQL works fine in SQL2000 but gets a permissions error when run on SQL2005:




IF not exists (SELECT * FROM tempdb.dbo.sysindexes WHERE NAME = 'PK_tblGuidContractMove')

BEGIN

IF @DEBUG = 1 PRINT 'airsp_CopyContracts.PK_tblGuidContractMove'



EXECUTE('ALTER TABLE #tblGuidContractMove ALTER COLUMN guidSource GUID NOT NULL')

EXECUTE('ALTER TABLE #tblGuidContractMove ALTER COLUMN guidDestination GUID NOT NULL')

EXECUTE('ALTER TABLE #tblGuidContractMove ALTER COLUMN guidContractMove GUID NOT NULL')
EXECUTE('ALTER TABLE #tblGuidContractMove WITH NOCHECK ADD

CONSTRAINT [PK_tblGuidContractMove] PRIMARY KEY CLUSTERED

(

[guidSource],

[guidDestination],

[guidContractMove]

) ON [PRIMARY]')



END

The user permissions are set the same in both 2000 and 2005 can you please explain what changed and what are the minimum permissions need for the user to be able to make these changes to the temporary table which the user created.

View 1 Replies View Related

Sql2005 Database Restore From Another Sql2005 Backup File Error.

Dec 15, 2005

hi

i try to restore a bak file from another sql2005 server to my sql2005 server, but it show the error message as below :

 

 

TITLE: Microsoft SQL Server Management Studio Express
------------------------------

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)

------------------------------
ADDITIONAL INFORMATION:

Cannot open backup device 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBackupackup.bak'. Operating system error 5(error not found).
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=3201&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------


 

 

 

pls some one can help me ???

 

thanks

chaus

View 62 Replies View Related

TempDB Tran Log Growing Slowly - Yet We Are In Simple Mode!

Jul 20, 2005

Something strange is happening to our SQL Server DB (2000). Thetempdb transaction log file continues to grow (quite slowly) for noapparent reason. We have it in simple mode, and I have tried a manualcheckpoint command and manual shrink (of the log file only). Thereare no unusual SQL's (large or small) going on. A "heavy hitter" wouldmake it grow fast, not 10 MB every 30 minutes or so. This server hasbeen in production for over a year with no similar issues to this.Anyone encounter a similar situation? This started (as far as we cantell) sometime yesterday. It is growing about 200 MB a day, and is upto 600 MB now, with all but 8 MB "used". For now we added space, butof course that is not a long term solution. The two "data" files(each had a 200 MB initial allocation) have never gone much above 100MB each used (they are each about 100 MB now and have been that wayfor several days, but have shrank and grown). There are about 30small to medium sized "regular" databases on this instance.Any help would be appreciated, especially if there is a way we can fixthis without bouncing the engine (I know, wishful thinking...). The OSis Win 2000, SP3. SQL Server is at 2000, SP 3a.THANKS IN ADVANCE!

View 3 Replies View Related

Can You Open A Database Created In SQL2005 In SQL2005 Express?

Oct 12, 2007



Can you open/use a database created in SQL2005 in SQL2005 Express?

Thanks for the help!

Max

View 4 Replies View Related

DB Engine :: Update Statement Affect TempDB?

Aug 3, 2015

Could a simple update statement on a user database ever caused space usage in tempdb?  Assuming the update statement fires no triggers and not using any temp tables?

IE:

User DatabaseA
Update TableX
Set col1 = X

Reason I ask is tempdb filled up and the only thing I could see running at that time was the update statement.

View 8 Replies View Related

Replication 2 Part Update In SQL2005?

Jul 13, 2007

SQL2000 used to send a 2 part update using sp_msdel followed by sp_msins instead of just calling sp_msupd. I thought this used to happen on tables with compostie primary keys. Does any know know if this still occurs in SQL2005 and maybe why?

View 1 Replies View Related

SQL2005 Cannot Backup A Restored SQL2000 Database With Unknow Database Full-text Catalog Database

Nov 15, 2007



We replicate a SQL2000 database (DataBaseA) to a SQL2000 database (DataBaseB) by using the Restore function and hasn't change its logical name but only the physical data path and file name. It is running fine for a year. We use the same way to migrate the DataBaseB to a new SQL2005 server with the Restore function and the daily operation is running perfect. However, when we do the Backup of DatabaseB in the SQL2005, it just prompt the error message


System.Data.SqlClient.SqlError: The backup of full-text catalog 'DataBaseA' is not permitted because it is not online. Check errorlog file for the reason that full-text catalog became offline and bring it online. Or BACKUP can be performed by using the FILEGROUP or FILE clauses to restrict the selection to include only online data. (Microsoft.SqlServer.Smo)


Please note we left the DataBaseA in the old SQL2000 server.


Please help on how we can delete the Full-text catalog from DatabaseB so we can do a backup


Many Thanks

View 1 Replies View Related

Very Slow And Not Complete Screen Update In SQL2005

Jan 14, 2008

Hi

I have the following problem (on 2 PC's now)

On 1 pc i installed VS2008 besides VS2005 and SQL 2005 (before i installed VS2008 everything was fine)

On the other is a fresh installed XP machine with only VS2008 SQL2550 and Office2007
Latets service packs are installed

On both machines when i open a table in SQL 2005 with the 'open table' command the show of the table is very slow.
Every row is updated file by field, the grid is not showing, the row and column headers are not 'grey' as normal.

Scrollign is impossible as the screen updates start again that slow.

Even a small table with 10 rows and 15 field behaves this slow. Its not workable.

What can be done to resove this???


Peter

View 11 Replies View Related

Runnaway UPDATE Statement In SQL2005 - How To Resolve?

Jun 16, 2006

I am in the process of moving a SQL2000 database to a SQL2005 database.

Porting from: SQL200, Windows Server 2000(SP4) (32 bit dual processor 4GB RAM)
to:SQL2005, Windows Server 2003(SP1) (x64 bit dual processor 4GB RAM)



After porting the database from SQL2000 to SQL2005 (no changes)
I then compare an update statement running from Management Studio on the 2003 Server and and Query analiser on the 2000

Server.

SQL2000 completes the command in 2 minutes SQL2005 is still running after 60 minutes.

SQL2000 is the live/production system with users connected, the SQL2005 is in a test environment with no other processors

running.

The SQL2005 activity monitor shows:
-----------------------------------
3 suspended processes in CXPACKET wait state and
2 runnable process high CPU counts (SQLServer running at 100% cpu).
All processes with the same Process ID.
Wait time is 0
High CPU counts for the runnable processes.
Low physical IO
No lock conflicts


When I add the "option (maxdop 1)" to the update statment then:

The activity monitor shows:
---------------------------
1 runnable process with a high CPU count (SQLServer running at 50% cpu).
Wait time is 0
High CPU count for the runnable processe.
Low physical IO
No lock conflicts

How do I debug this situation?
Why is the SQL2005 unable to complete the task?

The update statement is as follows...
-------------------------------------

update BI_LENDING_TRANSACTIONS
set [Balance Movement Month] = M.[Balance Movement Month]
from BI_LENDING_TRANSACTIONS as T,
BI_BALANCE_MOVEMENT_DATES as M,
BI_COMPANIES as C
where (T.[Transaction Date] >=
(SELECT DATEADD(d, - 70, minDate) from (select min([Transaction Date]) minDate
from p_BI_LENDING_TRANSACTIONS) t1)
OR
T.[Transaction Date] >= C.[MostRecentSnapShotDate] or
T.[Value Date] = T.[Balance Movement Month] ) and
T.[Value Date] <= C.[MostRecentSnapShotDate] and
T.[Value Date] >= T.[Transaction Date] and
T.[Company_Code] = M.[Company_Code] and
T.[Value Date] > M.[SnapShotFromDate] and
T.[Value Date] <= M.[SnapShotToDate] and
C.[Company_Code] = M.[Company_Code]

View 9 Replies View Related

Update Data On SQL2005 Linked Servers To DB2

Oct 25, 2007

Hi all.

I need your help.

I create a linked server on SQL 2005 server using IBMDA400 as provider.

I create a VBscript to update some data on DB2, and issue begin trans and commit trans. Kindly refer to below code.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Set oKCDat = CreateObject("KCDAT.kcdatapi")
Set objConnection = oKCDat.OpenConnection_SQL(strDataSource,strDB, strUserID, strPassword)

Set rs = CreateObject("ADODB.Recordset")

strName = "TEST1"

strTemp1 = "2"
strTemp2 = "3"
intTemp1 = 199

strSQLStatement = "SELECT * FROM QS36F.TEST WHERE PRACNM = ''" & strName & "''"
strUpdSQL = "TEST1 = '" & strTemp1 & "', TEST2 = '" & strTemp2 & "', TEST3 = " & intTemp1

strSQL = "UPDATE OPENQUERY(TESTDB2," & "'" & strSQLStatement & "')" & " SET " & strUpdSQL & ";"


objConnection.BeginTrans

objConnection.Execute(strSQL)

objConnection.CommitTrans


objConnection.Close


Set rs = Nothing
Set oKCDat = Nothing
Set objConnection = Nothing

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------


When i run above script, it prompt me an error message;
"Microsoft OLE DB Provider for SQL Server
The requested operation could not be performed because OLE DB provider "IBMDA400" for linked server "TESTDB2" does not support the required transaction interface."

If i run it without "begintrans" and "committrans", it update the data successfully.

Does anyone know about it?

Highly appreciated for above matters.


Regards

View 3 Replies View Related

The Year 1700 Kills My DTS

Oct 22, 2007

I am createing A DTS package to move data from Access 2003 to SQL Server 2000. I have a datetime field in Access that has the values '1/1/1700'. These error when DTSing over.

New to DTS, Any sugestions?

Mike

View 3 Replies View Related

Simple Update

Nov 23, 1999

Hi..This may be silly but i am stuck at this for some time.
I have 10000 rows in a table and i want to copy the value of column 1 in all the rows to column 2 ( which contains NULL presently in all the rows ). The two columns are of the same datatype.

Thanx.

View 1 Replies View Related

Simple SQL Update

Mar 16, 2004

Hello all and I look forward to reading your replys. Currently, I'm trying to update a table in my SQL database by writing a script that will go get the field name and correct info, verify it has the correct field by using two other columns and then update the information.

I do not know how to use tell SQL what to update when the field name can change. I've used the following in the past.

UPDATE [Import Table]

SET [Import Table].[???] = [Correction_Table].[Correct_Info]

WHERE [Import Table].[UNIQUE ID] in (select [USO Unique ID] from [Correction_Table])

IN this new instance, I'm reading the Field_Name from the Correction_Table so I don't know what to put in my SET statement.

Please any help or pointers in the right direction would be greatly appreciated.

Battle_n

View 4 Replies View Related

Help With Simple Update

Dec 11, 2006

I have a table Products with their prices, and I have another table Sales, that have the prices of the products but they are null, I need to make an update that update the tables Sales, inserting the prices from the table Products

View 3 Replies View Related

Simple UPDATE

Feb 26, 2008

I need to do an update. Can you tell me if it's possible to update multiple tables in a single statement when joined, as with a select, or this has to be taken care of in seperate statements with the same join? I'm sure this is a simple YES / NO answer.

Here is what I'm using, with the same structure as somewhere else... why do I get 'incorrect syntax near q' on that very first line?

-- Do the update
update ccs_quotes q
set ccs_quo_user_date#1 = j.completed
from "ken-sql-002".hettonhosttestdatabase.dbo.job j
inner join ccs_quotes q
on left(j.cid,10) = q.ccs_quo_ref_number#2
where completed is not null
and ccs_quo_ref_number#2 = 'SHGD40021'


Thanks a lot
Mike

View 5 Replies View Related

Simple SQL Update

Jul 23, 2005

I need to copy data from one column that has a max size of 45 characters toa column that has a max size of 20 characters.What is the syntax to say fill the first 20 characters out of 45 fromcolumn 1 into column 2?jeff--Message posted via http://www.sqlmonster.com

View 1 Replies View Related

SQL Restart Kills SQL-based Sites On IIS

Apr 12, 2007

I have a SQL 2005 server on a separate machine from my IIS machine, and anytime the SQL server restarts (like for last night's automatic updates) the connection pooling seems to break.  Among the apps on this IIS box is Community Server 2.1, along with some other custom-built apps.  The only way to resolve it is to stop and restart the IIS services.
Previously all SQL-dependent apps on that IIS box broke when SQL was reset, but I seemed to have addressed it, at least on my custom-built apps, by forcing a TCP connection in the connection strings (instead of the default named pipes method).  I did change the Community Server connection strings as well, but for some reason that didn't seem to work.
Has anyone else experienced similar problems with interruptions in SQL connectivity bringing down apps that connect to that SQL server?  I hate to turn off automatic updates just to make sure my ASP.NET apps are available.
I apologize if this isn't clearly an ASP.NET question, but hopefully someone can help me out.
Thanks,Josh

View 3 Replies View Related

Simple Db Update Question

Oct 4, 2007

Hi folks. I'm trying to update a single field in a database table with the input from a single text box, but I'm getting "Insert Error: Column name or number of supplied values does not match table definition". I know at least part of the problem is that I haven't specified the name of the table field, but I'm not sure where to do this. The table in question has many fields, but I only want to update one. The submit button is "sendMail", which calls UpdateDB.I'm learning and trying to limit myself to 1 idiotic question per week. Please have mercy. Thanks. Chrisprivate void UpdateDB(string cmd)
{
// point to connection string in web.config
string connectionString = "Data Source=localhost;Initial Catalog=databaseName;Integrated Security=True";
// create connection object; initialize; open
System.Data.SqlClient.SqlConnection connection = new System.Data.SqlClient.SqlConnection(connectionString);
try
{
connection.Open();
// create sqlcommand object and assign connection
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand();
command.Connection = connection;
command.CommandText = cmd;
command.ExecuteNonQuery();
}
finally
{
connection.Close();
}
}

protected void sendMail(object sender, EventArgs e)
{
string cmd = @"INSERT INTO tableName VALUES ('" + this.TextBox2.Text + "')";
UpdateDB(cmd);
// send smtp mail ... } 

View 3 Replies View Related

Simple Update Page

Oct 9, 2007

I have been trying to create a simple page to update my SQL Express database with some text boxes that are auto filled.
If here is the code if you have any help for me it would be great. Partial Class Secured_Default2
Inherits System.Web.UI.PageProtected Sub Accept_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Accept.Click
SqlDataSource3.Update()
End SubProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AcceptDate.Text = System.DateTime.Now.ToStringAcceptedBy.Text = Request.ServerVariables.Get("Logon_User")
StatusBox.Text = "2"End Sub
End Class<%@ Page Language="VB" MasterPageFile="~/Secured/MasterPage.master" AutoEventWireup="false" CodeFile="TEST.aspx.vb" Inherits="Secured_TEST" title="Untitled Page" %>
<%@ Import Namespace="System.Data.SqlClient" %><%@ Import Namespace="System.Data" %>
 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
<br />
&nbsp;&nbsp; Date:
<asp:TextBox ID="AcceptDate" runat="server" ></asp:TextBox>&nbsp; &nbsp; Accepted By:
<asp:TextBox ID="AcceptedByBox" runat="server" ></asp:TextBox><br />
Status:
<asp:TextBox ID="StatusBox" runat="server" Width="18px"></asp:TextBox>
&nbsp; &nbsp; &nbsp;&nbsp;
<asp:Button ID="Accept" runat="server" CommandName="Update" Text="Accept Ticket" /><br />
<br />
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:HelpDeskConnectionString2 %>"
SelectCommand="SELECT TicketNUM, Accepted, AcceptedBy, Status FROM HelpDesk WHERE (TicketNUM = @TicketNUM)"
UpdateCommand="UPDATE HelpDesk SET Accepted = @UAccepted, AcceptedBy = @UAcceptedBy, Status = @UStatus WHERE (TicketNUM = @TicketNUM)">
 
<UpdateParameters>
<asp:FormParameter Name="UAccepted" FormField="AcceptedDate"/>
<asp:FormParameter Name="UAcceptedBy" FormField="AcceptedByBox" />
<asp:FormParameter Name="UStatus" FormField="StatusBox" />
<asp:QueryStringParameter Name="TicketNUM" QueryStringField="TicketNUM" />
</UpdateParameters>
<SelectParameters>
<asp:QueryStringParameter Name="TicketNUM" QueryStringField="TicketNUM" />
</SelectParameters>
</asp:SqlDataSource>
 </p>
</asp:Content>

View 4 Replies View Related

Simple Update Data

Jun 18, 2008

I am attempting to update contact data that is displayed in a form. Unfortunately the followiing code that runs off the button click event does not seem to work or I am misssing something to make it fire. I get no errors but the data does not get updated. What am I missing? Thanks.Private Sub btn_Submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Submit.Click
Dim strConnection As StringDim cn As SqlConnection
Dim sql As String
strConnection = ConfigurationSettings.AppSettings("ConnectionString")cn = New SqlConnection(strConnection)
sql = "UPDATE vw_BS_IssuerContacts SET ContactLastName = @ContactLastName, ContactFirstName = @ContactFirstName, ContactTitle = @ContactTitle, ContactEmail = @ContactEmail, ContactPhone = @ContactPhone, Address1 = @Address1, Address2 = @Address2, Address3 = @Address3, Country = @Country, ZipCode = @zipCode, AccessLevel = @AccessLevel WHERE IssuerCode = @IssuerCode"Dim UpdateCommand As New SqlCommand(sql, cn)
UpdateCommand.Connection = cn
UpdateCommand.CommandText = sqlUpdateCommand.Parameters.Add(New SqlParameter("@IssuerCode", Lbl_IssuerCode.Text))
UpdateCommand.Parameters.Add(New SqlParameter("@ContactLastName", txt_Lname.Text))UpdateCommand.Parameters.Add(New SqlParameter("@ContactFirstName", txt_Fname.Text))
UpdateCommand.Parameters.Add(New SqlParameter("@ContactTitle", txt_title.Text))UpdateCommand.Parameters.Add(New SqlParameter("@ContactEmail", txt_Email.Text))
UpdateCommand.Parameters.Add(New SqlParameter("@ContactPhone", txt_Phone.Text))UpdateCommand.Parameters.Add(New SqlParameter("@Address1", txt_Address.Text))
UpdateCommand.Parameters.Add(New SqlParameter("@Address2", txt_Address2.Text))UpdateCommand.Parameters.Add(New SqlParameter("@Address3", txt_City.Text))
UpdateCommand.Parameters.Add(New SqlParameter("@Country", txt_Country.Text))UpdateCommand.Parameters.Add(New SqlParameter("@ZipCode", txt_zipCode.Text))
UpdateCommand.Parameters.Add(New SqlParameter("@AccessLevel", Lbl_currAccessLevel.Text))
'UpdateCommand.Parameters.Add(New SqlParameter("@AccessLevel", SqlDbType.Char, 2).Value = txt_CurrAccessLevelSelectedValue))UpdateCommand.Parameters.Add(New SqlParameter("@UserName", txt_Username.Text))
UpdateCommand.Parameters.Add(New SqlParameter("@infopw", txt_pw.Text))UpdateCommand.Parameters.Add(New SqlParameter("@Company", txt_IssName.Text))
'do the update
cn.Open()
UpdateCommand.ExecuteNonQuery()
 
cn.Close()
 
 
 End Sub
 
 

View 1 Replies View Related

Help With A Simple Update Query..

Feb 5, 2007

hi, i've just started using sql server 2005 and visual studio, i have made 3 stored procedures, an update, insert and delete. The update one doesn't work but the others do so i'm on the right track with them..

is there anything obvious i am missing in the following update stored procedure? All of the datatypes and names line up with the datatypes/sizes/names in the table..


Code:

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Author:<Author,,Name>
-- Create date: <Create Date,,>
-- Description:<Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[spUpdateAddresses]
-- Add the parameters for the stored procedure here
(@addressID int, @fname varchar(50), @lname varchar(50), @address01 varchar(50), @address02 varchar(50), @suburb varchar(50), @state varchar(50), @postcode char(10), @comments varchar(1250), @phone char(10), @fax char(10), @mobile char(10))

AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
Update addresses
set @fname=fname, @lname=lname, @address01=address01, @address02=address02, @suburb=suburb, @state=state, @postcode=postcode, @comments=comments, @phone=phone, @fax=fax, @mobile=mobile
where (@addressID = addresses.addressID)

END

View 2 Replies View Related

Simple Update Query Help

Feb 27, 2007

Hi, wondered if anyone here can help out with an SQL query thats been driving me mad. Currently I do this programmatically in a C# program with a hard coded mapping class but want to put the new codes into a table and run an update query instead.

2 tables like this;

Table: CarModels
SORT
GROUP_CODE
MODEL_NAME
PK: SORT

Table: NewGroupCodes
OLD_CODE
NEW_CODE
PK: OLD_CODE, NEW_CODE

Basically I want to update all GROUP_CODE entries in the CarModels table with the NEW_CODE values from NewGroupCodes where there is a match between CarModels.GROUP_CODE and NewGroupCodes.OLD_CODE.

thanks in advance,
afro

View 7 Replies View Related

Simple Update Error

Jul 20, 2005

Hey all,i have a students_table which i want to do a multiple update on.Update student_tableset grant = 35000where course_id = 2There are lots of students in the student table which have course_id of2.I get this error:Subquery returned more than 1 value. This is not permitted when thesubquery follows =, !=, <, <= , >, >= or when the subquery is used as anexpression.The statement has been terminated.Does anyone know how to do a multiple update like this.It seems such asimple thing but im confused*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View 1 Replies View Related

Noobie Here - Need Help With Simple Update

Mar 20, 2008

I've got two tables:

CallLog (one)
Repository (many)

They both have the shared id of CallID. I'm trying to write a trigger that when one adds a record to the repository table, I want the CallLog table flagged with 'T'. My existing code is flagging everything thing in the CallLog table that has CallID match from the Repository table... How do I update the single row in the CallLog table? Driving me nuts!


USE [HEATPROD]

GO

/****** Object: Trigger [dbo].[WriteAttachmentFlagNew] Script Date: 03/19/2008 12:29:29 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

ALTER TRIGGER [dbo].[WriteAttachmentFlagNew]

ON [dbo].[Repository]

AFTER Insert

AS

BEGIN

UPDATE CallLog

SET AttachmentFlagNew = 'T'

FROM repository

WHERE calllog.CallID= repository.CallID

END

View 6 Replies View Related

Bad Data In Source File Kills Package?

Sep 28, 2005

I'm reading data from sets of CSV source files with " text qualifiers.  Most of the data is good, but I do run into some bad data that doesn't seem to get handled by redirecting rows.  The type of data that is killing me is this:

View 4 Replies View Related

Instead Of Trgger Marked Not For Replication Kills After Trigger

Jul 14, 2006

Kill may be overdramatic, but...

I am testing a merge publication with a push subscription.  The publication contains a single table.  That table has an INSTEAD OF UPDATE trigger marked NOT FOR REPLICATION and an AFTER trigger that needs to go off during replication.

During Synchronization neither trigger goes off.  If I drop the instead of trigger the after trigger will go off.  What is going on?

Thanks,

View 11 Replies View Related

A Simple Question About SQL Update Statement

Jul 10, 2006

hi, everyone,
When I update a row that does not exist in a table using VBscript and SQL 2003 server, the row is automatically added to the table. Why does this happen?
Can somebody help me? Thanks in advance!

View 2 Replies View Related

Simple (?) SQL 7.0 Update Taking Forever...

May 3, 2000

I have a simple update/initialization query (set integer column = 0 on all rows) that's been running for over 28 hours. There are just over 27 million rows in the table. In current activity it shows that the transaction is open but it's sleeping, and in locks it shows 1 DB S mode lock, 766 page X mode locks, 1 page U mode lock, and one table X mode lock. Server is 7.0 with 1.7 gig ram. Anyone have any ideas as to why it's taking so long? Table is about 7 gig in size; can't get to it in Enterprise Manager without locking it up...

View 3 Replies View Related

Help! A Simple &#39;update Records&#39; Question

Nov 19, 1999

Hi there,

I was trying to update records of a recordset(ADODB.Recordset) returned from a stored procedure(SQL server 7.0) in ASP file, this stored procedure select records into a temporary table, so the records returned by the SP actually physically are in tempdb database rather than in the user database.

When executing Update statement , I got the error message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
[Microsoft][ODBC SQL Server Driver][SQL Server]Database name 'Mydatabase' ignored, referencing object in tempdb.

Any ideas/comments would be highly appreciated!
Dana Jian
dan_jian@hotmail.com

View 1 Replies View Related

Simple Table Update With Lookup

Feb 9, 2006

Hi i have three tables

T1 is a table of data imported by DTS, it has staff numbers and location names

T2 is a table that contains system data about staff and has a column for the location id

T3 is a table for the location names and their ID's

i am trying to write the sql to update T2 with the new location IDs for staff that have moved location but am not getting what i need.

so far i have :
update
T2
set T2.LocationId =T3.LocationID
from T3
inner join T1
on T3.departmentname = T1.contact_location

the update runs but sets all rows to the same value. am now burried deep in the [I've stared at this too long and cant see the wood for the trees] stage :mad:

Thanks
FatherJack

View 2 Replies View Related

Simple SQL Question Regarding Update Query

Oct 5, 2006

Can we add if statements in Update query?

I have to do following task in one stored proc:
I am passing 2 param to the stored proc @spkid, @Repspk

Update myTable
set spk1=@Repspk
where spk1=@spkid

Update myTable
set spk2=@Repspk
where spk2=@spkid

Update myTable
set spk3=@Repspk
where spk3=@spkid


Instead of writing 3 update statements what is the other option that will make the query run faster? Thanks alot for transfering knowledge...

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved