var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Insert/Select Statement - How to insert/select incrementing value (bulk insert)
my script is inside a stored procedure. i will create a view that will hold the data from my select query. how can i insert an incrementing value to the view(result set)?
here's my syntax to further explain...
the view created should have an added column containg the incrementing value. how is this? thanks in advance.
CREATE VIEW <ViewName>
SELECT <IncrementingValue>, * FROM TableName
You're creating a view within a stored procedure?! I hope not.
You have a couple of options - you can use table variables, temporary tables, or windowed functions (SQL 2005+ only for windows functions!).
but u can't do in creating a view in sp as gerorge said
try like this in ur sp
select identity(int,1,1)as id,* into newtablename from urtable
select * from newtablename
Use of analytical functions will trump that in SQL 2005 +. For 2K, it might be the best method.
Originally Posted by bklr
Of course, the standard question: what are you displaying the result in? (ASP.NET, Access, Crystal Reports etc)?
ur codings are working excelent.