Re: Problem Transact-SQL Statement

From: Tom Moreau (tom_at_dont.spam.me.cips.ca)
Date: 01/06/05


Date: Thu, 6 Jan 2005 12:45:05 -0500

This is generating a bunch of sp_changeobjectowner statements - one for each
table - to change the object owner to do.

If you have embedded quote marks within a string, then double each quote
inside the string.

BTW, are you the same Allen Yu I worked with at 880 Bay in 1995 - 96?

-- 
   Tom
----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON   Canada
www.pinnaclepublishing.com
.
"Allen Yu" <allenyu@netvigator.com> wrote in message 
news:OHrRxAB9EHA.3944@TK2MSFTNGP12.phx.gbl...
I've come across a Transact-SQL statement as follows:
-- Statements start here
select 'EXECUTE sp_changeobjectowner ''' + name + ''', ''dbo''' from
sysobjects where type = 'U'
-- end here
Questions:
(1) How should the 'select' statement be interpreted?
(2) What are the rules for using the quotation marks: ''', '',,,  etc?
Thanks!
Allen


Relevant Pages

  • Re: Problem Transact-SQL Statement
    ... table - to change the object owner to do. ... If you have embedded quote marks within a string, ... Columnist, SQL Server Professional ...
    (microsoft.public.sqlserver.replication)
  • Re: Problem Transact-SQL Statement
    ... table - to change the object owner to do. ... If you have embedded quote marks within a string, ... Columnist, SQL Server Professional ...
    (microsoft.public.sqlserver.msde)
  • Re: Problem Transact-SQL Statement
    ... table - to change the object owner to do. ... If you have embedded quote marks within a string, ... Columnist, SQL Server Professional ...
    (microsoft.public.sqlserver.olap)
  • Re: Problem Transact-SQL Statement
    ... > table - to change the object owner to do. ... > If you have embedded quote marks within a string, ... > inside the string. ... > Columnist, SQL Server Professional ...
    (microsoft.public.sqlserver.replication)
  • Re: Problem Transact-SQL Statement
    ... > table - to change the object owner to do. ... > If you have embedded quote marks within a string, ... > inside the string. ... > Columnist, SQL Server Professional ...
    (microsoft.public.sqlserver.msde)