Viewing 15 posts - 6,961 through 6,975 (of 7,608 total)
Please try this:
SELECT *
INTO dbo.newtable
FROM dbo.oldtable_with_identity
UNION ALL
SELECT TOP (1) *
FROM dbo.oldtable_with_identity
WHERE 1 = 0
The identity property should be left off the column in the new table :-).
December 31, 2012 at 2:40 pm
CELKO (12/27/2012)
All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists."!
The term for this is "union compatible" and it...
December 31, 2012 at 2:31 pm
You could also add an "in-use" column to each row which is set when someone accesses it, and unset when they close it and/or after a certain period of time...
December 31, 2012 at 12:36 pm
CELKO (12/31/2012)
That seems to imply that someone can change his/her SSN at will. I don't believe that's true.
Yep, you can. And thanks to identity theft this is becoming more...
December 31, 2012 at 10:02 am
MS provides "sp_getapplock", and the corresponding "sp_releaseapplock", to help you do this. With them, you can leverage SQL's already-built-and-tested locking mechanisms for your own logical locking. You also...
December 31, 2012 at 9:33 am
Jeff Moden (12/29/2012)
December 31, 2012 at 8:47 am
John Mitchell-245523 (12/31/2012)
ScottPletcher (12/28/2012)
I would never try to re-run the prod processes to get the data for other environments. That would be a nightmare to keep clean.
That's how we...
December 31, 2012 at 8:46 am
Jeff Moden (12/28/2012)
Sean Lange (12/28/2012)
First of all, SSN have and will be reused. When people die their SSN gets recycled into the available pool.
While it is true that a...
December 31, 2012 at 8:30 am
Jeff Moden (12/28/2012)
wannalearn (12/27/2012)
We can not use Log Shipping because Our databases do not store transactions. We load data everynight from different sources ....
December 28, 2012 at 9:09 pm
CELKO (12/28/2012)
Surely there's some good SQL programmers out there doing exactly what CELKO says they do not do.
I have been at this for 25+ years now and I...
December 28, 2012 at 5:08 pm
CELKO (12/28/2012)
For a reasonable level of trust, I use the email address + password, like every website on earth. Seems to work well enough for Paypal, Amazon, et al. People...
December 28, 2012 at 3:40 pm
Sean Lange (12/28/2012)
begin transaction
begin try
-- PART 1 --
Insert into first table
Delete from first table
-- PART 2 --
Insert into a second table
Update my second...
December 28, 2012 at 3:33 pm
You could use an AFTER INSERT trigger to insure that the parent id got set to the identity column values ... but you still couldn't define the parent id as...
December 28, 2012 at 3:19 pm
I would never try to re-run the prod processes to get the data for other environments. That would be a nightmare to keep clean.
One possibility is to mix differential...
December 28, 2012 at 3:08 pm
As noted, heaps are great for "work" / "staging" tables.
Also, I guess in theory a heap could be more efficient for certain types of tables with multiple nonclust indexes, particularly...
December 28, 2012 at 2:40 pm
Viewing 15 posts - 6,961 through 6,975 (of 7,608 total)