Showing posts with label trouble. Show all posts
Showing posts with label trouble. Show all posts

Wednesday, March 28, 2012

new to ms sql having trouble with very basic commands

I'm more used to mysql, which i haven't coded for a while, but how do you show tables? or show databases you have available from the osql prompt?hello?|||Use the Information Schema

-- Show Tables
SELECT * FROM INFORMATION_SCHEMA.TABLES

besides the TABLES view of the Schema, there are many others

Here is a list of the views provided by SQL Server 2000

CHECK_CONSTRAINTS
Holds information about constraints in the database

COLUMN_DOMAIN_USAGE
Identifies which columns in which tables are user-defined datatypes

COLUMN_PRIVILEGES
Has one row for each column level permission granted to or by the current user

COLUMNS
Lists one row for each column in each table or view in the database

CONSTRAINT_COLUMN_USAGE
Lists one row for each column that has a constraint defined on it

CONSTRAINT_TABLE_USAGE
Lists one row for each table that has a constraint defined on it

DOMAIN_CONSTRAINTS
Lists the user-defined datatypes that have rules bound to them

DOMAINS
Lists the user-defined datatypes

KEY_COLUMN_USAGE
Lists one row for each column that's defined as a key

PARAMETERS
Lists one row for each parameter in a stored procedure or user-defined function

REFERENTIAL_CONSTRAINTS
Lists one row for each foreign constraint

ROUTINES
Lists one row for each stored procedure or user-defined function

ROUTINE_COLUMNS
Contains one row for each column returned by any table-valued functions

SCHEMATA
Contains one row for each database

TABLE_CONSTRAINTS
Lists one row for each constraint defined in the current database

TABLE_PRIVILEGES
Has one row for each table level permission granted to or by the current user

TABLES
Lists one row for each table or view in the current database

VIEW_COLUMN_USAGE
Lists one row for each column in a view including the base table of the column where possible

VIEW_TABLE_USAGE
Lists one row for each table used in a view

VIEWS
Lists one row for each view

-------------
You probably need to get hold of the SQL books online and the SQL tools; that will help quite a bit.|||thanks, thats been most helpful,

I'm going to bookmark this page :)

which sql tools are you reffering to?

Friday, March 23, 2012

New SQL Server User Questions

I have installed SQL Server 2005 Express. I am having trouble understanding
how to connect up with the AdventureWorksDB. Looking at the online book, I
found these instructions:
1) Open the command prompt on the server.
2) From the command prompt, connect to an instance of SQL Server by using
the following sqlcmd command:
sqlcmd -S Server\Instance
Where Server is the name of the computer and Instance is the name of the
instance.
These instructions assume you have some previous knowledge.
1) I am assuming that you are in the SQL Server Management Express Console.
2) How do you open the command prompt? Or where is it?
3) The "sqlcmd -S Server\Instance" instruction. I looked at the SQL Server
Service Manager and I believe I have the right information for my
installation: Server = NGT\SQLEXPRESS and Instance = SQL Server which came
from the Services:.
If this is not correct, what name do I use for the Server and Instance?
After I run this command, what will the results be and how will I know they
have run correctly?
I believe I can follow the remaining instructions if I can get past this part.
Thank you for your help.
Regards,
SailFL
You get a command prompt by going to Start->Run and typing CMD. From that,
you run SQLCMD. From what you have given us, try:
SQLCMD -S NGT\SQLEXPRESS
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"SailFL" <SailFL@.discussions.microsoft.com> wrote in message
news:28954F43-0CBC-42FC-B7BC-B14C3E67BC83@.microsoft.com...
I have installed SQL Server 2005 Express. I am having trouble understanding
how to connect up with the AdventureWorksDB. Looking at the online book, I
found these instructions:
1) Open the command prompt on the server.
2) From the command prompt, connect to an instance of SQL Server by using
the following sqlcmd command:
sqlcmd -S Server\Instance
Where Server is the name of the computer and Instance is the name of the
instance.
These instructions assume you have some previous knowledge.
1) I am assuming that you are in the SQL Server Management Express Console.
2) How do you open the command prompt? Or where is it?
3) The "sqlcmd -S Server\Instance" instruction. I looked at the SQL Server
Service Manager and I believe I have the right information for my
installation: Server = NGT\SQLEXPRESS and Instance = SQL Server which came
from the Services:.
If this is not correct, what name do I use for the Server and Instance?
After I run this command, what will the results be and how will I know they
have run correctly?
I believe I can follow the remaining instructions if I can get past this
part.
Thank you for your help.
Regards,
SailFL
|||SQLCMD can be issued from the commadn prompt of Windows, so
Start->Run->cmd
int he doscommand you can type in e.g.
sqlcmd.exe -S NGT\SQLEXPRESS -E
-Whereas NGT is the servername and SQLEXPRESS the instancename
-E if you are using Trusted authentication to connect to the database
server.
You can test the successfull connection therefore that you get no error
are issue a Select command to any table:
USE AdventureWorks
GO
SELECT * from Person.Contact
GO
--or simpler
SELECT 1
GO
HTH, jens Suessmeyer.
|||Thank both you for your assistance.
I was able to use the commands and to attach the AdventureWorks Database to
my SQL server.
SailFL
"Jens" wrote:

> SQLCMD can be issued from the commadn prompt of Windows, so
> Start->Run->cmd
> int he doscommand you can type in e.g.
> sqlcmd.exe -S NGT\SQLEXPRESS -E
> -Whereas NGT is the servername and SQLEXPRESS the instancename
> -E if you are using Trusted authentication to connect to the database
> server.
> You can test the successfull connection therefore that you get no error
> are issue a Select command to any table:
> USE AdventureWorks
> GO
> SELECT * from Person.Contact
> GO
> --or simpler
> SELECT 1
> GO
>
> HTH, jens Suessmeyer.
>

New SQL Server User Questions

I have installed SQL Server 2005 Express. I am having trouble understanding
how to connect up with the AdventureWorksDB. Looking at the online book, I
found these instructions:
1) Open the command prompt on the server.
2) From the command prompt, connect to an instance of SQL Server by using
the following sqlcmd command:
sqlcmd -S Server\Instance
Where Server is the name of the computer and Instance is the name of the
instance.
These instructions assume you have some previous knowledge.
1) I am assuming that you are in the SQL Server Management Express Console.
2) How do you open the command prompt? Or where is it?
3) The "sqlcmd -S Server\Instance" instruction. I looked at the SQL Server
Service Manager and I believe I have the right information for my
installation: Server = NGT\SQLEXPRESS and Instance = SQL Server which came
from the Services:.
If this is not correct, what name do I use for the Server and Instance?
After I run this command, what will the results be and how will I know they
have run correctly?
I believe I can follow the remaining instructions if I can get past this part.
Thank you for your help.
Regards,
--
SailFLYou get a command prompt by going to Start->Run and typing CMD. From that,
you run SQLCMD. From what you have given us, try:
SQLCMD -S NGT\SQLEXPRESS
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"SailFL" <SailFL@.discussions.microsoft.com> wrote in message
news:28954F43-0CBC-42FC-B7BC-B14C3E67BC83@.microsoft.com...
I have installed SQL Server 2005 Express. I am having trouble understanding
how to connect up with the AdventureWorksDB. Looking at the online book, I
found these instructions:
1) Open the command prompt on the server.
2) From the command prompt, connect to an instance of SQL Server by using
the following sqlcmd command:
sqlcmd -S Server\Instance
Where Server is the name of the computer and Instance is the name of the
instance.
These instructions assume you have some previous knowledge.
1) I am assuming that you are in the SQL Server Management Express Console.
2) How do you open the command prompt? Or where is it?
3) The "sqlcmd -S Server\Instance" instruction. I looked at the SQL Server
Service Manager and I believe I have the right information for my
installation: Server = NGT\SQLEXPRESS and Instance = SQL Server which came
from the Services:.
If this is not correct, what name do I use for the Server and Instance?
After I run this command, what will the results be and how will I know they
have run correctly?
I believe I can follow the remaining instructions if I can get past this
part.
Thank you for your help.
Regards,
SailFL|||SQLCMD can be issued from the commadn prompt of Windows, so
Start->Run->cmd
int he doscommand you can type in e.g.
sqlcmd.exe -S NGT\SQLEXPRESS -E
-Whereas NGT is the servername and SQLEXPRESS the instancename
-E if you are using Trusted authentication to connect to the database
server.
You can test the successfull connection therefore that you get no error
are issue a Select command to any table:
USE AdventureWorks
GO
SELECT * from Person.Contact
GO
--or simpler
SELECT 1
GO
HTH, jens Suessmeyer.|||Thank both you for your assistance.
I was able to use the commands and to attach the AdventureWorks Database to
my SQL server.
--
SailFL
"Jens" wrote:
> SQLCMD can be issued from the commadn prompt of Windows, so
> Start->Run->cmd
> int he doscommand you can type in e.g.
> sqlcmd.exe -S NGT\SQLEXPRESS -E
> -Whereas NGT is the servername and SQLEXPRESS the instancename
> -E if you are using Trusted authentication to connect to the database
> server.
> You can test the successfull connection therefore that you get no error
> are issue a Select command to any table:
> USE AdventureWorks
> GO
> SELECT * from Person.Contact
> GO
> --or simpler
> SELECT 1
> GO
>
> HTH, jens Suessmeyer.
>

