Viewing 15 posts - 91 through 105 (of 133 total)
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
...
August 4, 2010 at 1:42 pm
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...
August 4, 2010 at 12:43 pm
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...
August 4, 2010 at 12:28 pm
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...
July 27, 2010 at 1:14 pm
The RowNumber() approach looks nice.
Is that a Server 7 command? I'm having trouble with it.
July 26, 2010 at 11:12 am
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...
July 15, 2010 at 11:34 am
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...
July 8, 2010 at 7:49 am
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...
July 8, 2010 at 6:41 am
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...
July 8, 2010 at 6:32 am
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...
July 6, 2010 at 1:35 pm
This is great! Thank you for your help.
It even makes creating the SQL statement itself easier.
Thank you again.
May 26, 2010 at 7:18 am
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.
April 26, 2010 at 7:54 am
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...
April 12, 2010 at 6:23 am
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...
April 12, 2010 at 6:08 am
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...
April 8, 2010 at 6:30 am
Viewing 15 posts - 91 through 105 (of 133 total)