Showing posts with label copy. Show all posts
Showing posts with label copy. Show all posts

Sunday, March 11, 2012

connecting to external DB

hi,
am working with my friend so we need to use the same DB ..how can i get him DB and insert it in mine to use it.
i 've try to copy it and paste in C:\Program Files\Microsoft SQL Server\MSSQL\Data then try to connect it by New connection bt it doesn't work
Note:am working n Web Matrix Project
Regards,You use the backup and restore wizard to backup the database and take the .bak file and put it in the Backup subfolder in the same Microsoft SQL Server folder and then go to Enterprise Manager and use the backup and restore wizard and use the restore from device option. BTW I think you can only delete from the Data subfolder and not add to it because that is where SQL Server stores the MDF and LDF data files. Post again if you need more help. Hope this helps.|||hello,
thank u very much for ur effort, but please can u explain how to Backup the Database with Extention .mdf .ldf
and there is no folder inside (Microsoft SQL Server) should i create it?
thanx for giving my Q ur valuable time,|||The database is not backed up with mdf and ldf files backup creates .bak file and it is found in this directory. You get mdf and ldf files when you execute a create database statement or you use Enterprise manager to create a database. The next step is you put the .bak file you created in the other computer in this directory and go to Enterprise manager and use the backup and restore wizard and choose the restore from device option. Run a search for backup and restore in the BOL (books online). Hope this helps.
C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP

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 Remote Server with SQL Management Studio Express

I installed a copy of SQL 2005 Express on another computer here using the
automatic download and install from Microsoft supported by the setup
toolkit.
I can't access this server from another machine on the LAN using SQL
Management Studio Express. I can 'see' the server but cannot connect. Both
machines are running XP, mine is trying to log in as 'Guest'.
Do I need to configure SQL 2005 on the remote machine to use mixed-mode
authentication and try to log in using an SQL password, or is there a way to
make a remote user work with Windows Authentication?
How should I go about this?
Thanks.
You will have to disable the simple filesharhing in XP, otherweise the
client will try to logon using the guest account.
Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||If you haven't done so yet - enable TCP/IP via the SQL Server Surface Area
Configuration tool / Remote Connections on the destination SQL Server. SQL
Server 2005 Express doesn't enable this by default. Also turn on the SQL
Browser service.
M a M
"Jens" wrote:

> You will have to disable the simple filesharhing in XP, otherweise the
> client will try to logon using the guest account.
>
> Jens K. Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
>
|||Thanks. I have done that but apparently have to enable mixed mode
authentication on the server in order to authenticate. How do I do this?
regards.
"M a M" <MaM@.discussions.microsoft.com> wrote in message
news:6045D19B-3B4F-4B27-B3CD-F82DD325E7DA@.microsoft.com...[vbcol=seagreen]
> If you haven't done so yet - enable TCP/IP via the SQL Server Surface Area
> Configuration tool / Remote Connections on the destination SQL Server. SQL
> Server 2005 Express doesn't enable this by default. Also turn on the SQL
> Browser service.
> M a M
> "Jens" wrote:
|||You could simply add the Windows NT account via the Security / Logins of the
Server in question. You have to log into the server locally obviously to make
this change. Either add the NT account or (your request) change the "Server
authentication" to SQL Server and Windows Authentication mode via the
Security tab of the SQL Server properties.
M a M
"Andrew Chalk" wrote:

> Thanks. I have done that but apparently have to enable mixed mode
> authentication on the server in order to authenticate. How do I do this?
> regards.
> "M a M" <MaM@.discussions.microsoft.com> wrote in message
> news:6045D19B-3B4F-4B27-B3CD-F82DD325E7DA@.microsoft.com...
>
>
|||> this change. Either add the NT account or (your request) change the
> "Server
> authentication" to SQL Server and Windows Authentication mode via the ...
How? This is XP with no SQL Management Studio Express. I have to connect
first before I can access the database with SQL MSE. That is the object of
this exercise.
Thanks.
"M a M" <MaM@.discussions.microsoft.com> wrote in message
news:96E18316-203F-46F1-A01D-FDEBE024CCBB@.microsoft.com...[vbcol=seagreen]
> You could simply add the Windows NT account via the Security / Logins of
> the
> Server in question. You have to log into the server locally obviously to
> make
> this change. Either add the NT account or (your request) change the
> "Server
> authentication" to SQL Server and Windows Authentication mode via the
> Security tab of the SQL Server properties.
> M a M
> "Andrew Chalk" wrote:
|||I loaded MSE on the remote machine and changed the logi mode to mixed. After
that, I was able to connect remotely with MSE.
So, my question boils down to this: How do I set the login mode of SQL
Server 2005 Express to mixed WITHOUT Manaagement Studio Express?
Thanks.
"M a M" <MaM@.discussions.microsoft.com> wrote in message
news:96E18316-203F-46F1-A01D-FDEBE024CCBB@.microsoft.com...[vbcol=seagreen]
> You could simply add the Windows NT account via the Security / Logins of
> the
> Server in question. You have to log into the server locally obviously to
> make
> this change. Either add the NT account or (your request) change the
> "Server
> authentication" to SQL Server and Windows Authentication mode via the
> Security tab of the SQL Server properties.
> M a M
> "Andrew Chalk" wrote:
|||HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL
Server\MSSQL.1\MSSQLServer change LoginMode from 1 to 2 and restart SQL
Server services.
"Andrew Chalk" wrote:

> I loaded MSE on the remote machine and changed the logi mode to mixed. After
> that, I was able to connect remotely with MSE.
> So, my question boils down to this: How do I set the login mode of SQL
> Server 2005 Express to mixed WITHOUT Manaagement Studio Express?
> Thanks.
> "M a M" <MaM@.discussions.microsoft.com> wrote in message
> news:96E18316-203F-46F1-A01D-FDEBE024CCBB@.microsoft.com...
>
>
|||Thanks!
"M a M" <MaM@.discussions.microsoft.com> wrote in message
news:6DBDB113-6DDE-4FAC-A09E-74FAAECAE75A@.microsoft.com...[vbcol=seagreen]
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL
> Server\MSSQL.1\MSSQLServer change LoginMode from 1 to 2 and restart SQL
> Server services.
> "Andrew Chalk" wrote:

Connecting to a Remote Server with SQL Management Studio Express

I installed a copy of SQL 2005 Express on another computer here using the
automatic download and install from Microsoft supported by the setup
toolkit.
I can't access this server from another machine on the LAN using SQL
Management Studio Express. I can 'see' the server but cannot connect. Both
machines are running XP, mine is trying to log in as 'Guest'.
Do I need to configure SQL 2005 on the remote machine to use mixed-mode
authentication and try to log in using an SQL password, or is there a way to
make a remote user work with Windows Authentication?
How should I go about this?
Thanks.You will have to disable the simple filesharhing in XP, otherweise the
client will try to logon using the guest account.
Jens K. Suessmeyer.
http://www.sqlserver2005.de
--

Saturday, February 25, 2012

connecting SQL Server with oracle forms 9i/10g

Could anyone please guide me in detail to connect Oracle Forms 9i/10g with MS SQL Server database?
To connect with Oracle Database, we need to copy and paste the tnsnames.ora file from the Oracle Database folder to the Oracle Forms folder.
But how do i connect with other databases like SQL Server, MS Access, and so on?
Thanks in advance.From SQL server To Oracle
You have the security folder, see :
Console ROOT -> MS SQL SERVER -> servergroup -> (local) - > security - > linked server(right click here to add new linked server)
here you can connect to Oracle

if you want to query the oracle trough Sql.serv you have to use and openquery

so say you have an person table in Oracle and in the linked server you've called the linked server OrcConn your sql will look like this

An SELECT example:
SELECT * FROM OPENQUERY (OrcConn,
'SELECT Id, Name , age
From Person
where Name like ''Richard'' and id = 12')

An update Update example:

Update OPENQUERY (OrcConn,
'SELECT Id, Name , age
From Person
where Name like ''Richard'' and id = 12')
SET age =34

For a JOIN from SQL.Person to ORACLE.Person you do:

SELECT *
FROM OPENQUERY (OrcConn,
'SELECT Id, Name , age
From Person
where id = 12') as ORCPERSON
LEFT JOIN Person ON ORCPERSON.id = Person.Id
WHERE Person.Deleted = false

This will be "a bit slow" because you'll first query the oracle to fetch person then get it to your local level and requery the result to inner join|||Thanks for the reply.

I'm afraid you've replied not for my question.

Inorder to connect the Oracle Forms Builder we need to connect to a database. So if we want to connect to a MS SQL Server database, what's the procedure to do it?

I think now my question is bit more specific.

Thanks.

From SQL server To Oracle
You have the security folder, see :
Console ROOT -> MS SQL SERVER -> servergroup -> (local) - > security - > linked server(right click here to add new linked server)
here you can connect to Oracle

if you want to query the oracle trough Sql.serv you have to use and openquery

so say you have an person table in Oracle and in the linked server you've called the linked server OrcConn your sql will look like this

An SELECT example:
SELECT * FROM OPENQUERY (OrcConn,
'SELECT Id, Name , age
From Person
where Name like ''Richard'' and id = 12')

An update Update example:

Update OPENQUERY (OrcConn,
'SELECT Id, Name , age
From Person
where Name like ''Richard'' and id = 12')
SET age =34

For a JOIN from SQL.Person to ORACLE.Person you do:

SELECT *
FROM OPENQUERY (OrcConn,
'SELECT Id, Name , age
From Person
where id = 12') as ORCPERSON
LEFT JOIN Person ON ORCPERSON.id = Person.Id
WHERE Person.Deleted = false

This will be "a bit slow" because you'll first query the oracle to fetch person then get it to your local level and requery the result to inner join

Friday, February 17, 2012

connecting analysis services to excel (client side)

Hi,

How is the configuration of connection for a client Excel pivot table connected to Analysis Services? Is there anyway in which when we copy the .xls with pivot table to client PC, it will automatically connect to Analysis Services?

thanks in advance.

cherrie

Cherrie,

Do you have analysis services database installed on each pc and want to connect allways locally? If so, then in connection string instead of specifying machine name, use localhost.

If this is not what you ask, could you please clarify your question. What do you mean automatically connect to Analysis Services?

Vidas Matelis

|||

Hi,

Let's say I have a server in which Analysis Services is located together with my SQL Server database. Since currently, SSAS resides in my local drive from which the local excel is also connected through setting it up in Data > Import External Data > New Database Query > OLAP Cubes and it's doing well. But I'm thinking if let's say I want users to access the SSAS cube from the server to their local Excel? How would I configure the connection?

Thanks!

cherrie

|||

Cherrie,

It looks like you are using Excel 2003. Steps for your users will be exactly the same. You go :

Data > Import External Data > New Database Query > OLAP Cubes > <New Data Source> > etc

Then you specify data source name, provider, click connect and specify "Analysis Server" name. This name could be name of your machine or SSAS Server.

Leave UserID & Password empty, then select database and you are done.

Vidas Matelis

|||

Vidas,

Can the connection be stored in the UDL instead or store the connection somewhere in the local drive of the user apart from the .xls file?

Cherrie