New SQL Server User Questions

I have installed SQL Server 2005 Express. I am having trouble understanding
how to connect up with the AdventureWorksDB. Looking at the online book, I
found these instructions:
1) Open the command prompt on the server.
2) From the command prompt, connect to an instance of SQL Server by using
the following sqlcmd command:
sqlcmd -S Server\Instance
Where Server is the name of the computer and Instance is the name of the
instance.
These instructions assume you have some previous knowledge.
1) I am assuming that you are in the SQL Server Management Express Console.
2) How do you open the command prompt? Or where is it?
3) The "sqlcmd -S Server\Instance" instruction. I looked at the SQL Server
Service Manager and I believe I have the right information for my
installation: Server = NGT\SQLEXPRESS and Instance = SQL Server which came
from the Services:.
If this is not correct, what name do I use for the Server and Instance?
After I run this command, what will the results be and how will I know they
have run correctly?
I believe I can follow the remaining instructions if I can get past this par
t.
Thank you for your help.
Regards,
SailFLYou get a command prompt by going to Start->Run and typing CMD. From that,
you run SQLCMD. From what you have given us, try:
SQLCMD -S NGT\SQLEXPRESS
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"SailFL" <SailFL@.discussions.microsoft.com> wrote in message
news:28954F43-0CBC-42FC-B7BC-B14C3E67BC83@.microsoft.com...
I have installed SQL Server 2005 Express. I am having trouble understanding
how to connect up with the AdventureWorksDB. Looking at the online book, I
found these instructions:
1) Open the command prompt on the server.
2) From the command prompt, connect to an instance of SQL Server by using
the following sqlcmd command:
sqlcmd -S Server\Instance
Where Server is the name of the computer and Instance is the name of the
instance.
These instructions assume you have some previous knowledge.
1) I am assuming that you are in the SQL Server Management Express Console.
2) How do you open the command prompt? Or where is it?
3) The "sqlcmd -S Server\Instance" instruction. I looked at the SQL Server
Service Manager and I believe I have the right information for my
installation: Server = NGT\SQLEXPRESS and Instance = SQL Server which came
from the Services:.
If this is not correct, what name do I use for the Server and Instance?
After I run this command, what will the results be and how will I know they
have run correctly?
I believe I can follow the remaining instructions if I can get past this
part.
Thank you for your help.
Regards,
SailFL|||SQLCMD can be issued from the commadn prompt of Windows, so
Start->Run->cmd
int he doscommand you can type in e.g.
sqlcmd.exe -S NGT\SQLEXPRESS -E
-Whereas NGT is the servername and SQLEXPRESS the instancename
-E if you are using Trusted authentication to connect to the database
server.
You can test the successfull connection therefore that you get no error
are issue a Select command to any table:
USE AdventureWorks
GO
SELECT * from Person.Contact
GO
--or simpler
SELECT 1
GO
HTH, jens Suessmeyer.|||Thank both you for your assistance.
I was able to use the commands and to attach the AdventureWorks Database to
my SQL server.
SailFL
"Jens" wrote:

> SQLCMD can be issued from the commadn prompt of Windows, so
> Start->Run->cmd
> int he doscommand you can type in e.g.
> sqlcmd.exe -S NGT\SQLEXPRESS -E
> -Whereas NGT is the servername and SQLEXPRESS the instancename
> -E if you are using Trusted authentication to connect to the database
> server.
> You can test the successfull connection therefore that you get no error
> are issue a Select command to any table:
> USE AdventureWorks
> GO
> SELECT * from Person.Contact
> GO
> --or simpler
> SELECT 1
> GO
>
> HTH, jens Suessmeyer.
>