Showing posts with label analyzer. Show all posts
Showing posts with label analyzer. Show all posts

Friday, February 24, 2012

Common Objects in Management Studio?

I recently started using the SQL Server Management Studio that comes with SQL
Server 2005 in place of SQL Query Analyzer that comes with SQL Server 2000.
In SQL Query Analyzer's Object Explorer there is a set of Common Objects
under all of the DataBase Objects. These were very handy for me when I would
forget the syntax for a certain Transact-SQL function. It is more convenient
than looking it up in Books Online.
I can't seem to find the equivalent of the Common Objects in SQL Server
Management Studio. Anyone know where they are?
Thanks,
- Chase
Chase (Chase@.discussions.microsoft.com) writes:
> In SQL Query Analyzer's Object Explorer there is a set of Common Objects
> under all of the DataBase Objects. These were very handy for me when I
> would forget the syntax for a certain Transact-SQL function. It is more
> convenient than looking it up in Books Online.
> I can't seem to find the equivalent of the Common Objects in SQL Server
> Management Studio. Anyone know where they are?
Welcome to Management Studio! You will find that there is a lot of
functionality in Query Analyzer and Enterprise Manager that was not
brought over to Mgmt Studio. No, please don't ask me why! All I can suggest
is go to http://lab.msdn.microsoft.com/ProductFeedback/ and post a
suggestion for it to come back.
(I will have to admit that this is a feature of Query Analyzer that I
was not aware of myself.)
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
|||A lot of that functionality can be replaced by templates that you can add
yourself. Open Template Explorer and right-click on the top node, select New
> Template.
Also, if you are just looking for a quick syntax help, you should check
Dynamic Help window. To open it click Help > Dynamic Help menu option. Once
the window opens, you can dock it somewhere in the Management Studio shell.
As you type in an editor, you will see links to help topics that relate to
what you just typed, including syntax help for T-SQL.
Hope that helps.
Regards,
Maciek Sarnowicz
SQL Server SDE
This posting is provided "AS IS" with no warranties, and confers no rights
"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns9741F0113F282Yazorman@.127.0.0.1...
> Chase (Chase@.discussions.microsoft.com) writes:
> Welcome to Management Studio! You will find that there is a lot of
> functionality in Query Analyzer and Enterprise Manager that was not
> brought over to Mgmt Studio. No, please don't ask me why! All I can
> suggest
> is go to http://lab.msdn.microsoft.com/ProductFeedback/ and post a
> suggestion for it to come back.
> (I will have to admit that this is a feature of Query Analyzer that I
> was not aware of myself.)
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pro...ads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinf...ons/books.mspx

Tuesday, February 14, 2012

Command to export data from sql server to text file in sql query analyzer

Hi,
Does anyone know how to export a query to a text file by using query
analyzer with command, i dun want to manual click it.
Thanks a lot!
regards,
florenceleeDo you mean save the results to a file? If so, you can set the output of
the query to go to Text, Grid or File from the Query pull-down menu. If you
don't even want to do that then you could use osql.exe rather than Query
Analyzer. The -o parameter allows you to specify an output file to which
you'd like the query results to go.
Cheers,
Mike
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:uQMYVup0EHA.2572@.tk2msftngp13.phx.gbl...
> Hi,
> Does anyone know how to export a query to a text file by using query
> analyzer with command, i dun want to manual click it.
>
> --
> Thanks a lot!
> regards,
> florencelee
>|||Hi,
I understand by using osql, can use sql quey analyzer and i dun want
to output to text file and save manually, i just want a command which can
behave in the same way as in osql but i need to do in query analyzer'
Thanks a lot!
regards,
florencelee
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:uQMYVup0EHA.2572@.tk2msftngp13.phx.gbl...
> Hi,
> Does anyone know how to export a query to a text file by using query
> analyzer with command, i dun want to manual click it.
>
> --
> Thanks a lot!
> regards,
> florencelee
>|||There's not a TSQL command for that. Most of us who need to do this in TSQL
use xp_cmdshell and
OSQL.EXE.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:%23CjGX9r0EHA.1932@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I understand by using osql, can use sql quey analyzer and i dun want
> to output to text file and save manually, i just want a command which can
> behave in the same way as in osql but i need to do in query analyzer'
> --
> Thanks a lot!
> regards,
> florencelee
> "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> news:uQMYVup0EHA.2572@.tk2msftngp13.phx.gbl...
>

Command to export data from sql server to text file in sql query analyzer

Hi,
Does anyone know how to export a query to a text file by using query
analyzer with command, i dun want to manual click it.
Thanks a lot!
regards,
florencelee
Do you mean save the results to a file? If so, you can set the output of
the query to go to Text, Grid or File from the Query pull-down menu. If you
don't even want to do that then you could use osql.exe rather than Query
Analyzer. The -o parameter allows you to specify an output file to which
you'd like the query results to go.
Cheers,
Mike
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:uQMYVup0EHA.2572@.tk2msftngp13.phx.gbl...
> Hi,
> Does anyone know how to export a query to a text file by using query
> analyzer with command, i dun want to manual click it.
>
> --
> Thanks a lot!
> regards,
> florencelee
>
|||Hi,
I understand by using osql, can use sql quey analyzer and i dun want
to output to text file and save manually, i just want a command which can
behave in the same way as in osql but i need to do in query analyzer?
Thanks a lot!
regards,
florencelee
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:uQMYVup0EHA.2572@.tk2msftngp13.phx.gbl...
> Hi,
> Does anyone know how to export a query to a text file by using query
> analyzer with command, i dun want to manual click it.
>
> --
> Thanks a lot!
> regards,
> florencelee
>
|||There's not a TSQL command for that. Most of us who need to do this in TSQL use xp_cmdshell and
OSQL.EXE.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:%23CjGX9r0EHA.1932@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I understand by using osql, can use sql quey analyzer and i dun want
> to output to text file and save manually, i just want a command which can
> behave in the same way as in osql but i need to do in query analyzer?
> --
> Thanks a lot!
> regards,
> florencelee
> "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> news:uQMYVup0EHA.2572@.tk2msftngp13.phx.gbl...
>

Command to export data from sql server to text file in sql query analyzer

Hi,
Does anyone know how to export a query to a text file by using query
analyzer with command, i dun want to manual click it.
--
Thanks a lot!
regards,
florenceleeDo you mean save the results to a file? If so, you can set the output of
the query to go to Text, Grid or File from the Query pull-down menu. If you
don't even want to do that then you could use osql.exe rather than Query
Analyzer. The -o parameter allows you to specify an output file to which
you'd like the query results to go.
--
Cheers,
Mike
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:uQMYVup0EHA.2572@.tk2msftngp13.phx.gbl...
> Hi,
> Does anyone know how to export a query to a text file by using query
> analyzer with command, i dun want to manual click it.
>
> --
> Thanks a lot!
> regards,
> florencelee
>|||Hi,
I understand by using osql, can use sql quey analyzer and i dun want
to output to text file and save manually, i just want a command which can
behave in the same way as in osql but i need to do in query analyzer'
--
Thanks a lot!
regards,
florencelee
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:uQMYVup0EHA.2572@.tk2msftngp13.phx.gbl...
> Hi,
> Does anyone know how to export a query to a text file by using query
> analyzer with command, i dun want to manual click it.
>
> --
> Thanks a lot!
> regards,
> florencelee
>|||There's not a TSQL command for that. Most of us who need to do this in TSQL use xp_cmdshell and
OSQL.EXE.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:%23CjGX9r0EHA.1932@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I understand by using osql, can use sql quey analyzer and i dun want
> to output to text file and save manually, i just want a command which can
> behave in the same way as in osql but i need to do in query analyzer'
> --
> Thanks a lot!
> regards,
> florencelee
> "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> news:uQMYVup0EHA.2572@.tk2msftngp13.phx.gbl...
> > Hi,
> > Does anyone know how to export a query to a text file by using query
> > analyzer with command, i dun want to manual click it.
> >
> >
> > --
> > Thanks a lot!
> >
> > regards,
> >
> > florencelee
> >
> >
>|||Florencelee,
Press Ctrl-Shift-F in Query Analyzer.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Florencelee wrote:
> Hi,
> Does anyone know how to export a query to a text file by using query
> analyzer with command, i dun want to manual click it.
>
> --
> Thanks a lot!
> regards,
> florencelee
>|||You can use xp_cmdshell and BCP OUT ... This combination works great...
Thanks
GYK
"Tibor Karaszi" wrote:
> There's not a TSQL command for that. Most of us who need to do this in TSQL use xp_cmdshell and
> OSQL.EXE.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> news:%23CjGX9r0EHA.1932@.TK2MSFTNGP09.phx.gbl...
> > Hi,
> >
> > I understand by using osql, can use sql quey analyzer and i dun want
> > to output to text file and save manually, i just want a command which can
> > behave in the same way as in osql but i need to do in query analyzer'
> >
> > --
> > Thanks a lot!
> >
> > regards,
> >
> > florencelee
> > "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> > news:uQMYVup0EHA.2572@.tk2msftngp13.phx.gbl...
> > > Hi,
> > > Does anyone know how to export a query to a text file by using query
> > > analyzer with command, i dun want to manual click it.
> > >
> > >
> > > --
> > > Thanks a lot!
> > >
> > > regards,
> > >
> > > florencelee
> > >
> > >
> >
> >
>
>

