Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Gene Wirchenko Newsgroups: comp.databases.ms-sqlserver Subject: Re: How to Get Local Variables That Are Not So Local Date: Wed, 30 May 2012 09:56:57 -0700 Organization: A noiseless patient Spider Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="wKah3EH8kutwAOV6+9FiEQ"; logging-data="1846"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18cDwG84mo7oNfp5w0p1OjGKKUVUJpT+ns=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:UoWuFuc7JK7yOyZ0COsS/oMuh9M= Xref: csiph.com comp.databases.ms-sqlserver:1090 On Wed, 30 May 2012 07:20:08 +0000 (UTC), Erland Sommarskog wrote: >Gene Wirchenko (genew@ocis.net) writes: [snip] >> T-SQL does seem to be missing some of the oddest things. Is this >> another case of that, or is it that I just do not know about nonlocal >> variable declarations? > >T-SQL is a language to query and modify relational database. For this it is >a very powerful language. > >However, T-SQL is not a general-purpose language, and if you try to use it >for something it is not intended, you will have to accept the raw edges. I am using it to set up a database. I think that it is intended for that. It still is missing things that surprise me. I did solve my problem by creating/dropping a temporary table to create a kludgy but working flag. Script-level variables would be much easier. >If you want a smoother ride, move the administrative tasks to the client- >side language of your choice. I want something that I can use in SSMS. Anything else will be a rougher ride by just the fact of having to use more than one tool. Sincerely, Gene Wirchenko