New bie, I'm using max+1 in select query to get the maximum no of rowz in a
table. Thru this i'm generating client ID. For this i used to insert atleast
one row in a table while quering . Now i have to generate 1 as for first
inserting row. then subsequent rows as max+1.
--
Mahe~SELECT IsNull(max(clientId),0)+1
FROM ...
But WHY dont you use IDENTITY instead?
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"mahesh" <mfcmahesh@.hotmail.com> wrote in message
news:uXaHWl8GFHA.3244@.TK2MSFTNGP09.phx.gbl...
> New bie, I'm using max+1 in select query to get the maximum no of rowz in
> a
> table. Thru this i'm generating client ID. For this i used to insert
> atleast
> one row in a table while quering . Now i have to generate 1 as for first
> inserting row. then subsequent rows as max+1.
> --
> Mahe~
>|||Identity ?
"Roji. P. Thomas" <thomasroji@.gmail.com> wrote in message
news:utC2c38GFHA.3244@.TK2MSFTNGP09.phx.gbl...
> SELECT IsNull(max(clientId),0)+1
> FROM ...
> But WHY dont you use IDENTITY instead?
> --
> Roji. P. Thomas
> Net Asset Management
> https://www.netassetmanagement.com
>
> "mahesh" <mfcmahesh@.hotmail.com> wrote in message
> news:uXaHWl8GFHA.3244@.TK2MSFTNGP09.phx.gbl...
in
>|||http://msdn.microsoft.com/library/d...br />
3iex.asp
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"mahesh" <mfcmahesh@.hotmail.com> wrote in message
news:eMSnjB9GFHA.3440@.TK2MSFTNGP10.phx.gbl...
> Identity ?
> "Roji. P. Thomas" <thomasroji@.gmail.com> wrote in message
> news:utC2c38GFHA.3244@.TK2MSFTNGP09.phx.gbl...
> in
>|||Thkz Thomaz, if u dont mind,where i can find more example for sql server
related concepts and queries..
"Roji. P. Thomas" <thomasroji@.gmail.com> wrote in message
news:#adBTH9GFHA.4060@.TK2MSFTNGP14.phx.gbl...
>
http://msdn.microsoft.com/library/d...-us/tsqlref/ts_
ia-iz_3iex.asp
> --
> Roji. P. Thomas
> Net Asset Management
> https://www.netassetmanagement.com
>
> "mahesh" <mfcmahesh@.hotmail.com> wrote in message
> news:eMSnjB9GFHA.3440@.TK2MSFTNGP10.phx.gbl...
rowz
>|||Roji posted a link to Books Online, which should also be available on
your PC if you have SQL Server installed. Books Online is the first
place to look for any SQL Server related info.
More resources here:
http://www.microsoft.com/sql/commun...communities.asp
http://www.aspfaq.com/2423
David Portas
SQL Server MVP
--
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment