Forum Replies Created

Viewing 15 posts - 91 through 105 (of 133 total)

  • RE: How do you do RBAR - Record Sets

    How about this problem. I found this on MSDN and can easily adapt it to my table.

    DECLARE Employee_Cursor CURSOR FOR

    SELECT BusinessEntityID, JobTitle

    FROM AdventureWorks2008R2.HumanResources.Employee;

    OPEN Employee_Cursor;

    FETCH NEXT FROM Employee_Cursor;

    WHILE @@FETCH_STATUS = 0

    ...

  • RE: How do you do RBAR - Record Sets

    I apoligize for not being clear, I'm still new at this and I do appreciate your help. However I actually have used Updates, Updates with Where, Updates with Where...

  • RE: How do you do RBAR - Record Sets

    I use Update Where often. Sometimes with several Joins and Case (Select) as part of the Set. You're right these can get complicated and one I'm using right...

  • RE: Increment a field starting with the same number everytime.

    Yeah! Works great, thanks.

    Okay, another question.

    What if the table is like this?

    CREATE TABLE [dbo].[tbl_Temp](

    [strStatus] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

    [intCo] [int] NOT NULL,

    [intDiv] [int] NOT NULL,

    [intGroup] [int] NOT NULL,

    [intSeq] [int] NOT...

  • RE: Increment a field starting with the same number everytime.

    The RowNumber() approach looks nice.

    Is that a Server 7 command? I'm having trouble with it.

  • RE: Can you 'Select' from a stored procedure

    Wow, lots of great answers.

    First, for some reason I never thougth of using "execute" insteat of select. Brillant! Thanks, I'm still learning.

    Second, yeah, I used to put all...

  • RE: Is there a Do While loop?

    You did this on your phone?

    That's great! Thanks,

    However you are right.

    The main reason I was going with a loop is because I could not get the bulk insert to...

  • RE: Is there a Do While loop?

    I like the idea of Unions and have used them before, though I've never used them in inserts.

    I'll be testing these shortly; it really looks like a good idea and...

  • RE: Is there a Do While loop?

    Actually I read it.

    I thought I posted the table definition above though probably not well enough.

    No I didn't post sample data as I thought my question was more general nature.

    Thank...

  • RE: Is there a Do While loop?

    Great ideas but... there's always a but.

    I should have given more info. The individual unions for a single insert won't work because there may be multiple lines per user...

  • RE: Set a variable equal to an Execute?

    This is great! Thank you for your help.

    It even makes creating the SQL statement itself easier.

    Thank you again.

  • RE: Help with Join

    Thank you,

    Worked first try. I was simple after all. I did move the alias but never thought I needed a second one.

    I feel a little foolish.

    Thank you again.

  • RE: Query several SQL tables once.

    A question about these statements.

    INSERT INTO sqlTable (SQLCode, SQLDescription) VALUES ('A', 'Apple')

    INSERT INTO sqlTable (SQLCode, SQLDescription) VALUES ('B', 'Banana')

    INSERT INTO sqlTable (SQLCode, SQLDescription) VALUES ('C', 'Carrot')

    If I run this though...

  • RE: Query several SQL tables once.

    This is going to take me a while to figure out. I really appreciate your help. Like the previous post says this takes Access, or at least my...

  • RE: Query several SQL tables once.

    Your last option sounds great.

    However I (honestly) do not know how to have a stored procedure insert more than one record from an Access table. I may have hundreds...

Viewing 15 posts - 91 through 105 (of 133 total)