Click here to Skip to main content
15,891,675 members
Home / Discussions / Database
   

Database

 
GeneralRe: sql server comparing two huge tables Pin
ps_prakash024-Aug-09 17:44
ps_prakash024-Aug-09 17:44 
GeneralRe: sql server comparing two huge tables Pin
ps_prakash024-Aug-09 17:39
ps_prakash024-Aug-09 17:39 
GeneralRe: sql server comparing two huge tables Pin
ps_prakash025-Aug-09 2:09
ps_prakash025-Aug-09 2:09 
AnswerRe: sql server comparing two huge tables Pin
Blue_Boy3-Aug-09 23:24
Blue_Boy3-Aug-09 23:24 
GeneralRe: sql server comparing two huge tables Pin
ps_prakash024-Aug-09 0:28
ps_prakash024-Aug-09 0:28 
GeneralRe: sql server comparing two huge tables Pin
Blue_Boy4-Aug-09 4:46
Blue_Boy4-Aug-09 4:46 
GeneralRe: sql server comparing two huge tables Pin
ps_prakash024-Aug-09 21:52
ps_prakash024-Aug-09 21:52 
QuestionHow to check for a never populated table on sql server 2005 Pin
Roberto Mazzone3-Aug-09 6:34
Roberto Mazzone3-Aug-09 6:34 
I use IDENT_CURRENT to predict the next identity on a table (I know I have to be careful).
IDENT_CURRENT return the SEED value (1) for a never populated table
(it's a bug...https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=297781[^])
and the same value for an empty table with 1 rows inserted and deleted.
so when IDENT_CURRENT return 1 I don't know if the new identity value will be 1 or 2.
I have to exec:
DBCC CHECKIDENT ('table_name', RESEED, 1) --if a table was empty and never populated 

DBCC CHECKIDENT ('table_name', RESEED, 0) --if a table was empty and just  populated 

in this way IDENT_CURRENT will return always 1.

I'm searching for a more elegant solution than, for an empty table, insert a dummy row, get the IDENT_CURRENT and delete the dummy row!

Many thanks to all
AnswerRe: How to check for a never populated table on sql server 2005 Pin
David Mujica3-Aug-09 8:04
David Mujica3-Aug-09 8:04 
GeneralRe: How to check for a never populated table on sql server 2005 Pin
Roberto Mazzone3-Aug-09 20:00
Roberto Mazzone3-Aug-09 20:00 
AnswerRe: How to check for a never populated table on sql server 2005 Pin
leckey3-Aug-09 8:54
leckey3-Aug-09 8:54 
GeneralRe: How to check for a never populated table on sql server 2005 Pin
Roberto Mazzone3-Aug-09 21:25
Roberto Mazzone3-Aug-09 21:25 
AnswerRe: How to check for a never populated table on sql server 2005 Pin
David Skelly3-Aug-09 22:43
David Skelly3-Aug-09 22:43 
GeneralBuild your own identity value Pin
David Mujica4-Aug-09 2:58
David Mujica4-Aug-09 2:58 
GeneralRe: Build your own identity value [modified] Pin
Roberto Mazzone4-Aug-09 22:48
Roberto Mazzone4-Aug-09 22:48 
GeneralRe: Build your own identity value Pin
David Mujica5-Aug-09 2:59
David Mujica5-Aug-09 2:59 
GeneralRe: Build your own identity value Pin
Roberto Mazzone5-Aug-09 22:11
Roberto Mazzone5-Aug-09 22:11 
AnswerRe: How to check for a never populated table on sql server 2005 Pin
Mike Ellison4-Aug-09 3:13
Mike Ellison4-Aug-09 3:13 
GeneralRe: How to check for a never populated table on sql server 2005 [modified] Pin
Roberto Mazzone4-Aug-09 22:51
Roberto Mazzone4-Aug-09 22:51 
GeneralRe: How to check for a never populated table on sql server 2005 Pin
Mike Ellison5-Aug-09 6:28
Mike Ellison5-Aug-09 6:28 
GeneralRe: How to check for a never populated table on sql server 2005 Pin
Roberto Mazzone5-Aug-09 22:08
Roberto Mazzone5-Aug-09 22:08 
QuestionNDoc to SQL scripts? Pin
devvvy3-Aug-09 5:43
devvvy3-Aug-09 5:43 
AnswerRe: NDoc to SQL scripts? Pin
leckey3-Aug-09 8:51
leckey3-Aug-09 8:51 
GeneralRe: NDoc to SQL scripts? Pin
devvvy3-Aug-09 14:51
devvvy3-Aug-09 14:51 
QuestionStored Procedure Pl/SQL Pin
Civic063-Aug-09 4:35
Civic063-Aug-09 4:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.