Ask a Question related to Microsoft SQL / MS SQL Server, Design and Development.
-
Devron Blatchford #1
SET OPTIONS
Can someone tell me how I can tell what set options a procedure has, I am
looking for any procedure or view that has SET QUOTED_IDENTIFIER OFF OR SET
ANSI_NULLS OFF.
Thanks
Devron
Devron Blatchford Guest
-
DNS Options?
Am in the process of setting up a 2003 domain and understand that DNS is essential, any advice would be greatly appreciated. A future step will be... -
Help with options
Hi, I have a script that command options are taken and would like to know how print out the options when the options are missing from the command... -
What is an options key?
What is an options key & where is it? -
OS options for Sun PC
Hi all! I have these old Sun PC cards. (Not the latest version) I have never felt like installing any PC-software on my nice and clean... -
Options and creating a macro for options
I have a database that i use for work and have set up to have 10-12 option groups on one page. Normally I would "hit" the "Pass" option (the other... -
Tatiana S Baranova #2
Re: SET OPTIONS
Devron,
You can use something like this:
SELECT DISTINCT sysobjects.[name]
FROM
sysobjects JOIN syscomments ON sysobjects.[id] = syscomments.[id]
WHERE
syscomments.[text] LIKE '%SET QUOTED_IDENTIFIER OFF%' or
syscomments.[text] LIKE '%SET ANSI_NULLS OFF%'
---
Thanks,
Tatiana
"Devron Blatchford" <devron@auspine.com.au> wrote in message
news:e0wsE$RRDHA.3880@tk2msftngp13.phx.gbl...SET> Can someone tell me how I can tell what set options a procedure has, I am
> looking for any procedure or view that has SET QUOTED_IDENTIFIER OFF OR> ANSI_NULLS OFF.
>
>
> Thanks
> Devron
>
>
Tatiana S Baranova Guest
-
Tibor Karaszi #3
Re: SET OPTIONS
That will not help as these options are "sticky" options. The behavior is determined from when
you create the objects and trying to set the option inside the object has no effect.
To check how these options are set, use the OBJECTPROPERTY() function.
--
Tibor Karaszi, SQL Server MVP
Archive at: [url]http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver[/url]
"Tatiana S Baranova" <Tatiana.Baranova@arcadia.spb.ru> wrote in message
news:u8M2lOSRDHA.3144@tk2msftngp13.phx.gbl...> Devron,
>
> You can use something like this:
>
> SELECT DISTINCT sysobjects.[name]
> FROM
> sysobjects JOIN syscomments ON sysobjects.[id] = syscomments.[id]
> WHERE
> syscomments.[text] LIKE '%SET QUOTED_IDENTIFIER OFF%' or
> syscomments.[text] LIKE '%SET ANSI_NULLS OFF%'
>
> ---
> Thanks,
> Tatiana
>
> "Devron Blatchford" <devron@auspine.com.au> wrote in message
> news:e0wsE$RRDHA.3880@tk2msftngp13.phx.gbl...> SET> > Can someone tell me how I can tell what set options a procedure has, I am
> > looking for any procedure or view that has SET QUOTED_IDENTIFIER OFF OR>> > ANSI_NULLS OFF.
> >
> >
> > Thanks
> > Devron
> >
> >
>
Tibor Karaszi Guest
-
Erland Sommarskog #4
Re: SET OPTIONS
Devron Blatchford (devron@auspine.com.au) writes:
SELECT name> Can someone tell me how I can tell what set options a procedure has, I
> am looking for any procedure or view that has SET QUOTED_IDENTIFIER OFF
> OR SET ANSI_NULLS OFF.
FROM sysobjects
WHERE xtype IN ('P', 'V', 'TR', 'IF', 'FN', 'TF')
AND (objectproperty(id, 'IsAnsiNullsOn') = 0 OR
objectproperty(id, 'IsQuotedIdentOn') = 0)
I also included triggers and functions as they too can pose a problem
if they have incorrect settings.
--
Erland Sommarskog, SQL Server MVP, [email]sommar@algonet.se[/email]
Books Online for SQL Server SP3 at
[url]http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp[/url]
Erland Sommarskog Guest
-
Jacco Schalkwijk #5
Re: SET OPTIONS
SELECT 'Stored procedure', ROUTINE_NAME,
CASE WHEN OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME), 'ExecIsAnsiNullsOn')
=1 THEN 'ON' ELSE 'OFF' END AS ANSI_NULLS_STATUS ,
CASE WHEN OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME), 'ExecIsQuotedIdentOn')
=1 THEN 'ON' ELSE 'OFF' END AS QUOT_IDENT_STATUS
FROM INFORMATION_SCHEMA.ROUTINES
UNION ALL
SELECT 'View', TABLE_NAME,
CASE WHEN OBJECTPROPERTY(OBJECT_ID(TABLE_NAME), 'ExecIsAnsiNullsOn') =1
THEN 'ON' ELSE 'OFF' END AS ANSI_NULLS_STATUS,
CASE WHEN OBJECTPROPERTY(OBJECT_ID(TABLE_NAME), 'ExecIsQuotedIdentOn')
=1 THEN 'ON' ELSE 'OFF' END AS QUOT_IDENT_STATUS
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'View'
(OBJECT_ID('<procedure name>'), 'ExecIsQuotedIdentOn')
--
Jacco Schalkwijk MCDBA, MCSD, MCSE
Database Administrator
Eurostop Ltd.
"Devron Blatchford" <devron@auspine.com.au> wrote in message
news:e0wsE$RRDHA.3880@tk2msftngp13.phx.gbl...SET> Can someone tell me how I can tell what set options a procedure has, I am
> looking for any procedure or view that has SET QUOTED_IDENTIFIER OFF OR> ANSI_NULLS OFF.
>
>
> Thanks
> Devron
>
>
Jacco Schalkwijk Guest
-
Devron Blatchford #6
Re: SET OPTIONS
Ok, thanks for that. Now that I have identified the ones that are wrong what
is the best/fastest way to set them?
Thanks again
Devron.
"Jacco Schalkwijk" <NOSPAMjaccos@eurostop.co.uk> wrote in message
news:ehyr8bSRDHA.2188@TK2MSFTNGP10.phx.gbl...'ExecIsQuotedIdentOn')> SELECT 'Stored procedure', ROUTINE_NAME,
> CASE WHEN OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME), 'ExecIsAnsiNullsOn')
> =1 THEN 'ON' ELSE 'OFF' END AS ANSI_NULLS_STATUS ,
> CASE WHEN OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME),=1> =1 THEN 'ON' ELSE 'OFF' END AS QUOT_IDENT_STATUS
> FROM INFORMATION_SCHEMA.ROUTINES
> UNION ALL
> SELECT 'View', TABLE_NAME,
> CASE WHEN OBJECTPROPERTY(OBJECT_ID(TABLE_NAME), 'ExecIsAnsiNullsOn')am> THEN 'ON' ELSE 'OFF' END AS ANSI_NULLS_STATUS,
> CASE WHEN OBJECTPROPERTY(OBJECT_ID(TABLE_NAME), 'ExecIsQuotedIdentOn')
> =1 THEN 'ON' ELSE 'OFF' END AS QUOT_IDENT_STATUS
> FROM INFORMATION_SCHEMA.TABLES
> WHERE TABLE_TYPE = 'View'
> (OBJECT_ID('<procedure name>'), 'ExecIsQuotedIdentOn')
>
>
> --
> Jacco Schalkwijk MCDBA, MCSD, MCSE
> Database Administrator
> Eurostop Ltd.
>
>
> "Devron Blatchford" <devron@auspine.com.au> wrote in message
> news:e0wsE$RRDHA.3880@tk2msftngp13.phx.gbl...> > Can someone tell me how I can tell what set options a procedure has, I> SET> > looking for any procedure or view that has SET QUOTED_IDENTIFIER OFF OR>> > ANSI_NULLS OFF.
> >
> >
> > Thanks
> > Devron
> >
> >
>
Devron Blatchford Guest
-
Tibor Karaszi #7
Re: SET OPTIONS
Recreate them with the correct set options. You can get the source from sp_helptext, for
instance (just watch for the line wraps) or EM (copy and paste into QA).
--
Tibor Karaszi, SQL Server MVP
Archive at: [url]http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver[/url]
"Devron Blatchford" <devron@auspine.com.au> wrote in message
news:%23o4IAVaRDHA.2424@tk2msftngp13.phx.gbl...> Ok, thanks for that. Now that I have identified the ones that are wrong what
> is the best/fastest way to set them?
>
> Thanks again
> Devron.
>
> "Jacco Schalkwijk" <NOSPAMjaccos@eurostop.co.uk> wrote in message
> news:ehyr8bSRDHA.2188@TK2MSFTNGP10.phx.gbl...> 'ExecIsQuotedIdentOn')> > SELECT 'Stored procedure', ROUTINE_NAME,
> > CASE WHEN OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME), 'ExecIsAnsiNullsOn')
> > =1 THEN 'ON' ELSE 'OFF' END AS ANSI_NULLS_STATUS ,
> > CASE WHEN OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME),> =1> > =1 THEN 'ON' ELSE 'OFF' END AS QUOT_IDENT_STATUS
> > FROM INFORMATION_SCHEMA.ROUTINES
> > UNION ALL
> > SELECT 'View', TABLE_NAME,
> > CASE WHEN OBJECTPROPERTY(OBJECT_ID(TABLE_NAME), 'ExecIsAnsiNullsOn')> am> > THEN 'ON' ELSE 'OFF' END AS ANSI_NULLS_STATUS,
> > CASE WHEN OBJECTPROPERTY(OBJECT_ID(TABLE_NAME), 'ExecIsQuotedIdentOn')
> > =1 THEN 'ON' ELSE 'OFF' END AS QUOT_IDENT_STATUS
> > FROM INFORMATION_SCHEMA.TABLES
> > WHERE TABLE_TYPE = 'View'
> > (OBJECT_ID('<procedure name>'), 'ExecIsQuotedIdentOn')
> >
> >
> > --
> > Jacco Schalkwijk MCDBA, MCSD, MCSE
> > Database Administrator
> > Eurostop Ltd.
> >
> >
> > "Devron Blatchford" <devron@auspine.com.au> wrote in message
> > news:e0wsE$RRDHA.3880@tk2msftngp13.phx.gbl...> > > Can someone tell me how I can tell what set options a procedure has, I>> > SET> > > looking for any procedure or view that has SET QUOTED_IDENTIFIER OFF OR> >> > > ANSI_NULLS OFF.
> > >
> > >
> > > Thanks
> > > Devron
> > >
> > >
> >
>
Tibor Karaszi Guest



Reply With Quote

