Ask a Question related to ASP.NET General, Design and Development.
-
SStory #1
Re: SQL Server @@IDENTITY Problem
I believe the better way is to place this in a stored procedure and return
the identity property. It will work like that.
Return it in an output parameter or a select statement if you prefer execute
scalar or you might even return it as a return value
Return values and output params take a little more work--I know...
HTH
Shane
"Micheal" <frooyo@sbcglobal.net> wrote in message
news:OY0tdKrVDHA.2288@TK2MSFTNGP12.phx.gbl...is> The below code does _not_ work! The datatype for the autoincrement value@@identity";> INT in SQL Server 2000. The strange thing is that if I use a 'decimal' it
> works (using .NET framework 1.1)
>
> ---------------------------------------------------------
> string sql = "insert into sports (name) value ('test'); select>
> conn.Open();
>
> SqlCommand cmd = new SqlCommand(sql, conn);
> int result = (int)cmd.ExecuteScalar();
> ----------------------------------------------------------
>
> Thanks in advance
>
>
SStory Guest
-
I?ve got a problem writing files on the server side withFlash Media Server 2.0.2 and 2.0.3.
Hello, I?ve got a problem writing files on the server side with Flash Media Server 2.0.2 and 2.0.3. The same code was working fine with an older... -
Impersonate Identity doesn't work on the server
Hello, In my application I have to impersonate users, so I add <identity impersonate="true" /> to the Web.config file. As long as I run... -
machine.config process identity problem
I'm having some trouble getting ASP.NET to run under the process identity of a domain user. I created a user in the same domain in which the... -
DB2 - OS390: Identity Column Problem
I have an identity column created as 'GENERATED BY DEFAULT' 'NO CACHE' 'START WITH 1' 'INCREMENT BY 1'. My problem is that at times it skips 1000... -
Problem with IDENTITY and ORDER BY in a INSERT statement
Peter, I think this is a minor bug with the SQL Server parser. I've passed it on to MS. Fortunately the workaround is simple. I'll also... -
Greg Low \(MVP\) #2
Re: SQL Server @@IDENTITY Problem
Absolutely. Also consider using SCOPE_IDENTITY with SS 2000 as it avoids
problems where triggers have been assigned.
HTH
--
Greg Low (MVP)
MSDE Manager SQL Tools
[url]www.whitebearconsulting.com[/url]
"SStory >" <Shane_Story@online.msn.com <remove the 'online.' to send me
mail> wrote in message news:%23x6ki2sVDHA.1620@TK2MSFTNGP12.phx.gbl...execute> I believe the better way is to place this in a stored procedure and return
> the identity property. It will work like that.
> Return it in an output parameter or a select statement if you prefervalue> scalar or you might even return it as a return value
>
> Return values and output params take a little more work--I know...
>
> HTH
> Shane
>
> "Micheal" <frooyo@sbcglobal.net> wrote in message
> news:OY0tdKrVDHA.2288@TK2MSFTNGP12.phx.gbl...> > The below code does _not_ work! The datatype for the autoincrementit> is> > INT in SQL Server 2000. The strange thing is that if I use a 'decimal'> @@identity";> > works (using .NET framework 1.1)
> >
> > ---------------------------------------------------------
> > string sql = "insert into sports (name) value ('test'); select>> >
> > conn.Open();
> >
> > SqlCommand cmd = new SqlCommand(sql, conn);
> > int result = (int)cmd.ExecuteScalar();
> > ----------------------------------------------------------
> >
> > Thanks in advance
> >
> >
>
Greg Low \(MVP\) Guest



Reply With Quote

