Forum Replies Created

Viewing 15 posts - 1 through 15 (of 26 total)

  • RE: Error with stuff function; its cutting of my commands.

    Thanks for some reason I thought stuff was similar to concatenate, but I I looked it up and I see what you are saying.

  • RE: Error with stuff function; its cutting of my commands.

    Well on the forum, they suggested to use stuff. I will look at the link you provided. If I have any questions I will post back.

  • RE: Need help with dynamic sql query

    I know right Lange helped me every step of the way.thanks for the tip about the log file will have to ask my boss if he wants that.

    A big...

  • RE: Need help with dynamic sql query

    Lange I got it.....I got it....here is the final....

    declare @SQL varchar(max)

    --First is the updates

    select @SQL = stuff ((

    select

    'Update dbo.' +

    case

    when ERRORMESSAGE LIKE 'ED%' then 'Education'

    when ERRORMESSAGE...

  • RE: Need help with dynamic sql query

    Okay this is what I have done. An update of everything. I am still not able see the entirety of the command it cuts off the screen.

    declare @SQL varchar(max)

    --First is...

  • RE: Need help with dynamic sql query

    Thanks, I know right. Sigh.....Okay, I have to bother you one more time.

    It outputs this:

    [p]

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Update dbo.Education set ED_THREE = '1' where zBarcode = 15394 and PERSON_NUMBER = 3;Update dbo.Education...

  • RE: Need help with dynamic sql query

    declare @SQL varchar(max)

    --First is the updates

    select @SQL = stuff ((

    select

    'Update dbo.' +

    case

    when ERRORMESSAGE LIKE 'ED*' then 'Education'

    when ERRORMESSAGE LIKE 'O14*' then 'FOURTEEN_ALL'

    when ERRORMESSAGE LIKE 'HL*' then...

  • RE: Need help with dynamic sql query

    Yup its just inserting a new row. I can't change the structure of the tables because I don't have the 'authority' to do so. I am just to implement the...

  • RE: Need help with dynamic sql query

    Quick question how do I print the statements being executed I used

    print @sql but it didnt output anything

    Also could you explain that xml coding at the bottom.

  • RE: Need help with dynamic sql query

    Thanks, I think I could to the inserts.

    The same logic applies basically and insert the corresponding data that is necessary.

    Thanks for your help

  • RE: Need help with dynamic sql query

    Yes you are right. I had to generate some sample data. It took longer than I anticipated. But I have just posted it before this post.

  • RE: Need help with dynamic sql query

    INSERT INTO [janinetestdata].[dbo].[TEST]

    ([ERRORMESSAGE]

    ,[BATCH_NO]

    ...

  • RE: Need help with dynamic sql query

    INSERT INTO [janinetestdata].[dbo].[EDUCATION] VALUES(2,3,4,6,2,4398)

    INSERT INTO [janinetestdata].[dbo].[EDUCATION] VALUES(2,3,7,5,3,4237)

    INSERT INTO [janinetestdata].[dbo].[EDUCATION] VALUES(5,3,4,6,2,4385)

    INSERT INTO [janinetestdata].[dbo].[EDUCATION] VALUES(2,6,9,3,5,467)

    INSERT INTO [janinetestdata].[dbo].[HH_ALL] VALUES(76544 , 2 , 7 , 25227 , 5 , 6 , 7 , 5...

  • RE: Need help with dynamic sql query

    Typically running about 5000 rows.

    I will send sample data in 2mins.

  • RE: Need help with dynamic sql query

    Okay I will simplify my steps:

    The TEST ddl is the data that has commands that specify changes to the tables.

    My objective is to do those specified commands which can either...

Viewing 15 posts - 1 through 15 (of 26 total)