You are here: Re: The Curse of Dynamic SQL « MsSQL Server « IT news, forums, messages
Re: The Curse of Dynamic SQL

Posted by Erland Sommarskog on 06/18/05 00:34

NickName (dadada@rock.com) writes:
> Did you have a chance to run the script yourself? I just tried with a
> slight twist, that is, I first compare all the procs in two identical
> dbs and fetch the mismatched ones into a temp tbl, then loop them
> through a cursor, within the cursor I used your technique, got err
> "{the long command string} is not a valid identifier", btw,

Since you did not include the twist, and also insisted on not including
the complete error message, you cannot count for much help. But apparently
you used " where you should have used '. By default " delimites identifiers,
not string literals. (But in OSQL, it's actually different to confuse.)

However, I do spot an error in Josh's suggestion: he inserts into a
table variable. That does not fly with INSERT-EXEC. Must use temp table.

> BOL has no indication as to which OSQL param is mandatory and which ones
> are optional.

It has. If you look at the syntax grapgh you will see that no option
is mandatory, but that there are four options of which you must pick
one.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация