Showing posts with label remote. Show all posts
Showing posts with label remote. Show all posts

Wednesday, March 7, 2012

Create local cube from remote AS server

Hello

I try the following:

I
1) connect to a remote server and browse its AS databases and cubes
2) display one cube in a OWC 10/11 pivottable (by setting .connectionstring and .datamember
3) try to create a local cube from this server database/cube using "CREATE GLOBAL CUBE...") giving a unc path as target

Steps 1 and 2 are successful (I use a named user in the format domain\username).

Step 3 gives an error: either a connection cannot be made to server ... or AS is not running on this computer

When I try this with my local AS, 1 to 3 works fine (assumed I use localhost and integrated security)

Questions:

1) Is there any rule for user accounts to be able to create local cubes?

2) I get an error (no. -1056899072) in the sql profiler when I try step 3, but do not know how to go any further. Is there any description for this error?

Regards
Klaus Wiesel

Try to make sure the path you specify in your command is valid path for remote Analysis Server.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Saturday, February 25, 2012

Create index before or after insert?

I have a number of remote sql servers from which I collect data. Said data i
s
inserted into #temp tables, such as for example:
CREATE TABLE dbo.#tmp
(
x int not null primary key
, y int not null
)
INSERT INTO dbo.#tmp (x, y)
SELECT x, y FROM server.db.dbo.table
For sync'ing this data with local tables it is adventageous to have an index
on y, x:
CREATE NONCLUSTERED INDEX IX_tmp
ON dbo.#tmp (y, x)
Does anyone see any reason to create that index before or after inserting
the records? I.e. is scenario (A) or (B) below better?
(A) 1. Create temp table; 2. Define index; 3. Insert records
(B) 1. Create temp table; 2. Insert records; 3. Create index
My gut tells me that it's a wash, and keeping the index definition with the
table (in code) is better for maintainability, but there's probably no
performance benefit either way. Or maybe there is a performance benefit to
one that I can't think of?
Comments?
Thanks - KenKH wrote:
> I have a number of remote sql servers from which I collect data. Said
> data is inserted into #temp tables, such as for example:
> CREATE TABLE dbo.#tmp
> (
> x int not null primary key
> , y int not null
> )
> INSERT INTO dbo.#tmp (x, y)
> SELECT x, y FROM server.db.dbo.table
> For sync'ing this data with local tables it is adventageous to have
Temp table usage in stored procedures can be a source of recompilation.
To avoid recompiles (which are costly), you should try to avoid
interleaving DML and DDL statements related to temp tables. Therefore,
you are better off defining all your temp tables up front and creating
indexes on them before inserting or otherwise manipulating data in the
tables.
David Gugick
Imceda Software
www.imceda.com|||If you are doing Bulk Insert of a large number of records at once...
Then drop and recreate the indices. I quote from Books OnLine, From the
Bulk Insert Entry.
"If nonclustered indexes are also present on the table, drop these before
copying data into the table. It is generally faster to bulk copy data into a
table without nonclustered indexes, and then to re-create the nonclustered
indexes, rather than bulk copy data into a table with the nonclustered
indexes in place."
The only exception is when you have a clustered Index on teh table, AND you
have the luxury of pre-sorting the data in in the same Order as they will be
in the Clusterd Index (Therefore Inserting the records in Clustered Index
Order). In THis special case, leave the CLustered Index on the table during
the Insert.
"David Gugick" wrote:

> KH wrote:
> Temp table usage in stored procedures can be a source of recompilation.
> To avoid recompiles (which are costly), you should try to avoid
> interleaving DML and DDL statements related to temp tables. Therefore,
> you are better off defining all your temp tables up front and creating
> indexes on them before inserting or otherwise manipulating data in the
> tables.
> --
> David Gugick
> Imceda Software
> www.imceda.com
>

Sunday, February 19, 2012

CREATE ENDPOINT to Expose a single DB instance

I have been looking at this statement for allowing access from a remote location to a specific database on my SQL Server (2005) from a client application.

Is it possible to do this using this method? I see lots of examples using this to expose Web Services of DB objects, however I need the client application to be able to authenticate to and access all objects in the database. If so, could some one provide a simple example of the arguments to use? For example, which protocol arguments are valid for this? I would like to use SQL Server Authentication. Is this possible?

Regards,

-Troy

I think the answer is to create a new instance of SQL Server on a non-standard port and move the DB to that instance. At least that is what I've chosen to do. If anyone knows of a better way, let me know.

create default tables, procedures, etc. on newly connected remote SQL server

I have a website I'm ready to test on the server it will call home. I just got connected to the remote SQL server that it will be using. As I've been creating the site, I've been using the default SQL Express set-up in Visual Studio. Is there a way to have Visual Studio create all those default tables, procedures, etc. OR is there a way to copy all of that stuff from the SQL Express running on my machine to the remote SQL Server 2005?

-Mathminded

There are many ways to move the database, but the best is Backup and Restore because it moves everything including permissions, you Backup the database locally and put the .bak file in the location below in the remote server and use the Backup and Restore wizard SQL Server will create the file path just make sure the path is correct don't try to create the path because SQL Server gets confused if you do. I have created a FAQ that covers all the ways to move a database, if you use another method remember to also move the permissions. Hope this helps.

C:\Program Files\Microsoft SQL Server\MSSQL\Backup

http://forums.asp.net/thread/1454694.aspx|||

Thanks, Caddre. Before I got your message I had just found this link (http://www.c-sharpcorner.com/uploadfile/dsdaf/104012006083052am/1.aspx) and followed those instructions. It created all the tables, views, and stored procedures that had been created on my local SQL Express installation. From what I understand of the Backup and Restore method, I have to be able to load the backup file on the remote server, right? I don't think I have access to do that. I'm planning to call the database administrator tomorrow, anyway, because the Website Administration Tool in VS2005 says I don't have permission to execute 'aspnet_CheckSchemaVersion' so I'm not able to create new users. Crazy. :-)

For future readers of this thread, if you end up using the link in this message, and you have a problem running the tool like I did, you may be interested in this quote fromhttp://quickstarts.asp.net/QuickStartv20/aspnet/doc/management/tools.aspx :

"To configure and install databases on a SQL server to use these ASP.NET features, you can use theaspnet_regsql tool. This tool can be found in the version-specific framework directory, under theMicrosoft.NET\Framework subdirectory of your Windows system folder."

As always, thank you for your help, Caddre.

-Mathminded

|||

FYI for anyone who runs into the problem of not having permission to execute that stored procedure. I used the Microsoft SQL Server Management Studio Express to add my database user to the aspnet_Membership_FullAccess role and that took care of it. I think the backup and restore method that Caddre mentioned probably takes care of problems like that, but unfortunately I didn't have access to load files on the remote server. If you can do it her way, I suggest doing that since she has about a million times more experience than I do (that's probably an understatement . . . it's probably closer to a billion or so). But, if you're in the situation I was in, this did work for me.

Happy SQLing!

-Mathminded

|||

addition to my previous post:

I had to add my database user to ALL of the roles ending in "_FullAccess" in order to fully use the Website Administration Tool.

Tuesday, February 14, 2012

Create Database on Remote server specifying a path

using SQL SERVER 2K
I have registered a server that sits on TestServer\TestInstance and I have a
bunch of Database and table creation scripts... but I didn't think it was
possible to run something like the following unless it was run from that
actual machine (while at the machine or TermServed in or in some way remotel
y
controlling the box )
Create Database MYDB on(name=N'MYDB_DATA',
filename=N'E:\SQLDATA\MYDB_DATA.MDF,...)'
I know that I can use EM to visually create each database and then script
the tables, but the scripted option would be nice and quick.Kevin,
Connect via Query Analyzer or OSQL to the TestServer\TestInstance and run
the create database script.
HTH
Jerry
"kevin" <kevin@.discussions.microsoft.com> wrote in message
news:4257D77D-4BC8-44C9-B69C-7BD9F2793E7D@.microsoft.com...
> using SQL SERVER 2K
> I have registered a server that sits on TestServer\TestInstance and I have
> a
> bunch of Database and table creation scripts... but I didn't think it was
> possible to run something like the following unless it was run from that
> actual machine (while at the machine or TermServed in or in some way
> remotely
> controlling the box )
> Create Database MYDB on(name=N'MYDB_DATA',
> filename=N'E:\SQLDATA\MYDB_DATA.MDF,...)'
> I know that I can use EM to visually create each database and then script
> the tables, but the scripted option would be nice and quick.
>|||Jerry,
I actually did that just before I begin this post, went to the john and
strolled my slow ass back and it finally completed in 15:54. This explains
why it was failing from VS, it was timing out.
"Jerry Spivey" wrote:

> Kevin,
> Connect via Query Analyzer or OSQL to the TestServer\TestInstance and run
> the create database script.
> HTH
> Jerry
> "kevin" <kevin@.discussions.microsoft.com> wrote in message
> news:4257D77D-4BC8-44C9-B69C-7BD9F2793E7D@.microsoft.com...
>
>

Create Database on Remote Server

Hi
I am using SQL Server 2000 and I would like to know how to create a database
on a remote server.
Right now, my application has to be on the same pc as the Server to create
the database using SQLDMO, I do use scripts to create the database but one
of our customer has a problem, they have a saperate dedicated SQL Server
2000 PC and on another PC they have my application. My application crashes
as it unable to create the database on the remote Server using ADO/SQLDMO.
For example:
I have a Server running SQL2K/MSDE and 1 workstation running my
application. From the workstation I would like to send command to Server to
create a database using ADO/SQLDMO.
Let me know if it's possible to create database on the remote server?
Thanks>> Let me know if it's possible to create database on the remote server?
If you are using 4-part naming, you can use sp_ExecuteSQL like:
EXEC server.master.dbo.sp_ExecuteSQL N'CREATE DATABASE db..'
Anith|||Can explain what is 4-part naming?
Right now, I have a create database script that does the creation.
How do I use the existing script with sp_Execute?
Thanks for the info.
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:%23s3ARcKuFHA.3756@.tk2msftngp13.phx.gbl...
> If you are using 4-part naming, you can use sp_ExecuteSQL like:
> EXEC server.master.dbo.sp_ExecuteSQL N'CREATE DATABASE db..'
> --
> Anith
>|||>> Can explain what is 4-part naming?
4-part naming is a way to refer to objects (tables, views, procedures etc. )
in a remotely located server, say a linked server using
server.database.owner.object scheme. Using it you can express distributed
queries across servers using appropriate OLEDB providers. Details can be
found in SQL Server Books Online under the topic "Linked Servers".
If you already have a CREATE DATABASE script, you can wrap it as a string
and execute it. See the topic sp_ExecuteSQL in SQL Server Books Online for
details and examples.
Anith