February 25, 2012 at 8:18 am
I have a SQL database name company and a table named users, what SQL command would I run to get a list of the contents of that table?
February 25, 2012 at 8:22 am
eba.seller (2/25/2012)
I have a SQL database name company and a table named users, what SQL command would I run to get a list of the contents of that table?
i may be having trouble reading your question, it seems like the most basic of SQL questions.
are you looking for something like this?:
SELECT * FROM Company.dbo.Users
--or
SELECT * FROM Company..Users
--Company is the database name
--dbo is the schema, leaving it out defaults to dbo
--Users is the table name.
Lowell
February 25, 2012 at 8:25 am
eba.seller (2/25/2012)
I have a SQL database name company and a table named users, what SQL command would I run to get a list of the contents of that table?
use company
SELECT * FROM table
Syntax:
USE <DatabaseName>
SELECT * FROM <TableName>
You can put a search over the internet (or at "http://social.msdn.microsoft.com" ) with phrase "Microsoft SQL Server"
February 25, 2012 at 12:17 pm
I'd suggest picking up a copy of Itzik Ben-Gan's excellent book, TSQL Query Fundamentals
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply