Showing posts with label friends. Show all posts
Showing posts with label friends. Show all posts

Sunday, March 11, 2012

Connecting to database for bulk insertion

HI friends,

I am retrieving oracle data(linked server) to my local sql server 2005. Initially I want to have duplicate copy of the oracle data to my local server. I have created linked server and inserting to my local table(exact replica). This will run for every 2 minutes(as per my client requirement) to get newly added records.

But, I want to retrieve specific columns from the replicated table and insert into other local tables. i have written a SP to do this. some columns are storing in other tables to maintain normalization. this should also run for every two minutes.

I have written a class (c#) to retrieve replica table and passing parameters to SP and inserting to my local tables in normalized form.

But this is taking 10 minutes to complete my process to insert 1500 records. but my client insist to reduce the speed to run for every 2 mins.

is it correct way wat i am doing? or any other solution is there?

pls suggest me.

thanks in advance

You have supplied very little technical info on exactly how you are accomplishing this task. Please elaborate.

I will tell you, though, if you are pulling a bunch of queried records out of the database into a c# collection and inserting them back into the database one at a time, you ARE going about it the wrong way. :)

You should be writing this code in T-SQL or SSIS, not C#.

You should definitely make use of insert statements that insert multiple records at a time. An example is: insert into some_table (col1,col2,col3) select col1a, col2a, col3a from another_table.

Wednesday, March 7, 2012

Connecting to a local instance from a remote computer

Greetings friends,

Not sure if this is the right place for my question but here goes anyway.

I have an instance of SQL Server 2005 installed on my DEV PC. A colleague of mine wants to access my server from his machine which connected to the same network.

I logged on to SSMS and added him as a new login.

Will he be able to connect to it now or do I have to do more than just that?

Your help would be appreciated.

You may have to enable remote connections in the Surface Area Configuration tool - Services and Connections.


HTH!

|||

Hi there,

Yes, I have already done that. Is there anything else I need to do?

Thanks in advance.

|||

From a SQL perspective, as long as SQL will accept the remote connections and the user has valid login and has access to the relevant database, then the user should be able to connect.

The only other thing to bear in mind would be any firewalls you have configured.


HTH!

|||I wish to add one more point friends,
if the port number is default 1433 the user can connect fine else specify the "server name, port number" in the SSMS while connecting !

Thanxx
Deepak
|||

Excellent point Deepak.

Confirm which port SQL is listening on in SQL Server Configuration Manager\Network Configuration.

HTH!

|||

Hi there,

Thanks guys. I will look out for these things.