Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 980695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:25:31+00:00 2026-05-16T04:25:31+00:00

Here is the SQL: CREATE TABLE dbo.TmpFeesToRules1(Name varchar, LookupId int) INSERT INTO dbo.TmpFeesToRules1(Name, LookupId)

  • 0

Here is the SQL:

CREATE TABLE dbo.TmpFeesToRules1(Name varchar, LookupId int)

INSERT INTO dbo.TmpFeesToRules1(Name, LookupId)
SELECT DISTINCT Name, 0 FROM Lending.Fee
UNION SELECT DISTINCT Name, 0 FROM Lending.ApplicationFee

INSERT INTO dbo.tblLookup (LookupType, LookupCode, LookupDesc, EditFlag, DeletedFlag, DefaultFlag)
SELECT 'FEE_CODE', Name,  Name, 0, 0, 0
FROM dbo.TmpFeesToRules1

UPDATE dbo.TmpFeesToRules1
SET
    LookupId = L.LookupID
FROM
    dbo.tblLookup L
INNER JOIN dbo.TmpFeesToRules1 T ON T.Name = L.LookupDesc
WHERE
    L.LookupType = 'FEE_CODE'

CREATE TABLE dbo.TmpFeesToRules2(FeeId int, Name varchar)

INSERT INTO dbo.TmpFeesToRules2(FeeId, Name)
SELECT FeeId, Name FROM Lending.ApplicationFee

GO

UPDATE Lending.ApplicationFee 
SET Lending.ApplicationFee.FeeTypeId = T.LookupId
FROM dbo.TmpFeesToRules2 TT
INNER JOIN dbo.TmpFeesToRules1 T ON T.Name = TT.Name
WHERE Lending.ApplicationFee.FeeId = TT.FeeId

DROP TABLE dbo.TmpFeesToRules1
DROP TABLE dbo.TmpFeesToRules2

Here is the error:

Invalid object name ‘dbo.TmpFeesToRules2’.
Execute failed, return code: 1

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:25:32+00:00Added an answer on May 16, 2026 at 4:25 am

    Nothing to do with Go or semicolons,

    You are updating Lending.ApplicationFee but it doesn’t appear in the FROM clause.

    UPDATE Lending.ApplicationFee 
    SET Lending.ApplicationFee.FeeTypeId = T.LookupId
    FROM dbo.TmpFeesToRules2 TT
    INNER JOIN dbo.TmpFeesToRules1 T ON T.Name = TT.Name
    WHERE Lending.ApplicationFee.FeeId = TT.FeeId
    

    I guess this should be something like

    UPDATE Lending.ApplicationFee 
    SET Lending.ApplicationFee.FeeTypeId = T.LookupId
    FROM Lending.ApplicationFee join dbo.TmpFeesToRules2 TT ON <Some Condition>
    INNER JOIN dbo.TmpFeesToRules1 T ON T.Name = TT.Name
    WHERE Lending.ApplicationFee.FeeId = TT.FeeId
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So here's the setup. I have two tables: CREATE TABLE dbo.TmpFeesToRules1(Name varchar, LookupId int)
Here is my sql: CREATE TABLE companyprinciple { userid INT, FOREIGN KEY (userid) REFERENCES
Here is my SQL script CREATE TABLE tracks( track_id int NOT NULL AUTO_INCREMENT, account_id
I'm trying to create a table type in sql server 2005. Here is what
I'm still a learning user of SQL-SERVER2005. Here is my table structure CREATE TABLE
I'm trying to use an SQL insert statement to migrate rows from a table
Imagine a database table that looks like this: create table [dbo].[user] ( id int
CREATE TABLE [dbo].[MembershipModule]( [Id] [uniqueidentifier] ROWGUIDCOL NOT NULL, [ParentId] [uniqueidentifier] NULL, [TargetId] [int] NULL,
Here's our current table CREATE TABLE Visitor ( VisitorID bigint, DayPhone varchar(50), NightPhone varchar(50)
Here's the generated script from SSMS Script Table as->Create To: USE [DADatabaseMarch11] GO SET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.