In SQL Server Enterprise Manager taskpad will display database size free and
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,
See sp_spaceused in SQL Server Books Online. In master databse, you could
run the following to see what tables this procedure accesses:
sp_helptext sp_spaceused
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:805D5942-D569-4083-99B4-E537F845D880@.microsoft.com...
In SQL Server Enterprise Manager taskpad will display database size free and
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,
|||Hi Joe,
Sysindexes system table in each database stores all the space information. You could also use the system stored procedure
"sp_spaceused " to get the space usage. For transaction log usage use DBCC SQLPERF(LOGSPACE)
Thanks
Hari
SQL Server MVP
____________________________________
Joe K. Wrote:
In SQL Server Enterprise Manager taskpad will display database size free and
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,
Sent via SreeSharp NewsReader http://www.SreeSharp.com
sql
Showing posts with label display. Show all posts
Showing posts with label display. Show all posts
Thursday, March 22, 2012
Database Size (Free,Used)
In SQL Server Enterprise Manager taskpad will display database size free and
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,See sp_spaceused in SQL Server Books Online. In master databse, you could
run the following to see what tables this procedure accesses:
sp_helptext sp_spaceused
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:805D5942-D569-4083-99B4-E537F845D880@.microsoft.com...
In SQL Server Enterprise Manager taskpad will display database size free and
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,|||Hi Joe,
Sysindexes system table in each database stores all the space information. Y
ou could also use the system stored procedure
"sp_spaceused " to get the space usage. For transaction log usage use DBCC S
QLPERF(LOGSPACE)
Thanks
Hari
SQL Server MVP
____________________________________
Joe K. Wrote:
In SQL Server Enterprise Manager taskpad will display database size free and
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,
Sent via SreeSharp NewsReader http://www.SreeSharp.com
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,See sp_spaceused in SQL Server Books Online. In master databse, you could
run the following to see what tables this procedure accesses:
sp_helptext sp_spaceused
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:805D5942-D569-4083-99B4-E537F845D880@.microsoft.com...
In SQL Server Enterprise Manager taskpad will display database size free and
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,|||Hi Joe,
Sysindexes system table in each database stores all the space information. Y
ou could also use the system stored procedure
"sp_spaceused " to get the space usage. For transaction log usage use DBCC S
QLPERF(LOGSPACE)
Thanks
Hari
SQL Server MVP
____________________________________
Joe K. Wrote:
In SQL Server Enterprise Manager taskpad will display database size free and
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,
Sent via SreeSharp NewsReader http://www.SreeSharp.com
Database Size (Free,Used)
In SQL Server Enterprise Manager taskpad will display database size free and
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,See sp_spaceused in SQL Server Books Online. In master databse, you could
run the following to see what tables this procedure accesses:
sp_helptext sp_spaceused
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:805D5942-D569-4083-99B4-E537F845D880@.microsoft.com...
In SQL Server Enterprise Manager taskpad will display database size free and
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,See sp_spaceused in SQL Server Books Online. In master databse, you could
run the following to see what tables this procedure accesses:
sp_helptext sp_spaceused
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:805D5942-D569-4083-99B4-E537F845D880@.microsoft.com...
In SQL Server Enterprise Manager taskpad will display database size free and
used space.
What tables within SQL Server is this information stored?
Is there another way to obtain database size free and used space?
Thanks,
Wednesday, March 21, 2012
Database Setting for text box and text area forms
I have a SQL Server database. The data from a table is populated in the table and can do a regular display query on a record without issue.
Problem is when I pull the data into a form the data doesn't show up in some form fields for editing.
I am building a backend for the manager to make updates and changes and this is vital. Does anyone know if it has something to do with a database setting or has had a similar issue in the past?
The reason I think its a database setting is becuase the same table converted into MS Access has no problem populating the text boxs and text areas.
Your help is much needed and appreciated.
Thanks.In case anyone is interested. You can solve this with a work around. Set a vaiable for the field item then use the response.write the variable to popluate the text box or text area.
Problem is when I pull the data into a form the data doesn't show up in some form fields for editing.
I am building a backend for the manager to make updates and changes and this is vital. Does anyone know if it has something to do with a database setting or has had a similar issue in the past?
The reason I think its a database setting is becuase the same table converted into MS Access has no problem populating the text boxs and text areas.
Your help is much needed and appreciated.
Thanks.In case anyone is interested. You can solve this with a work around. Set a vaiable for the field item then use the response.write the variable to popluate the text box or text area.
Sunday, February 19, 2012
Database Properties
is there anyway to retrieve the database properties and display in an asp.net web form as a quick over view rather than logging onto the server to check, items such as size, space available, last backup data etc?
Cheers
I have managed to get the database size using :
EXEC sp_MSforeachtable @.command1=EXEC sp_spaceused
|||
Hi,
Haven't tried it but you should be able to use theMicrosoft.SqlServer.Management.Smo to do so:
Here's an example :
http://www.aspfree.com/c/a/MS-SQL-Server/Retrieving-SQL-Server-2005-Database-Info-Using-SMO-Database-Info-Table-Info/1/
HTH,
Suprotim Agarwal
--
http://www.dotnetcurry.com
--
Tuesday, February 14, 2012
Database option - Pls help.
Hi all,
I wonder whether is there any system store procedure or any way for me to
display the database option ? I know I can use the MS SQL Server Management
Studio to view it but I want to use T-SQL statement.
Using sp_dboption I can see all database settable options but I can't see
the value, whether is it currently enable or disable ?
Thank you for your help! :D
Cheers,
Meng Soon Chua> Using sp_dboption I can see all database settable options but I can't see
> the value, whether is it currently enable or disable ?
To see the options that are currently set, pass the database name:
EXEC sp_dboption 'MyDatabase'
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in message
news:70CE7261-172E-47D8-8598-63E8FDFD2D6C@.microsoft.com...
> Hi all,
> I wonder whether is there any system store procedure or any way for me to
> display the database option ? I know I can use the MS SQL Server
> Management
> Studio to view it but I want to use T-SQL statement.
> Using sp_dboption I can see all database settable options but I can't see
> the value, whether is it currently enable or disable ?
> Thank you for your help! :D
> Cheers,
> Meng Soon Chua|||Also note that sp_dboption was replaced with ALTER DATABASE in 2000. IF you are on 2005, I suggest
you do:
SELECT * FROM sys.databases WHERE name = 'Adventureworks'
If you are on 2000, I suggest you use the DATABASEPROPERTYEX() function.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:850B4CAE-ACF2-4BAB-9585-9915E4644B4F@.microsoft.com...
>> Using sp_dboption I can see all database settable options but I can't see
>> the value, whether is it currently enable or disable ?
> To see the options that are currently set, pass the database name:
> EXEC sp_dboption 'MyDatabase'
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in message
> news:70CE7261-172E-47D8-8598-63E8FDFD2D6C@.microsoft.com...
>> Hi all,
>> I wonder whether is there any system store procedure or any way for me to
>> display the database option ? I know I can use the MS SQL Server Management
>> Studio to view it but I want to use T-SQL statement.
>> Using sp_dboption I can see all database settable options but I can't see
>> the value, whether is it currently enable or disable ?
>> Thank you for your help! :D
>> Cheers,
>> Meng Soon Chua
>|||Hi Dan,
Thanks for the response.
Hey ! It does show those option that is turned on. But another question ;-)
I have checked the database (by using MS SQL Studio)
ANSI NULL Default -> False
ANSI NULLS Enabled -> False
Then next I start a 'New Query'
For this connection I write the below statement
USE Pubs
go
SET ANSI_NULLS ON
go
EXEC SP_DBOPTION 'Pubs'
--
The result display;
autoclose
auto create statistics
auto update statistics
Hmm ... how come the result didnt include 'ANSI NULLS Enabled' ? I thought I
turn it on for this connection ? Am I doing something wrong ? I just want to
double check whether I really turn on ANSI_NULLS :-| ...
Please help ? Many thanks ...
"Dan Guzman" wrote:
> > Using sp_dboption I can see all database settable options but I can't see
> > the value, whether is it currently enable or disable ?
> To see the options that are currently set, pass the database name:
> EXEC sp_dboption 'MyDatabase'
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in message
> news:70CE7261-172E-47D8-8598-63E8FDFD2D6C@.microsoft.com...
> > Hi all,
> >
> > I wonder whether is there any system store procedure or any way for me to
> > display the database option ? I know I can use the MS SQL Server
> > Management
> > Studio to view it but I want to use T-SQL statement.
> > Using sp_dboption I can see all database settable options but I can't see
> > the value, whether is it currently enable or disable ?
> >
> > Thank you for your help! :D
> >
> > Cheers,
> > Meng Soon Chua
>|||> ANSI NULL Default -> False
> ANSI NULLS Enabled -> False
First, let me make it clear these settings are unrelated. "ANSI NULL
Default" setting affects default nullability of new columns and only when
both ANSI_NULL_DFLT_ON and ANSI_NULL_DFLT_OFF are turned off. The Best
Practice is to explicitly specify NULL or NOT NULL in CREATE TABLE
statements so that you don't need to bother with that option.
The "ANSI NULLS Enabled" option controls how non-Unicode NULL values are
evaluated. The Best Practice is to always keep ANSI_NULL ON unless you have
a legacy application that can't be changed.
> Hmm ... how come the result didnt include 'ANSI NULLS Enabled' ? I thought
> I
> turn it on for this connection ? Am I doing something wrong ? I just want
> to
> double check whether I really turn on ANSI_NULLS :-| ...
Connection settings override the database default setting. When you check
the database options with sp_dboption (or DATABASEPROPEREX as Tibor
suggested), you are viewing only the database default setting for all
connections. You can execute DBCC USEROPTIONS to view the current
connection active settings.
Importantly, OLEDB, ODBC APIs turn on ANSI-92 behavior settings
automatically when you connect so there is usually no need to check these
manually. This also means that the related database setting defaults will
have no affect when ODBC and OLEDB clients connect.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in message
news:E96A8F93-EBD6-4865-A18E-D001FB7790A8@.microsoft.com...
> Hi Dan,
> Thanks for the response.
> Hey ! It does show those option that is turned on. But another question
> ;-)
> I have checked the database (by using MS SQL Studio)
> ANSI NULL Default -> False
> ANSI NULLS Enabled -> False
> Then next I start a 'New Query'
> For this connection I write the below statement
> USE Pubs
> go
> SET ANSI_NULLS ON
> go
> EXEC SP_DBOPTION 'Pubs'
> --
> The result display;
> autoclose
> auto create statistics
> auto update statistics
> Hmm ... how come the result didnt include 'ANSI NULLS Enabled' ? I thought
> I
> turn it on for this connection ? Am I doing something wrong ? I just want
> to
> double check whether I really turn on ANSI_NULLS :-| ...
> Please help ? Many thanks ...
>
> "Dan Guzman" wrote:
>> > Using sp_dboption I can see all database settable options but I can't
>> > see
>> > the value, whether is it currently enable or disable ?
>> To see the options that are currently set, pass the database name:
>> EXEC sp_dboption 'MyDatabase'
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in
>> message
>> news:70CE7261-172E-47D8-8598-63E8FDFD2D6C@.microsoft.com...
>> > Hi all,
>> >
>> > I wonder whether is there any system store procedure or any way for me
>> > to
>> > display the database option ? I know I can use the MS SQL Server
>> > Management
>> > Studio to view it but I want to use T-SQL statement.
>> > Using sp_dboption I can see all database settable options but I can't
>> > see
>> > the value, whether is it currently enable or disable ?
>> >
>> > Thank you for your help! :D
>> >
>> > Cheers,
>> > Meng Soon Chua|||Hi ...
Thanks a lot guys. It does answer my question ;-)
"Dan Guzman" wrote:
> > ANSI NULL Default -> False
> > ANSI NULLS Enabled -> False
> First, let me make it clear these settings are unrelated. "ANSI NULL
> Default" setting affects default nullability of new columns and only when
> both ANSI_NULL_DFLT_ON and ANSI_NULL_DFLT_OFF are turned off. The Best
> Practice is to explicitly specify NULL or NOT NULL in CREATE TABLE
> statements so that you don't need to bother with that option.
> The "ANSI NULLS Enabled" option controls how non-Unicode NULL values are
> evaluated. The Best Practice is to always keep ANSI_NULL ON unless you have
> a legacy application that can't be changed.
> > Hmm ... how come the result didnt include 'ANSI NULLS Enabled' ? I thought
> > I
> > turn it on for this connection ? Am I doing something wrong ? I just want
> > to
> > double check whether I really turn on ANSI_NULLS :-| ...
> Connection settings override the database default setting. When you check
> the database options with sp_dboption (or DATABASEPROPEREX as Tibor
> suggested), you are viewing only the database default setting for all
> connections. You can execute DBCC USEROPTIONS to view the current
> connection active settings.
> Importantly, OLEDB, ODBC APIs turn on ANSI-92 behavior settings
> automatically when you connect so there is usually no need to check these
> manually. This also means that the related database setting defaults will
> have no affect when ODBC and OLEDB clients connect.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in message
> news:E96A8F93-EBD6-4865-A18E-D001FB7790A8@.microsoft.com...
> > Hi Dan,
> >
> > Thanks for the response.
> > Hey ! It does show those option that is turned on. But another question
> > ;-)
> >
> > I have checked the database (by using MS SQL Studio)
> >
> > ANSI NULL Default -> False
> > ANSI NULLS Enabled -> False
> >
> > Then next I start a 'New Query'
> > For this connection I write the below statement
> > USE Pubs
> > go
> > SET ANSI_NULLS ON
> > go
> > EXEC SP_DBOPTION 'Pubs'
> >
> > --
> > The result display;
> >
> > autoclose
> > auto create statistics
> > auto update statistics
> >
> > Hmm ... how come the result didnt include 'ANSI NULLS Enabled' ? I thought
> > I
> > turn it on for this connection ? Am I doing something wrong ? I just want
> > to
> > double check whether I really turn on ANSI_NULLS :-| ...
> >
> > Please help ? Many thanks ...
> >
> >
> >
> > "Dan Guzman" wrote:
> >
> >> > Using sp_dboption I can see all database settable options but I can't
> >> > see
> >> > the value, whether is it currently enable or disable ?
> >>
> >> To see the options that are currently set, pass the database name:
> >>
> >> EXEC sp_dboption 'MyDatabase'
> >>
> >> --
> >> Hope this helps.
> >>
> >> Dan Guzman
> >> SQL Server MVP
> >>
> >> "Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in
> >> message
> >> news:70CE7261-172E-47D8-8598-63E8FDFD2D6C@.microsoft.com...
> >> > Hi all,
> >> >
> >> > I wonder whether is there any system store procedure or any way for me
> >> > to
> >> > display the database option ? I know I can use the MS SQL Server
> >> > Management
> >> > Studio to view it but I want to use T-SQL statement.
> >> > Using sp_dboption I can see all database settable options but I can't
> >> > see
> >> > the value, whether is it currently enable or disable ?
> >> >
> >> > Thank you for your help! :D
> >> >
> >> > Cheers,
> >> > Meng Soon Chua
> >>
>
I wonder whether is there any system store procedure or any way for me to
display the database option ? I know I can use the MS SQL Server Management
Studio to view it but I want to use T-SQL statement.
Using sp_dboption I can see all database settable options but I can't see
the value, whether is it currently enable or disable ?
Thank you for your help! :D
Cheers,
Meng Soon Chua> Using sp_dboption I can see all database settable options but I can't see
> the value, whether is it currently enable or disable ?
To see the options that are currently set, pass the database name:
EXEC sp_dboption 'MyDatabase'
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in message
news:70CE7261-172E-47D8-8598-63E8FDFD2D6C@.microsoft.com...
> Hi all,
> I wonder whether is there any system store procedure or any way for me to
> display the database option ? I know I can use the MS SQL Server
> Management
> Studio to view it but I want to use T-SQL statement.
> Using sp_dboption I can see all database settable options but I can't see
> the value, whether is it currently enable or disable ?
> Thank you for your help! :D
> Cheers,
> Meng Soon Chua|||Also note that sp_dboption was replaced with ALTER DATABASE in 2000. IF you are on 2005, I suggest
you do:
SELECT * FROM sys.databases WHERE name = 'Adventureworks'
If you are on 2000, I suggest you use the DATABASEPROPERTYEX() function.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:850B4CAE-ACF2-4BAB-9585-9915E4644B4F@.microsoft.com...
>> Using sp_dboption I can see all database settable options but I can't see
>> the value, whether is it currently enable or disable ?
> To see the options that are currently set, pass the database name:
> EXEC sp_dboption 'MyDatabase'
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in message
> news:70CE7261-172E-47D8-8598-63E8FDFD2D6C@.microsoft.com...
>> Hi all,
>> I wonder whether is there any system store procedure or any way for me to
>> display the database option ? I know I can use the MS SQL Server Management
>> Studio to view it but I want to use T-SQL statement.
>> Using sp_dboption I can see all database settable options but I can't see
>> the value, whether is it currently enable or disable ?
>> Thank you for your help! :D
>> Cheers,
>> Meng Soon Chua
>|||Hi Dan,
Thanks for the response.
Hey ! It does show those option that is turned on. But another question ;-)
I have checked the database (by using MS SQL Studio)
ANSI NULL Default -> False
ANSI NULLS Enabled -> False
Then next I start a 'New Query'
For this connection I write the below statement
USE Pubs
go
SET ANSI_NULLS ON
go
EXEC SP_DBOPTION 'Pubs'
--
The result display;
autoclose
auto create statistics
auto update statistics
Hmm ... how come the result didnt include 'ANSI NULLS Enabled' ? I thought I
turn it on for this connection ? Am I doing something wrong ? I just want to
double check whether I really turn on ANSI_NULLS :-| ...
Please help ? Many thanks ...
"Dan Guzman" wrote:
> > Using sp_dboption I can see all database settable options but I can't see
> > the value, whether is it currently enable or disable ?
> To see the options that are currently set, pass the database name:
> EXEC sp_dboption 'MyDatabase'
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in message
> news:70CE7261-172E-47D8-8598-63E8FDFD2D6C@.microsoft.com...
> > Hi all,
> >
> > I wonder whether is there any system store procedure or any way for me to
> > display the database option ? I know I can use the MS SQL Server
> > Management
> > Studio to view it but I want to use T-SQL statement.
> > Using sp_dboption I can see all database settable options but I can't see
> > the value, whether is it currently enable or disable ?
> >
> > Thank you for your help! :D
> >
> > Cheers,
> > Meng Soon Chua
>|||> ANSI NULL Default -> False
> ANSI NULLS Enabled -> False
First, let me make it clear these settings are unrelated. "ANSI NULL
Default" setting affects default nullability of new columns and only when
both ANSI_NULL_DFLT_ON and ANSI_NULL_DFLT_OFF are turned off. The Best
Practice is to explicitly specify NULL or NOT NULL in CREATE TABLE
statements so that you don't need to bother with that option.
The "ANSI NULLS Enabled" option controls how non-Unicode NULL values are
evaluated. The Best Practice is to always keep ANSI_NULL ON unless you have
a legacy application that can't be changed.
> Hmm ... how come the result didnt include 'ANSI NULLS Enabled' ? I thought
> I
> turn it on for this connection ? Am I doing something wrong ? I just want
> to
> double check whether I really turn on ANSI_NULLS :-| ...
Connection settings override the database default setting. When you check
the database options with sp_dboption (or DATABASEPROPEREX as Tibor
suggested), you are viewing only the database default setting for all
connections. You can execute DBCC USEROPTIONS to view the current
connection active settings.
Importantly, OLEDB, ODBC APIs turn on ANSI-92 behavior settings
automatically when you connect so there is usually no need to check these
manually. This also means that the related database setting defaults will
have no affect when ODBC and OLEDB clients connect.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in message
news:E96A8F93-EBD6-4865-A18E-D001FB7790A8@.microsoft.com...
> Hi Dan,
> Thanks for the response.
> Hey ! It does show those option that is turned on. But another question
> ;-)
> I have checked the database (by using MS SQL Studio)
> ANSI NULL Default -> False
> ANSI NULLS Enabled -> False
> Then next I start a 'New Query'
> For this connection I write the below statement
> USE Pubs
> go
> SET ANSI_NULLS ON
> go
> EXEC SP_DBOPTION 'Pubs'
> --
> The result display;
> autoclose
> auto create statistics
> auto update statistics
> Hmm ... how come the result didnt include 'ANSI NULLS Enabled' ? I thought
> I
> turn it on for this connection ? Am I doing something wrong ? I just want
> to
> double check whether I really turn on ANSI_NULLS :-| ...
> Please help ? Many thanks ...
>
> "Dan Guzman" wrote:
>> > Using sp_dboption I can see all database settable options but I can't
>> > see
>> > the value, whether is it currently enable or disable ?
>> To see the options that are currently set, pass the database name:
>> EXEC sp_dboption 'MyDatabase'
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in
>> message
>> news:70CE7261-172E-47D8-8598-63E8FDFD2D6C@.microsoft.com...
>> > Hi all,
>> >
>> > I wonder whether is there any system store procedure or any way for me
>> > to
>> > display the database option ? I know I can use the MS SQL Server
>> > Management
>> > Studio to view it but I want to use T-SQL statement.
>> > Using sp_dboption I can see all database settable options but I can't
>> > see
>> > the value, whether is it currently enable or disable ?
>> >
>> > Thank you for your help! :D
>> >
>> > Cheers,
>> > Meng Soon Chua|||Hi ...
Thanks a lot guys. It does answer my question ;-)
"Dan Guzman" wrote:
> > ANSI NULL Default -> False
> > ANSI NULLS Enabled -> False
> First, let me make it clear these settings are unrelated. "ANSI NULL
> Default" setting affects default nullability of new columns and only when
> both ANSI_NULL_DFLT_ON and ANSI_NULL_DFLT_OFF are turned off. The Best
> Practice is to explicitly specify NULL or NOT NULL in CREATE TABLE
> statements so that you don't need to bother with that option.
> The "ANSI NULLS Enabled" option controls how non-Unicode NULL values are
> evaluated. The Best Practice is to always keep ANSI_NULL ON unless you have
> a legacy application that can't be changed.
> > Hmm ... how come the result didnt include 'ANSI NULLS Enabled' ? I thought
> > I
> > turn it on for this connection ? Am I doing something wrong ? I just want
> > to
> > double check whether I really turn on ANSI_NULLS :-| ...
> Connection settings override the database default setting. When you check
> the database options with sp_dboption (or DATABASEPROPEREX as Tibor
> suggested), you are viewing only the database default setting for all
> connections. You can execute DBCC USEROPTIONS to view the current
> connection active settings.
> Importantly, OLEDB, ODBC APIs turn on ANSI-92 behavior settings
> automatically when you connect so there is usually no need to check these
> manually. This also means that the related database setting defaults will
> have no affect when ODBC and OLEDB clients connect.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in message
> news:E96A8F93-EBD6-4865-A18E-D001FB7790A8@.microsoft.com...
> > Hi Dan,
> >
> > Thanks for the response.
> > Hey ! It does show those option that is turned on. But another question
> > ;-)
> >
> > I have checked the database (by using MS SQL Studio)
> >
> > ANSI NULL Default -> False
> > ANSI NULLS Enabled -> False
> >
> > Then next I start a 'New Query'
> > For this connection I write the below statement
> > USE Pubs
> > go
> > SET ANSI_NULLS ON
> > go
> > EXEC SP_DBOPTION 'Pubs'
> >
> > --
> > The result display;
> >
> > autoclose
> > auto create statistics
> > auto update statistics
> >
> > Hmm ... how come the result didnt include 'ANSI NULLS Enabled' ? I thought
> > I
> > turn it on for this connection ? Am I doing something wrong ? I just want
> > to
> > double check whether I really turn on ANSI_NULLS :-| ...
> >
> > Please help ? Many thanks ...
> >
> >
> >
> > "Dan Guzman" wrote:
> >
> >> > Using sp_dboption I can see all database settable options but I can't
> >> > see
> >> > the value, whether is it currently enable or disable ?
> >>
> >> To see the options that are currently set, pass the database name:
> >>
> >> EXEC sp_dboption 'MyDatabase'
> >>
> >> --
> >> Hope this helps.
> >>
> >> Dan Guzman
> >> SQL Server MVP
> >>
> >> "Meng Soon Chua" <MengSoonChua@.discussions.microsoft.com> wrote in
> >> message
> >> news:70CE7261-172E-47D8-8598-63E8FDFD2D6C@.microsoft.com...
> >> > Hi all,
> >> >
> >> > I wonder whether is there any system store procedure or any way for me
> >> > to
> >> > display the database option ? I know I can use the MS SQL Server
> >> > Management
> >> > Studio to view it but I want to use T-SQL statement.
> >> > Using sp_dboption I can see all database settable options but I can't
> >> > see
> >> > the value, whether is it currently enable or disable ?
> >> >
> >> > Thank you for your help! :D
> >> >
> >> > Cheers,
> >> > Meng Soon Chua
> >>
>
Subscribe to:
Posts (Atom)