[thelist] SELECT SCOPE_IDENTITY() not working in new DB

Tab Alleman talleman at Lumpsum.com
Mon Jul 10 08:52:27 CDT 2006


Check the table in the new db and make sure it has an IDENTITY column now.  I'm sure the column is there, but it might have lost its IDENTITY property.

> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org]On Behalf Of Casey Crookston
> Sent: Friday, July 07, 2006 5:58 PM
> To: thelist at lists.evolt.org
> Subject: [thelist] SELECT SCOPE_IDENTITY() not working in new DB
> 
> 
> Using MS SQL, I'm using SELECT SCOPE_IDENTITY() to harvest the id of a
> record just created.  It works great!  But, we needed to rename the
> database, which you can't seem to do in MS SQL (right?).  So 
> I created a
> new database, exported all the tables and content, duplicated 
> the user.
> I *thought* I had simply made an exact duplicate of the original
> database, but when executing the page that uses SELECT 
> SCOPE_IDENTITY(),
> it errors out at that point.  
> 
>  
> 
> To be sure, I switched back to the original database in the 
> web.config's
> connection string, tried the page again, and it worked fine.
> 
>  
> 
> That the heck?
> 
>  
> 
> Casey
> 
> -- 
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt ! 
> 



More information about the thelist mailing list