Re: INSERT or UPDATE

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello pxpilot,

It depends on your DB, some of them support MERGE (Oracle for example), which call either insert or update.
for SQL server you need to implement your SP, there is no merge afaik


---
WBR, Michael Nemtsev [.NET/C# MVP]. My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we miss it, but that it is too low and we reach it" (c) Michelangelo

p> Hi All,
p> I have the a table with 2 fields: uid, date.
p> When the user does some activity I log his uid and the date, the
p> problem I have is that the table is not prepoulated with all uid's so
p> sometimes I need to INSERT and other times I need to UPDATE (if that
p> uid was already logged). Checking first with SELECT to see if the uid
p> exist is the obvious thing but I wonder is there a more effective
p> way?
p> App is ASP.NET 2.0 in VB
p> p> Thanks
p> PxP


.



Relevant Pages

  • Re: SQL for Pivot Result
    ... temp_ppv with fields recno, uid, type, ... ... at least for an SQL Server person like ... Books Online for SQL Server 2005 at ...
    (microsoft.public.data.oledb)
  • Re: Solaris 10 nfs problems
    ... the uid of oracle is different on the server, ... ls -l on the server will not show the file as being owned by oracle, ... Users who have same uids on the client and server display properly! ...
    (comp.unix.solaris)
  • Re: Login failed for user (null)...Reasons?
    ... >authentication (UID and password) fails from an Access application. ... >tried a ODBC DSN and a DSN-less connection. ... >I can get to the SQL Server with Enterprise Manager, ...
    (microsoft.public.sqlserver.odbc)
  • Re: Login failed for user (null)...Reasons?
    ... >authentication (UID and password) fails from an Access application. ... >tried a ODBC DSN and a DSN-less connection. ... >I can get to the SQL Server with Enterprise Manager, ...
    (microsoft.public.sqlserver.connect)
  • Re: Using SQL Server Native Client (ODBC) - SQLDriverConnect No re
    ... Server by using the SQL Server Native Client (ODBC). ... Reading Books Online, it seems that in ODBC, you should use UID, not ...
    (microsoft.public.sqlserver.connect)