SQLTeam.com | Weblogs | Forums

INSERT INTO Table


#1

Hi

I have a table that I need to add in multiple numbers into one column. I have an insert statement setup, but I have only had to 1 PCS Number. Now I have about 80 to add. Is there a way to do this in one shot?

Here is my insert statement below that works out great.

insert into [ProviderFinder].[dbo].[ExcludedPCS] (ClientID ,PCS)
select 8,'12345678'

But I need something that can load in more than one at a time.
'10921876', '11009008','11444900', '11473236', '10922118', '11825240', '11241201', '11013032',

Any advice would be great, thanks in advance.

Wendy


#2

insert into [ProviderFinder].[dbo].[ExcludedPCS] (ClientID ,PCS)
values(8,'12345678'),(8, '10921876'), (8, '11009008'),(8, ...), ...


#3

You can use
Excel
Put all numbers into one column
Put insert statement in the topmost cell to the left
Then double click that cell
At the bottom right corner

Please let me know if you have
A place to share video recording

I will record video
That shows and give


#4

Hi Wendy

Is what I understood
Correct

Or what Scott pletcher understood correct

Just curious
:slightly_smiling_face::slightly_smiling_face:

There is a way
In SQL server management studio
Query window
Using search replace
And regular expression s
And replace beginning of
Line with insert


#5

Thanks so much to the both of you. What I was looking for is what Scott Pletcher posted. Thanks so much! :):slightly_smiling_face: