Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 1234»»»

Global Configuration Settings Expand / Collapse
Author
Message
Posted Thursday, August 29, 2013 9:14 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 1:09 PM
Points: 341, Visits: 685
Comments posted to this topic are about the item Global Configuration Settings
Post #1489985
Posted Thursday, August 29, 2013 9:19 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 12:45 AM
Points: 1,679, Visits: 751
Interesting question,but what would be the use of this ??

Hope this helps...

Ford Fairlane
Rock and Roll Detective





Post #1489987
Posted Thursday, August 29, 2013 9:25 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 1:09 PM
Points: 341, Visits: 685
Lesson is use the complete name. For example, rather than using "advanced options" use "show advanced options". If MS ever introduces "hide advanced options" then you may need to rewrite some code. Essentially, just be aware of how it works. Just an FYI. :)

Just curious, did you get it right or wrong?
Post #1489989
Posted Thursday, August 29, 2013 9:32 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 12:45 AM
Points: 1,679, Visits: 751
Sean Smith-776614 (8/29/2013)
Lesson is use the complete name. For example, rather than using "advanced options" use "show advanced options". If MS ever introduces "hide advanced options" then you may need to rewrite some code. Essentially, just be aware of how it works. Just an FYI. :)

Just curious, did you get it right or wrong?



Fair enough....

I got it right ... but just couldn't think of a really practically use but maybe its the head cold creeping....


Hope this helps...

Ford Fairlane
Rock and Roll Detective





Post #1489991
Posted Thursday, August 29, 2013 9:35 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 1:09 PM
Points: 341, Visits: 685
As I said, it's just more of an FYI as to how it works.
Post #1489993
Posted Friday, August 30, 2013 12:56 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 3:55 PM
Points: 13,357, Visits: 10,222
Interesting question to close the week, thanks.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1490011
Posted Friday, August 30, 2013 2:02 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 7:52 AM
Points: 3,866, Visits: 5,017
Interesting question, thanks Sean

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1490022
Posted Friday, August 30, 2013 2:25 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 8:33 AM
Points: 2,468, Visits: 2,346
Here is the code from sp_configure:
	-- Use @configname and try to find the right option.
-- If there isn't just one, print appropriate diagnostics and return.
select @configcount = count(*)
from sys.configurations
where lower(name) like '%' + @configname + '%'
and (is_advanced = 0 or @show_advance = 1)

-- If no option, print an error message.
if @configcount = 0
begin
raiserror (15123,-1,-1,@confignameIn)
return (1)
end

-- If more than one option like @configname, show the duplicates and return.
if @configcount > 1
begin
raiserror (15124,-1,-1,@confignameIn)
print ' '

select duplicate_options = name
from sys.configurations
where lower(name) like '%' + @configname + '%'
and (is_advanced = 0 or @show_advance = 1)

return (1)
end
else
-- There must be exactly one, so get the full name.
select @configname = name
from sys.configurations
where lower(name) like '%' + @configname + '%'
and (is_advanced = 0 or @show_advance = 1)

Post #1490026
Posted Friday, August 30, 2013 2:36 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 8:33 AM
Points: 2,468, Visits: 2,346
Here is sp_configure with a simple optimization:
	-- Use @configname and try to find the right option.
-- If there isn't just one, print appropriate diagnostics and return.
select @configcount = count(*)
,@confignameFullName = MAX(name)
from sys.configurations
where lower(name) like '%' + @configname + '%'
and (is_advanced = 0 or @show_advance = 1)

-- If no option, print an error message.
if @configcount = 0
begin
raiserror (15123,-1,-1,@confignameIn)
return (1)
end

-- If more than one option like @configname, show the duplicates and return.
if @configcount > 1
begin
raiserror (15124,-1,-1,@confignameIn)
print ' '

select duplicate_options = name
from sys.configurations
where lower(name) like '%' + @configname + '%'
and (is_advanced = 0 or @show_advance = 1)

return (1)
end
else
-- There must be exactly one, so get the full name.
SET @configname = @confignameFullName

/*
select @configname = name
from sys.configurations
where lower(name) like '%' + @configname + '%'
and (is_advanced = 0 or @show_advance = 1)
*/


Post #1490027
Posted Friday, August 30, 2013 2:37 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 7:48 AM
Points: 365, Visits: 395
"The SQL Server Database Engine recognizes any unique string that is part of the configuration name."

Wow, I did not know that. Good question, I always like it when I learn something new.
Post #1490028
« Prev Topic | Next Topic »

Add to briefcase 1234»»»

Permissions Expand / Collapse