Find Jobs
Hire Freelancers

SQL Insert into a Table

$10-30 USD

Closed
Posted 7 months ago

$10-30 USD

Paid on delivery
NOTE: The #JobIDList temp table actually contains about 67,790 records which is the same amount of records i need to insert into the HS_JOB table and since it won't fit the description box i decided to reduce the amount of values. The issue is that whenever i run this with Rollback i noticed 28 records are not being accounted for, can someone help tune this query to make sure it inserts everything i need: if object_id('tempdb..#GroupList') is not null       drop table #GroupList; create table #GroupList ( RowNum int identity , GROUP_ID int ) if object_id('tempdb..#JobIDList') is not null       drop table #JobIDList; create table #JobIDList ( RowNum int identity , JOB_ID int ) if object_id('tempdb..#JobList') is not null       drop table #JobList; create table #JobList ( JOB_NAME varchar (64), EXT_REF int, SHORT_NAME varchar (4), PAY_RATE smallmoney ) if object_id('tempdb..#GroupJobList') is not null       drop table #GroupJobList; create table #GroupJobList ( RowNum int identity , GROUP_ID int, JOB_NAME varchar (64), EXT_REF int, SHORT_NAME varchar (4), PAY_RATE smallmoney ) insert into #GroupList (GROUP_ID) select distinct GROUP_ID from Inf.Organization_Detail_Denorm where COMPANY_XR = 263043       and GROUP_ID not in (281001535) set @GroupCount = (select count(*)                          from #GroupList) insert into #JobList (JOB_NAME, EXT_REF, SHORT_NAME, PAY_RATE) values ('Back Of House','BOH - Primary 1','-1','BOH1','0'), ('Back Of House','BOH - Primary 2','-1','BOH2','0'), ('Back Of House','BOH - Primary 3','-1','BOH3','0'), ('Back Of House','BOH - Primary 4','-1','BOH4','0'), ('Back Of House','BOH - Primary 5','-1','BOH5','0'), ('Back Of House','BOH - Secondary 1','-1','BOHS','0'), ('Back Of House','BOH - Secondary 2','-1','BOHS','0'), ('Back Of House','BOH - Secondary 3','-1','BOHS','0'), ('Front Of House','Bagger 1','-1','BAG1','0'), ('Front Of House','Bagger 2','-1','BAG2','0'), ('Front Of House','Bagger 3','-1','BAG3','0'), ('Front Of House','Runner 1','-1','RUN1','0'), ('Front Of House','Runner 2','-1','RUN2','0'), ('Front Of House','Runner 3','-1','RUN3','0'), ('Front Of House','Upstream Order Taker','-1','UOT','0'), ('Front Of House','Register','-1','REG','0'), ('Front Of House','Outside Payment','-1','OP','0'), ('Front Of House','Drive-Thru Expeditor','-1','DTE','0'), ('Front Of House','Drive-Thru Stager','-1','DTS','0'), ('Front Of House','Drive-Thru Primary Drinks','-1','DTPD','0'), ('Front Of House','Drive-Thru Secondary Drinks','-1','DTSD','0'), ('Front Of House','Desserts','-1','DSRT','0'), ('Front Of House','Mobile Drinks','-1','MD','0'), ('Front Of House','Front Counter Stager','-1','FCS','0'), ('Front Of House','Front Counter Expeditor','-1','FCE','0'), ('Front Of House','Stuffer','-1','STF','0'), ('Front Of House','IPOS 1','-1','IPOS','0'), ('Front Of House','IPOS 2','-1','IPOS','0'), ('Front Of House','IPOS 3','-1','IPOS','0'), ('Front Of House','IPOS 4','-1','IPOS','0') insert into #GroupJobList (GROUP_ID, JOB_NAME, EXT_REF, SHORT_NAME, PAY_RATE) select g.GROUP_ID, j.JOB_NAME, j.EXT_REF, j.SHORT_NAME, j.PAY_RATE from #JobList j       cross join #GroupList g insert into #JobIDList (JOB_ID) values ('1089651792'), ('1089651793'), ('1089651794'), ('1089651795'), ('1089651796'), ('1089651797'), ('1089651798'), ('1089651799'), ('1089651800'), ('1089651801'), ('1089651802'), ('1089651803'), ('1089651804'), ('1089651805'), ('1089651806'), ('1089651807'), ('1089651808'), ('1089651809'), ('1089651810'), ('1089651811') -------------------------------------------------- raiserror('Insert into Front of House', 0, 1) with nowait;       insert into hs.HS_JOB (ID, ORG_ID, JOB_NAME, PAY_RATE, OT_TYPE, OT_VALUE, EXTERNAL_REF, SORT_ORDER, DISABLED, DEFAULT_SCHEDULE_ID, SHORT_NAME,                                      HSC_PAYRATE_EXCLUDE, IS_BLENDED, SHARED_REF, LAST_EDITED_BY, LAST_EDITED_DATE_TIME)       select i.JOB_ID, j.GROUP_ID, j.JOB_NAME, j.PAY_RATE, 1, 1.50, j.EXT_REF, 0, 0, [login to view URL], j.SHORT_NAME, 0, 0, null, null, null       from #GroupJobList j             join #JobIDList i                   on [login to view URL] = [login to view URL]             join hs.HS_ROLE r                   on j.GROUP_ID = r.ORG_ID       where r.ROLE_NAME = [login to view URL] and r.ROLE_NAME in ('Front of House') set @RowsAffected = @@rowcount raiserror('Updated %d FOH Rows', 0, 1, @RowsAffected) with nowait; -------------------------------------------------- raiserror('Insert into Back of House', 0, 1) with nowait;             insert into hs.HS_JOB (ID, ORG_ID, JOB_NAME, PAY_RATE, OT_TYPE, OT_VALUE, EXTERNAL_REF, SORT_ORDER, DISABLED, DEFAULT_SCHEDULE_ID, SHORT_NAME,                                      HSC_PAYRATE_EXCLUDE, IS_BLENDED, SHARED_REF, LAST_EDITED_BY, LAST_EDITED_DATE_TIME)       select i.JOB_ID, j.GROUP_ID, j.JOB_NAME, j.PAY_RATE, 1, 1.50, j.EXT_REF, 0, 0, [login to view URL], j.SHORT_NAME, 0, 0, null, null, null       from #GroupJobList j             join #JobIDList i                   on [login to view URL] = [login to view URL]             join hs.HS_ROLE r                   on j.GROUP_ID = r.ORG_ID       where r.ROLE_NAME = [login to view URL] and r.ROLE_NAME in ('Back of House') set @RowsAffected = @@rowcount raiserror('Updated %d BOH Rows', 0, 1, @RowsAffected) with nowait; rollback tran--commit
Project ID: 37401816

About the project

6 proposals
Remote project
Active 5 mos ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
6 freelancers are bidding on average $23 USD for this job
User Avatar
Hello there, I hope you are doing well. I am an experienced data engineer/ database administrator/ data analyst using ETL Tools/ SQL/ Reporting Tools (SSRS, Jasper Report, Power BI) for more than 10 years. I have read your project description and I am very interested in your project. I can help you to check and update your SQL query to insert data into table as your requirement. I can start right now and will provide you the top quality work for sure. Please contact me to discuss more about the detail. Regards,
$30 USD in 2 days
5.0 (14 reviews)
3.6
3.6
User Avatar
SQL expert. I can do it. As 9+ years experiences in these field. I can give good quality work. I have read the guidelines of your work.I believe that i can provide you the best quality works you are anticipating from this platform give me a chance to show you the best i can do at your service.
$30 USD in 1 day
4.6 (10 reviews)
3.6
3.6
User Avatar
I will be happy to work with you and i Believe i can help you achieve your goal, I am Currently a Backend Software Engineer for Almost 6 years, with good Experience working on MS-SQLServer And SingleStore also known as ( MemSql) a distribution of Mysql for BigData and clustered Servers, i have been working on Building ETL Processes, data modeling, query optimization, data analysis, data integration, and data visualization, During my Experience i have worked on building and maintaining some of the most business critical database Processes that can be very complex, and i believe i can use this experience to help resolve any database related issues Thanks, Regards;
$20 USD in 7 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi, I can assist you with this task. I am experienced in SQL coding, MySQL and AWS. I am a professional Data Engineer with a Bachelors degree in computer science and Applied Mathematics. I have 9 years of experience working with SQL.
$20 USD in 5 days
0.0 (0 reviews)
0.0
0.0
User Avatar
I am writing to propose my services as a SQL Server specialist for your upcoming project. With over 12 years of experience working with SQL Server databases, I am confident in my ability to provide you with high-quality and reliable solutions. I have extensive experience with SQL Server administration and management, including database design, performance tuning, and security. I am also proficient in T-SQL and can create complex queries and stored procedures to meet your specific needs. Additionally, I have experience working with various SQL Server-related technologies such as SSIS, SSRS, and SSAS. I am a proactive and dedicated professional who is committed to delivering projects on time and within budget. I am also a strong communicator and will work closely with your team to ensure that your requirements are met and that your project is completed to your satisfaction. Please let me know if you have any questions or if you would like to discuss this proposal further. I look forward to the opportunity to work with you.
$20 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi there, I'd like to express my interest in assisting with your query optimization project. I have extensive experience in SQL query optimization and can help ensure that all records are correctly inserted into the HS_JOB table. I understand the critical nature of your project and the importance of ensuring that all records are correctly inserted. My experience and expertise in query optimization will be instrumental in addressing this issue and improving the reliability of your database operations. Please let me know if you have any specific requirements or deadlines for this project. I'm ready to start working on the optimization immediately and resolve the issue you've encountered. Thank you for considering my proposal. Best regards, Michael
$20 USD in 2 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Eagle Mountain, United States
5.0
2
Payment method verified
Member since Dec 8, 2022

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759) & Freelancer Online India Private Limited (CIN U93000HR2011FTC043854)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.