File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 299299
300300 IF ISNULL (@SkipValidateLogins, 0 ) != 1 /* If @SkipValidateLogins hasn't been set to 1 by the caller*/
301301 BEGIN
302- IF OBJECT_ID (N ' tempdb..#ValidateLoginsTest' ) IS NULL
303- BEGIN
304- CREATE TABLE #ValidateLoginsTest
305- (
306- [SID] varbinary ( 85 )
307- ,[NT_Login] sysname
308- );
309- END ;
302+ IF OBJECT_ID (N ' tempdb..#ValidateLoginsTest' ) IS NOT NULL
303+ EXEC sp_executesql N ' DROP TABLE #ValidateLoginsTest;' ;
304+
305+ CREATE TABLE #ValidateLoginsTest
306+ (
307+ [SID] varbinary ( 85 )
308+ ,[NT_Login] sysname
309+ ) ;
310310
311311 BEGIN TRY
312312 INSERT INTO #ValidateLoginsTest
316316 )
317317 EXEC sp_validatelogins;
318318
319- SET @SkipValidateLogins = 0 /* We can execute sp_validatelogins*/
319+ SET @SkipValidateLogins = 0 ; /* We can execute sp_validatelogins*/
320320 END TRY
321321 BEGIN CATCH
322- SET @SkipValidateLogins = 1 /* We have don't have execute rights or sp_validatelogins throws an error so skip it*/
322+ SET @SkipValidateLogins = 1 ; /* We have don't have execute rights or sp_validatelogins throws an error so skip it*/
323323 END CATCH ;
324324
325325 IF OBJECT_ID (N ' tempdb..#ValidateLoginsTest' ) IS NOT NULL
326- BEGIN
327- DROP TABLE #ValidateLoginsTest;
328- END ;
326+ EXEC sp_executesql N ' DROP TABLE #ValidateLoginsTest;' ;
329327 END ; /* Need execute on sp_validatelogins*/
330328
331329 IF ISNULL (@SkipModel, 0 ) != 1 /* If @SkipModel hasn't been set to 1 by the caller*/
You can’t perform that action at this time.
0 commit comments