Showing posts with label current. Show all posts
Showing posts with label current. Show all posts

Wednesday, March 21, 2012

quoted_identifier

How do I see the current value of QUOTED_IDENTIFIER in a SQL2000
database? Thank you.Select OBJECTPROPERTY(DB_ID(),'IsQuotedIdentOn'
)
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Rick Charnes" <rickxyz--nospam.zyxcharnes@.thehartford.com> schrieb im
Newsbeitrag news:MPG.1cd87166eb1a31ef9898d6@.msnews.microsoft.com...
> How do I see the current value of QUOTED_IDENTIFIER in a SQL2000
> database? Thank you.|||You can determine the database default QUOTED_IDENTIFIER setting is on with
DATABASEPROPERTY. However, connection settings take precedence and
QUOTED_IDENTIFIER ON is the default OLEDB and ODBC connection setting.
SELECT DATABASEPROPERTY('MyDatabase', 'IsQuotedIdentifiersEnabled')
Hope this helps.
Dan Guzman
SQL Server MVP
"Rick Charnes" <rickxyz--nospam.zyxcharnes@.thehartford.com> wrote in message
news:MPG.1cd87166eb1a31ef9898d6@.msnews.microsoft.com...
> How do I see the current value of QUOTED_IDENTIFIER in a SQL2000
> database? Thank you.|||In article <uIVaoSsSFHA.2128@.TK2MSFTNGP14.phx.gbl>, guzmanda@.nospam-
online.sbcglobal.net says...
> You can determine the database default QUOTED_IDENTIFIER setting is on wit
h
> DATABASEPROPERTY. However, connection settings take precedence and
> QUOTED_IDENTIFIER ON is the default OLEDB and ODBC connection setting.
> SELECT DATABASEPROPERTY('MyDatabase', 'IsQuotedIdentifiersEnabled')
>
Thanks. The above SELECT statement returns 0 on my database which I
assume indicates that quoted_identifier is OFF. But can you explain
what you mean when you say 'connection settings take precedence'? Are
'connection settings' something different from the DATABASE setting
returned by this SELECT statement? I am accessing SQLServer through my
application using OLEDB. Thanks much for your help.|||Check out the SET command. For some database options, you have the same beha
vior exposed through a
SET command. A setting though a SET command applies to a connection ("sessio
n"). Some API's will set
some SET commands for you. And I believe that both ODBC and OLEDB will set t
he quoted_identifier
setting, making the database option useless for those API's.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rick Charnes" <rickxyz--nospam.zyxcharnes@.thehartford.com> wrote in message
news:MPG.1cd9641ac7ff34569898d7@.msnews.microsoft.com...
> In article <uIVaoSsSFHA.2128@.TK2MSFTNGP14.phx.gbl>, guzmanda@.nospam-
> online.sbcglobal.net says...
> Thanks. The above SELECT statement returns 0 on my database which I
> assume indicates that quoted_identifier is OFF. But can you explain
> what you mean when you say 'connection settings take precedence'? Are
> 'connection settings' something different from the DATABASE setting
> returned by this SELECT statement? I am accessing SQLServer through my
> application using OLEDB. Thanks much for your help.|||Ah... So you're saying both a SET command *and* the API will set the
connection properties *for the session*, as opposed to the database
setting. And that even if the database setting for quoted_identifier is
OFF, the OLEDB interface sets it ON for any session in which it's used.
Is that right?
In article <OWknqczSFHA.2872@.TK2MSFTNGP14.phx.gbl>,
tibor_please.no.email_karaszi@.hotmail.nomail.com says...
> Check out the SET command. For some database options, you have the same be
havior exposed through a
> SET command. A setting though a SET command applies to a connection ("sess
ion"). Some API's will set
> some SET commands for you. And I believe that both ODBC and OLEDB will set
the quoted_identifier
> setting, making the database option useless for those API's.
>|||Yes, The API's actually executes a SET command for you (or at least to the s
ame effect).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rick Charnes" <rickxyz--nospam.zyxcharnes@.thehartford.com> wrote in message
news:MPG.1cd984b62c37b7169898d8@.msnews.microsoft.com...
> Ah... So you're saying both a SET command *and* the API will set the
> connection properties *for the session*, as opposed to the database
> setting. And that even if the database setting for quoted_identifier is
> OFF, the OLEDB interface sets it ON for any session in which it's used.
> Is that right?
> In article <OWknqczSFHA.2872@.TK2MSFTNGP14.phx.gbl>,
> tibor_please.no.email_karaszi@.hotmail.nomail.com says...

Friday, March 9, 2012

Quick question: how do I get the name of the current database?

Is there an sp_zzzzzz function to return the name of the current database?
I would like to use this name as a variable in a stored procedure in order
to create names for further databases (by appending a tag, such as
MYDATABASE_BLOB001, ..._BLOB002 etc.

Thanks.SELECT DB_NAME()

Why create a database from a Stored Procedure?
--
David Portas
SQL Server MVP
--|||"Robin Tucker" <idontwanttobespammedanymore@.reallyidont.com> wrote in
message news:ct5isn$9m3$1$8302bc10@.news.demon.co.uk...
> Is there an sp_zzzzzz function to return the name of the current database?
> I would like to use this name as a variable in a stored procedure in order
> to create names for further databases (by appending a tag, such as
> MYDATABASE_BLOB001, ..._BLOB002 etc.
>
> Thanks.

select db_name()

It might be worth considering why you need multiple databases - could
BLOB001 be part of a key in a table instead? This discussion applies to
tables, not databases, but the principle is exactly the same:

http://www.sommarskog.se/dynamic_sql.html#Sales_yymm

Simon|||The issue is that we have one database with our adjacency list in and then
one or more with our media blobs in. Our users won't be using full SQL
server, so we have 2Gb limit on MSDE. When one of the blob databases
reaches close to 2Gb, we rollover to the next blob database. In my
adjacency table I store the blob database ID and Key for the blob associated
with each node. I also have a table with all of the blob databases listed,
so I can lookup and find which database the ID refers to.

Can't help it. Customers are cheapskates ;)

"Simon Hayes" <sql@.hayes.ch> wrote in message
news:41f65413$1_3@.news.bluewin.ch...
> "Robin Tucker" <idontwanttobespammedanymore@.reallyidont.com> wrote in
> message news:ct5isn$9m3$1$8302bc10@.news.demon.co.uk...
>> Is there an sp_zzzzzz function to return the name of the current
>> database? I would like to use this name as a variable in a stored
>> procedure in order to create names for further databases (by appending a
>> tag, such as MYDATABASE_BLOB001, ..._BLOB002 etc.
>>
>>
>> Thanks.
>>
>>
>>
> select db_name()
> It might be worth considering why you need multiple databases - could
> BLOB001 be part of a key in a table instead? This discussion applies to
> tables, not databases, but the principle is exactly the same:
> http://www.sommarskog.se/dynamic_sql.html#Sales_yymm
> Simon|||"Robin Tucker" <idontwanttobespammedanymore@.reallyidont.com> wrote in
message news:ct5l4s$ig$1$8300dec7@.news.demon.co.uk...
> The issue is that we have one database with our adjacency list in and then
> one or more with our media blobs in. Our users won't be using full SQL
> server, so we have 2Gb limit on MSDE. When one of the blob databases
> reaches close to 2Gb, we rollover to the next blob database. In my
> adjacency table I store the blob database ID and Key for the blob
associated
> with each node. I also have a table with all of the blob databases
listed,
> so I can lookup and find which database the ID refers to.
> Can't help it. Customers are cheapskates ;)

Something to be aware of: I think that MSDE may also limit you on the number
of databases you are allowed so there may be a limit on the number of times
you can "rollover" to another database.

Brian.

www.cryer.co.uk/brian

Saturday, February 25, 2012

queueing and submitting reports

i am just wondering if anybody knows of any third party software, or a
good way to implement the following using the webservice.
in our current reporting engine (inhouse designed)
users can select a report, select the parameters and submit it to be
run, when its complete it shows up in a sort of inbox, and then can
select one or more and click PRINT ..
i'm wanting to implement the same sort of workflow in reporting
services because reportmanager just doesn't have good workflow for such
circumstances.
any ideas, hints, systems out there that already do this would be
appreciated. whether rs 2000 or rs 2005
in implementing it manually i see a problem with the fact that the
'prequery' i.e getting parameters from lookups is done at the same time
that the reprot is run.. is there a way to intercept just the parameter
gathering GUI and gather the parameters from that (so that we can make
our own queueing and rendering via the webservice engine?)
Karlno ideas anybody?