Command Stack for Query Analyzer

Version 8.0
I am transitioning from Oracle and learning a new tool set and was surprised
to find there is no command stack in QA unless I am missing something. Is
there any way to quickly recall a past query from the query command line?
Thanks!
QA doesn't erase the commands that you execute. You can simply highlight
the one you want to execute and press F5.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
..
"Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
news:e%23ZgmOYWEHA.4032@.TK2MSFTNGP11.phx.gbl...
Version 8.0
I am transitioning from Oracle and learning a new tool set and was surprised
to find there is no command stack in QA unless I am missing something. Is
there any way to quickly recall a past query from the query command line?
Thanks!

Sunday, February 12, 2012

Command line parameter passing

Command line parameter passing
Does anyone know if it is possible to pass a parameter to a script run
from the isql (Query Analyzer).
I have a large .SQL file that does a setup of a database and I would
like to pass it a parameter that is
A name of another database to create some views to.
If its not possible from the command line, Is it possible to set an
environment variable and check that
variable inside the .sql script.
Any help would be appreciated.You can use the OSQL command-line utility and pass a parameter as part of a
the query / command string (-q switch).
Lookup the OSQL syntax in Books Online.
David Portas
SQL Server MVP
--|||Thanks for the response.
I have been trying something like this.
isql -H%GSHost% -S%GSServer% -d%GSDB% -U%GSUser% -P%GSPassWord% -n -q
"declare @.Odb varchar(40);set @.Odb=' test ';print @.Odb" -i GsViews.sql
in the GSViews.sql I do
print @.Odb
So when I do this the first print (from the -q) works but the one in the
GSViews.sql (run by the -i) errors out stating that @.Odb does not exist.
No GSViews.sql is quite long and it needs to know what other database
name. Any idea?
David Portas wrote:

> You can use the OSQL command-line utility and pass a parameter as part of
a
> the query / command string (-q switch).
> Lookup the OSQL syntax in Books Online.
>

command line

Using Query Analyzer, I can right click on an object and select "script
object to new window as create" and I get the text of the object's
definition (schema). Can I get same result from command line, i.e., from
osql, I can get text output for the definition of the object (something like
defncopy under Sybase)? If so, what is the command or store procedure name?

Thanks in advance.Unfortunately not. You can look at scptxfr.exe (it's installed with
MSSQL server - run it with /? to see the options), which is a
command-line tool used during an upgrade process. But it's not
documented, and it doesn't give you the same flexibility as the QA/EM
scripting fucntionality.

The best general solution is probably to write your own scripts using
the SQLDMO COM interface, which exposes .Script methods for all MSSQL
objects - the details are in Books Online. Or there are plenty of
third-party tools to do this as well.

Simon|||Hi Dav,

Take a look at this sample. I guess this helps you. It is really good.

http://www.databasejournal.com/feat...10894_3401081_1

Thank you
Raju