由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - Help!!!! How to synchronized the data in SQL server
相关主题
如何用SQL语句判断一个TABLE是否存在?Re: How to sent the sql sentences from the client(throught server)to J
Re: [转载] JDBC用完了oracle的large pool (memor用Servlet显示数据库里的数据,分页的? (很实际的问题)
sql question[转载] JDBC 处理日期的问题(日期插入数据库)
anyone can help on this query, thanks!question on SQL Server
请教一个有关SQL concat的问题what is the size limitation of Oracle JDBC Statement?
better solution for cross table query in sql?JDBC and embedded SQL programming
what is SQL/J?Re: JDBC and embedded SQL programming
Question纪录查找问题
相关话题的讨论汇总
话题: sql话题: mytable话题: server话题: data
进入Database版参与讨论
1 (共1页)
f*******f
发帖数: 12
1
What I want to do is something like that:
declare @id
select @id=max(id) from mytable
if(@id is null)
@id=0
else
@id=@id+1
insert into mytable(@id,'aa','bbb')
But How to synchronized it when multiple connetions access database.
I use JDBC..
Thank you
B**z
发帖数: 153
2
I think you are trying to generate sequence for primary key for mytable
you can just declare the id column as identity. when you insert into
you just values('aa','bb')

【在 f*******f 的大作中提到】
: What I want to do is something like that:
: declare @id
: select @id=max(id) from mytable
: if(@id is null)
: @id=0
: else
: @id=@id+1
: insert into mytable(@id,'aa','bbb')
: But How to synchronized it when multiple connetions access database.
: I use JDBC..

f*******f
发帖数: 12
3
Thank you. I got it.

【在 B**z 的大作中提到】
: I think you are trying to generate sequence for primary key for mytable
: you can just declare the id column as identity. when you insert into
: you just values('aa','bb')

1 (共1页)
进入Database版参与讨论
相关主题
纪录查找问题请教一个有关SQL concat的问题
SQL Server 和Access到底有多大区别better solution for cross table query in sql?
请问有没有SQLSServer Driver for UNIX?what is SQL/J?
[转载] MS SQL Server JDBC Driver ProblemQuestion
如何用SQL语句判断一个TABLE是否存在?Re: How to sent the sql sentences from the client(throught server)to J
Re: [转载] JDBC用完了oracle的large pool (memor用Servlet显示数据库里的数据,分页的? (很实际的问题)
sql question[转载] JDBC 处理日期的问题(日期插入数据库)
anyone can help on this query, thanks!question on SQL Server
相关话题的讨论汇总
话题: sql话题: mytable话题: server话题: data