New answers tagged

9

Some alternatives to adding the auto-increment column via the IDENTITY() function as suggested by @Shaneis are: Create the table explicitly using CREATE TABLE instead of using SELECT INTO. I much prefer this method as it gives you complete control over the Table that is being created, such as including the auto-increment column and specifying that it be ...


5

Sounds like you are looking for the IDENTITY() function: Is used only in a SELECT statement with an INTO table clause to insert an identity column into a new table. USE [MYDB] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER Procedure [dbo].[spSchedula_Scadenzario] as begin drop table MYDB.dbo.tmpTable select -- Create new ...


1

If you know start _id and end _id then you can retrieve the bulk you inserted using query like this: db.yourCollection.find({_id:{$gt:ObjectId("56e13d5aed63a8477a7e2e78"), $lt: ObjectId("570f5a27b2d1a50996d3a0f0")}}) Replace the default mongodb ObjectIds with your _id fields. Also, if the _id you are using is default mongodb ObjectId then you can easily ...



Top 50 recent answers are included