Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3458

Re: Synchronizing ASE syslogins and sysusers after a database load

$
0
0

Jason,

 

Upon further review of the code, and unless I am missing something, there could be an issue with the initialization of one of the variables in very large environments.

 

E.g.

 

declare @name char(30), @uid int, @suid int

select @suid = 9999

 

Later on in the body of the while loop processing the cursor, the variable is again reset to 9999.

Presumably to wipe the previous "real" value, and provide some debugging capability.

 

However, in that case, why not let the variable retain its initial NULL value, and later reset it to NULL in the loop? I know purists will argue that you cannot set a variable to NULL but in T-SQL you can...

 

I would suggest initializing the variable to a value that will never occur...

 

E.g.

 

select @suid = 0

 

FYI, ust in one of the test databases I am using right now, we already have 4000+ logins,

and we are talking about not purging them... So over time, we could reach 10,000...

 

A bit far fetched, but, a potential bug nonetheless, don't you think?

 

Regards,

 

Jean-Pierre


Viewing all articles
Browse latest Browse all 3458

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>