Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)

  • RE: Insert with id of inserted row

    Thanks.

    It is what I was looking for.

  • RE: Insert with id of inserted row

    Thanks LutzM for your reply. Just to make you happy I changed the greeting. Could you please illustrate the use of the output clause?

  • RE: Inserting into an associative table

    The following code worked for me.

    /* INSERTs companyid and industryid INTO INDUSTRYASS table */

    INSERT INTO IndustryAss(CompanyId, IndustryId)

    SELECT DISTINCT dbo.company.CompanyId, dbo.industry.IndustryId

    FROM Company, Industry, dbo.source

    WHERE dbo.source.company=dbo.Company.CompanyName and dbo.source.Industry=dbo.industry.IndustryName

    GO

  • RE: Inserting into an associative table

    Thanks guys it worked.

  • RE: Inserting into an associative table

    Hi Guys I have been writing the query to populate the associative entity:

    /* Inserts companyid and industryid into industryass table */

    INSERT INTO IndustryAss

    SELECT DISTINCT dbo.company.CompanyId, dbo.industry.IndustryId

    FROM Company, Industry, dbo.source

    WHERE dbo.source.company=dbo.Company.CompanyName...

  • RE: Inserting into an associative table

    Thanks for your responses. But I need to say that there is no companyid and industryid in the source for inserting. This (Ids) will come from the tables mentioned where...

  • RE: Update table with values from the same table

    Hi Chris I just tried the insert statement and modify the one that I previously had and It worked.

    Thanks for your help.

    Martin

  • RE: Update table with values from the same table

    Sorry Chris but I don't expect this result.

    "Also, INSERT statements to create data in both tables which will generate this result:

    CompanyName StreetNumber StreeName StreetType Suburb Postcode State

    123 Acc Brisbane 4000...

  • RE: Update table with values from the same table

    I don't understand what you mean.

    Please explain.

    Thanks

  • RE: Update table with values from the same table

    Hi Chris:

    -------------------------COMPANY TABLE------------------------------------------------------

    USE [VisitationDb]

    GO

    /****** Object: Table [dbo].[Company] Script Date: 04/21/2011 17:39:39 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE TABLE [dbo].[Company](

    [CompanyId] [int] IDENTITY(0,1) NOT NULL,

    [CompanyName] [nvarchar](150) NULL,

    [Website] [nvarchar](200) NULL,

    [IndustryId]...

  • RE: EXCEL TO SQL EXPRESS 2008 R2

    Hi LutzM:

    This makes sense. I am going to try it in the afternoon and post back the results. Thanks for that.

  • RE: Excel to SQL maintaining relationships

    Ok I found what makes a unique record, but now how I am going to be able to update the foreign keys so that they match with the other table?...

  • RE: Excel to SQL maintaining relationships

    I am not sure about what you are proposing. The insert works in the first table but how can I insert into the second while maintaining the relationship. I need...

Viewing 13 posts - 1 through 13 (of 13 total)