Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.
ALTER PROCEDURE [dbo].[stU_GetIdentityFieldName] @tableName varchar(500), @identityFieldName varchar(500) output AS BEGIN set nocount on create table #identity (name varchar(1000)) --make sure this isn't a temp table if @tableName not like '[#]%' begin exec(' declare @name varchar(100) declare c cursor for select name from syscolumns where ID = object_ID(N''[' + @tableName + ']'') open c fetch next from c into @name while @@fetch_status = 0 begin if (select columnproperty(object_ID(N''[' + @tableName + ']''), @name, ''IsIdentity'')) = 1 insert #identity select @name fetch next from c into @name end close c deallocate c ') select @identityFieldName = name from #identity end else begin --if we have a temp table, we can't find it print('As of now, we know no way of determining a sure-fire way of finding an identity column on a temporary table.') end set nocount off end
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
18 Experts available now in Live!