File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 265265 END ; /* We need this permission to execute trace stuff, apparently*/
266266
267267 IF ISNULL (@SkipXPRegRead, 0 ) != 1 /* If @SkipXPRegRead hasn't been set to 1 by the caller*/
268- BEGIN TRY
268+ BEGIN
269269 IF OBJECT_ID (N ' tempdb..#XpRegReadTest' ) IS NULL
270270 BEGIN
271271 CREATE TABLE #XpRegReadTest
275275 );
276276 END ;
277277
278- INSERT INTO #XpRegReadTest
279- (
280- [Value]
281- ,[Data]
282- )
283- EXEC xp_regread @rootkey = N ' HKEY_LOCAL_MACHINE' ,
284- @key = N ' ' ,
285- @value_name = N ' ' ;
286-
287- SET @SkipXPRegRead = 0 ; /* We can execute xp_regread*/
278+ BEGIN TRY
279+ INSERT INTO #XpRegReadTest
280+ (
281+ [Value]
282+ ,[Data]
283+ )
284+ EXEC xp_regread @rootkey = N ' HKEY_LOCAL_MACHINE' ,
285+ @key = N ' ' ,
286+ @value_name = N ' ' ;
287+
288+ SET @SkipXPRegRead = 0 ; /* We can execute xp_regread*/
289+ END TRY
290+ BEGIN CATCH
291+ SET @SkipXPRegRead = 1 ; /* We have don't have execute rights or xp_regread throws an error so skip it*/
292+ END CATCH ;
288293
289294 IF OBJECT_ID (N ' tempdb..#XpRegReadTest' ) IS NOT NULL
290295 BEGIN
291296 DROP TABLE #XpRegReadTest;
292297 END ;
293- END TRY
294- BEGIN CATCH
295- SET @SkipXPRegRead = 1 ; /* We have don't have execute rights or xp_regread throws an error so skip it*/
296- END CATCH ; /* Need execute on xp_regread*/
298+ END ; /* Need execute on xp_regread*/
299+
297300
298301 IF NOT EXISTS
299302 (
You can’t perform that action at this time.
0 commit comments