Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
2 answers
2k views

How can I get latest id column with select query in SQL Server?

I'm beginner in SQL Server and created a simple table which has an id bigint identity(1,1) column. In my stored procedure I use this query on that table: select * from TABLEA where id > @id I want ...
user3671271's user avatar
0 votes
1 answer
795 views

Importing excel data through a stored proc

How to import data from Excel sheet into a table that has identity seed column? I have a stored proc to INSERT, how do I call it while creating an SSIS package where I mapped the excel columns to the ...
user3587660's user avatar
1 vote
1 answer
503 views

Primary Identity Column of table gets random value in sql server 2012 [duplicate]

CREATE TABLE [dbo].[tbl_Person]( [PersonID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](50) NULL, [Address] [varchar](50) NULL, [Phone] [varchar](50) NULL, CONSTRAINT [PK_tbl_Person] PRIMARY KEY ...
barcanoj's user avatar
  • 131
2 votes
3 answers
5k views

More than one identity column in a SQL Server table

I have the following problem to resolve and I think I need some help as I don't think what I'm thinking as a possible solution is correct: I have a SQL Server table with an identity column. This ...
Cesar Vinas's user avatar
3 votes
2 answers
2k views

SQL Server 2012 scope_identity advise

I created a stored procedure in SQL Server 2012 and I have used scope_identity to get identity column's value but in my case I do not know is this correct or not please help CREATE PROCEDURE ...
danarj's user avatar
  • 1,838
0 votes
3 answers
186 views

Update a Record containing Identity Element using Stored Proc in LinqtoSQL

I have a table defined as: CREATE TABLE [dbo].[procInfo]( [id] [int] IDENTITY(1,1) NOT NULL, [startTime] [datetime] NOT NULL, [endTime] [datetime] NULL, [procName] [varchar](50) NOT ...
ango's user avatar
  • 869
1 vote
4 answers
16k views

SQL Server 2008 R2 Insert Stored Procedure Syntax with Identity Field

Good Afternoon, I've written a very basic stored procedure that will be used to insert QuestionText and QuestionStatus into the Questions table with QuestionID int Primary Key set as having Identity. ...
SidC's user avatar
  • 3,223
44 votes
6 answers
187k views

Inserting into Oracle and retrieving the generated sequence ID

I have a handful of raw SQL queries for SQL Server which use SCOPE_IDENTITY to retrieve the generated ID for a specific INSERT immediately after that INSERT occurs all in one execution… INSERT into ...
Allbite's user avatar
  • 2,497
2 votes
1 answer
1k views

In SQL Server 2008, how should I copy data from database to another database?

I'm trying to write a stored procedure to copy a subset of data from one set of tables to an identical set of tables in a different database. The "source" database needs to be a parameter to the ...
Jim Burnell's user avatar
  • 1,020