Statement to get complete table ? In SQL Server?

In SQL Server, I am trying to get the rows from the two tables where first table is master table and second is child table. like I have a table which contain file extensions with id, and description of extension. second table is having employees who having extension ids from Master table. now i want to get the total master table and if i place where condition for particular employee his extensionid and description.

When I write left outer join it is getting only that particular employee extension details, my sql statement like this:

select * from Tbl_File_Extn_M FEM left outer join Tbl_File_Extn_EmpLink_M FEEM on FEM.ExtId = FEEM.ExtId where FEEM.EmpID = '004135'

Result is giving only one row, but I need the complete master table and particular employee details can you help me.

-------------Problems Reply------------

how about

select *
from Tbl_File_Extn_M FEM
left outer join Tbl_File_Extn_EmpLink_M FEEM on FEM.ExtId = FEEM.ExtId AND FEEM.EmpID = '004135'

Category:sql server 2008 Views:0 Time:2012-02-01

Related post

  • What is the best way to partition large tables in SQL Server? 2008-10-03

    In a recent project the "lead" developer designed a database schema where "larger" tables would be split across two separate databases with a view on the main database which would union the two separate database-tables together. The main database is

  • How to programmatically create MS Access table in SQL Server using SSIS? 2009-06-12

    I receive monthly data updates for a SQL databse shipped to me in an ACCESS database, there are about 30 tables that follow this pattern the largest table contains approximately 40,000 rows. CREATE TABLE [dbo].[TABLE_NAME_HERE] ( [title] nvarchar (25

  • How do I create a table in SQL Server 2005? 2009-09-11

    I want to create a table called quiz_mailing_list in my database in SQL Server 2005. With Fields: id auto-increment primary key email varchar(256) optIn tinyint referringEmail varchar(256) Here is what I tried: CREATE TABLE quiz_mailing_list( id int

  • Local and global temporary tables in SQL Server 2010-05-27

    What is the difference between local and global temporary tables in SQL Server? --------------Solutions------------- I find this explanation quite clear (it's pure copy from Technet): There are two types of temporary tables: local and global. Local t

  • Dimensions and fact tables using SQL Server 2008 2010-12-07

    I'm supposed to create a dimension and fact tables with SQL Server 2008 using TSQL, but I got the following error message : Unknown object type 'DIMENSION' used in a CREATE, DROP, or ALTER statement.and my code is : CREATE DIMENSION dim_date LEVEL jo

  • copy large table from sql server to odbc linked database (postgresql) in ssms 2014-03-12

    I'm trying to copy created a whole database in SQL Server to Postgres. I've been trying to write a script that can run in ssms with a postgres instance set up as a linked server. This will not be a one off operation. I've managed to create a script t

  • How do I create a sql dependency ona table in sql server 2000 and asp.net 2.0? 2008-09-18

    I need to create a sql dependency on a table in sql server 2000 in my asp.net 2.0 pages. What are the required actions and what is the best way? --------------Solutions------------- Microsoft has a great tutorial on this which basically explains that

  • Add a column, with a default value, to an existing table in SQL Server 2008-09-18

    How do you add a column, with a default value, to an existing table in SQL Server 2000/SQL Server 2005? --------------Solutions------------- ALTER TABLE {TABLENAME} ADD {COLUMNNAME} {TYPE} {NULL|NOT NULL} CONSTRAINT {CONSTRAINT_NAME} DEFAULT {DEFAULT

  • Maximum number of workable tables in SQL Server And MySQL 2009-03-04

    I know that in SQL Server, the maximum number of "objects" in a database is a little over 2 billion. Objects contains tables, views, stored procedures, indexes, among other things . I'm not at all worried about going beyond 2 billion objects. However

  • how to search data from a table in sql server 2009-04-24

    Dear All, can any one post any link/tutorial which will explain how to search data from a table in sql server ,like using some stored procedure...any example? In details: Lets say I have a table havinh columns ID,title,username description etc, so no

  • Partitioned tables in SQL Server 2005 - looking for real-world caveats 2009-07-02

    I'm currently benchmarking partitioned tables with SQL Server 2005 to compare them to using two tables (a "live" table and an "archive" table) for a processing queue. The partitioning's being performed on a bit column 'archive', so that when the arch

  • MS Access 2003 + linked tables to SQL Server 2005 + Windows Authentication = slow 2009-07-24

    Our MS Access application with linked tables to SQL Server 2005 is slow when using Windows Authentication from Windows XP clients. We've been running it successfully using SQL Server authentication, but now we want to move to Windows Authentication f

  • copy Ms access single Big Table to Sql server two small tables 2009-08-29

    I have single big table in Ms access 2k daabase and i need a way to copy this table and then populate my two already ready tables on sql server . I can use Migration tool but is there any way we can do it from Ms access like a form which executes the

  • How to use C# to add a column for a table of sql server? 2009-08-29

    How to use C# to add a column for a table of sql server? For example, I want to execute the following sql in C# code: alter table [Product] add [ProductId] int default 0 NOT NULL --------------Solutions------------- You should use a Command: using (D

  • How do I drop all foreign-key constraints on a table in Sql Server 2000? 2009-09-17

    How do I drop all foreign-key constraints on a table in SQL Server 2000 using T-SQL? --------------Solutions------------- If simply disabling constraints is an option here, you can use: ALTER TABLE myTable NOCHECK CONSTRAINT all then you can switch t

  • How to bulk insert into a table in sql server 2005 2009-09-18

    I have a storedproc which takes an ntext field where some records are passed. Suppose there is a table t as below. | ID | Name | Designation| -------------------------- | 1 | ABC | Team leader| | 2 | DEF | Developer | | 3 | XYZ | Manager | I am sendi

  • Calculate Hash or Checksum for a table in SQL Server 2009-10-13

    I'm trying to compute a checksum or a hash for an entire table in SQL Server 2008. The problem I'm running into is that the table contains an XML column datatype, which cannot be used by checksum and has to be converted to nvarchar first. So I need t

  • Can 2 update or insert triggers be created on the same table in SQL Server 2008? 2009-11-04

    Can 2 update or insert triggers be created on the same table in SQL Server 2008? --------------Solutions------------- Yes you can create multiple triggers on the same table. You can also specify which is the first and the last trigger to execute. Rea

  • Export tables from SQL Server to be imported to Oracle 10g 2009-11-13

    I'm trying to export some tables from SQL Server 2005 and then create those tables and populate them in Oracle. I have about 10 tables, varying from 4 columns up to 25. I'm not using any constraints/keys so this should be reasonably straight forward.

  • How I could assign a preset set of string values to a field of table in SQL Server 2008? 2009-12-28

    I want a field in a table of SQL Server 2008 to contain a preset number of string values for user to be able then to select one value from a dropdown listbox in my WPF front-end app. Is it possible only through assigning a numeric int type in a SQL S

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.184 (s). 11 q(s)