Showing posts with label connected. Show all posts
Showing posts with label connected. Show all posts

Sunday, March 25, 2012

Connecting to SQL Issue

I have a mdf file and log file from msde. I have successfully connected to it in my Visual Studios ASP.net 2.0 Desktop. I am having a problem where it connects. fine but it does not list the tables , diagrams etc. I am trying to build the intake screen with this data but have no tables. Can some one give me a couple of suggestions of why? I am very new to ASP.net and would appreciate any help .How did you connect to the MSDE mdf file? Can you create a Data Connection to it in Server Explorer? Which SQL instance are you using (MSED,SQL Express, etc.)?|||

Hello,

I am using SQL Server Management Studio that came with my visual studios .net 2005.

I open my web application to the design desktop select the tab labeled Server Express the click on the data base to connect it tell me it is connected but no tables show. I was told today by some one I need to be running SQL Server Studio Express I dont understand is the one I have better? The also told me the mdf file was a backup file which they said I need to create a database and then import the mdf backup file into it . I can figure out how to do this I am very new to SQL Server. Help please

Thanks

|||Where does the mdf file come from? Anyways you should attach it to your current SQL instance before you can use it. To do this in Managment Studio, right click Databases in Object Explorer->choose Attach->locate the mdf file. If attach succeeds, you'll see the new attached database under the Databases tree.|||

Thank you,

I found the mdf file to be a bak file I created anew database and restored over the database I created. All tables showed up ok. I only have on question everything seem to work fine except I have no diagrams under the database is this normal not to have this information?

sqlsql

Connecting to SQL in ASP.net 20

I have a database that is currently connected and working properly in My SQL Server Management Studio. The problem I am havings is when I open My ASP.net 20 and Look in my Server Solutions I can not find the database to connect to it . It seems to be trying to use SLQ Express and not my SLQ Server Management Studio. How do I get my database to connect in my application? All I can see from within the Server solutions in ASP is the database .bak file which is the backup of the database. I thank you in advance.

Are you saying that, when you are trying to connect to the Server in the Server Explorer, that the server does not show up in the list?

Is the server 2000 or 2005 or.....?

|||Yes and no . I think I dono have my SQL Server Manager Studio (Dev ed) is not set as my primary and the SQL Express is . I think I need to configure my SQL Server Manager Studioas primary but am not sure how to do this. and help would be get.|||My question was concerning inside Visual Web Developer - the Server Explorer window|||Inside the designer in the server explorer the sever shows up ok but the database does not|||Inside the designer in the server explorer the sever shows up ok but the database does not

Thursday, March 22, 2012

Connecting to some remote Sql Server

Hi

I've got a desktop and a notebook and both are connected to the router. On both I've got Sql Server Express and Sql Server Management Studio Express installed. I need to connect to a remote Sql Server (using user ID and password) which works fine on my desktop, but fails on my notebook: Error:0 and Error: 10060.

I checked all router settings and notebook settings, but I don't know what I am doing wrong. I got myself another notebook and installed Sql Server Express plus Management Studio, which did not work either.

Hopefully someone can help.

Thank you.

The error code is of Socket error. It seems you are not able to get connected to your SQL server.

following should help you.

http://www.dameware.com/support/kb/article.aspx?ID=300060

|||

Hi, I am able to connect to the local Sql Server Express (running on the notebook) - only remote connections (at least the one I am trying) fail.

Thanks!

|||

The remote connection may be failing because of socket error. You might like to have a look at remote connection. You might also like to look at the SQL server to check if it allows remote connections.

Sunday, March 11, 2012

Connecting to Database

Connected to SQL database via network but now I have
copied database onto laptop to work from home, I got SQL
2000 Server Edition on laptop but I cannot seem to connect
to local database on laptop, it comes up with errors
saying no database found or access denied. Tried to tell
it to look locally but nothing.Do I need to uninstall
server edition and put personal edition on? Do I did
the .log file on laptop as well?
Any help will be grateful.pls check whether u have creted the user rights for the database, which u in
stalled in ur laptop. if u have not created go to SQL enterprise Manager the
ire u can create new user. then u can able to accress the database.|||After I wrote this posting I did alittle searching around the newsgroups and
found similiar problem, and that suggested uninstalling SQL and reinstallin
g again. I did this and this time I could connect to local SQL server on loc
al machine but it wouldn't
see my database which I had backed up from the original. I didn't have the .
ldf or .log file but I'm getting that in the next day so hopefully it will t
hen allow me to create the database again. I've tried to create a new databa
se and then restore my orig
inal into that database but it's not seen it.
Any help will be appreciated.

Connecting to Database

Connected to SQL database via network but now I have
copied database onto laptop to work from home, I got SQL
2000 Server Edition on laptop but I cannot seem to connect
to local database on laptop, it comes up with errors
saying no database found or access denied. Tried to tell
it to look locally but nothing.Do I need to uninstall
server edition and put personal edition on? Do I did
the .log file on laptop as well?
Any help will be grateful.
pls check whether u have creted the user rights for the database, which u installed in ur laptop. if u have not created go to SQL enterprise Manager theire u can create new user. then u can able to accress the database.
|||After I wrote this posting I did alittle searching around the newsgroups and found similiar problem, and that suggested uninstalling SQL and reinstalling again. I did this and this time I could connect to local SQL server on local machine but it wouldn't
see my database which I had backed up from the original. I didn't have the .ldf or .log file but I'm getting that in the next day so hopefully it will then allow me to create the database again. I've tried to create a new database and then restore my orig
inal into that database but it's not seen it.
Any help will be appreciated.

Wednesday, March 7, 2012

Connecting to a remote sql server for merge replication (push) in SQL Server 2005 Replicat

I am trying to setup a merge (push) replication to a server/database
in a
remote network. I created the publication and connected to the remote
network using VPN but cannot register nor see the remote sql server.
In sql
server 2000, I was able to register the server in my Enterprise
Manager
(after creating an alias) and then created the push subscription. I
connect
to the remote network server using VPN. How do I go about doing this
in SQL
Server 2005? The publisher is a WorkGroup edition while the subscriber
is
standard edition. Authentication is set to both win and sql and
verified
the user and password used to attempt registration. Any help will be
greatly appreciated.
Create an alias on the publisher to the subscriber. Use client network
utility to do this, and for the server name use its fully qualified domain
name. Try to ping both servers from each other.
You may have to use anonymous subscribers to get this to work if you can't
map an unc drive between the two.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<pete970t@.gmail.com> wrote in message
news:1182891307.332293.251610@.u2g2000hsc.googlegro ups.com...
>I am trying to setup a merge (push) replication to a server/database
> in a
> remote network. I created the publication and connected to the remote
> network using VPN but cannot register nor see the remote sql server.
> In sql
> server 2000, I was able to register the server in my Enterprise
> Manager
> (after creating an alias) and then created the push subscription. I
> connect
> to the remote network server using VPN. How do I go about doing this
> in SQL
> Server 2005? The publisher is a WorkGroup edition while the subscriber
> is
> standard edition. Authentication is set to both win and sql and
> verified
> the user and password used to attempt registration. Any help will be
> greatly appreciated.
>

Saturday, February 25, 2012

Connecting through ODBC

Did anyone try fetching data from any database which is connected through ODBC. If so can you please share the details. In the data flow task of SSIS there is a facility for only oledb and not thru ODBC.

From what I understand, ODBC was not implemented by MS in SSIS.

See thread here

|||An ODBC Destination was not implemented due to time constraints, but you can certainly read from a database via ODBC.
You need to use the ODBC Provider which is a member of the ADO.Net connection types. You then need to use the DataReader source to query your database.
Larry Pope
|||ODBC works as a source but not a destination.

Connecting SQL server to the net?

Hi all. Im using Visual Web developer 2005 and have successfully connected my SQL Server to Visual Web developer website. When i run it locally, its fine. But, i now would like the site to be placed on the net - but im not sure how to connect it properly in the webhost. Can someone tell me how this is done please, or a link? cheers.

You can add a connection string on web.config file

<connectionStrings>

<add name="connectioname" connectionString="server=database server;uid=username; pwd=pasword; database=databasename;"/>

</connectionStrings>

then call this connection string on your page.

string strCon = System.Configuration.ConfigurationManager.ConnectionStrings["connectionname"].ConnectionString;

I hope this will help.

|||

Ok.....im still rather confused on how exactly the databse is linked. Firstly, i have the site on a external harddrive....but ive found that the SQL server databse is placed in a totally different location - C:\Program Files (x86)\Microsoft SQL Server\MSSQL.2\MSSQL\Data\Database.mdf

Surely i would have to link it some how for the site/databse to work properly on the site?

|||No ideas guys? Surely there must be a way so i can upload my SQL server database and connect it to my website? I can do it easily in Visual Web Developer in my computer....but stummped how to do it on the net.....|||

Hi,

You may follow the steps below.

First, backup you local database.

Second, get the physical folder of the database file exist on your server. From your previous post, it isC:\Program Files (x86)\Microsoft SQL Server\MSSQL.2\MSSQL\Data\.

Third, restore your backup file to your server database. (Note, you have to replace theMove to Physical file nameitem in the Option tab with your real server-side database folder.)

Third, modify the connection string in your web.config file and call the string in your code by ConfigurationManager.

Thanks.

connecting sql server intalled on a persnal pc

Hi,

I'm trying to connect to sql server (installed on my personal PC) from a pocket pc using sqlconnection (Both are connected to my Router).

But every time I run my program on the pocket pc I get sqlexception when trying to open the connection.

I have already configured the sql server to accept remote connections...

1. what should I do?

2. Is it possible to open the sql server on my PC for remote connections (internet)?

3. How should I configure my Router so it wont block the connections?

1: Check this: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=962226&SiteID=1 and this:

http://support.microsoft.com/kb/287932

also show us your connection string, as SqlClient from compact framework has some restrictions.

2: Yes, but it is not recommended.

3: See 1.

Friday, February 24, 2012

connecting nodes and calculating paths

I have an interesting problem where I need to calculate paths between
connecting nodes.
For example:-
Node 1 is connected to Node 2
Node 1 is connected to Node 4
Node 2 is connected to Node 3
Node 3 is connected to Node 4
Want I need to return if I search connections between these two nodes are:-
1-4
1-2-3-4
I don't however need to see results if the connection is more than 6 nodes
deep.
Can anyone help me achieve this?
or point me to resources (online or books) where I can learn how to do this.
I have good knowledge in using hierarchical data but cannot for the life of
me figure this one out.
http://www.rippo.co.uk/nodes.gif (to visually see what I am trying to
achieve)
Thanks
rippoA few ways you could do it...
You could just make a single query, joining on your table 6 times.
You could use a temporary table, inserting the next level of nodes each time
you run through a loop - this is handy for doing a breadth-first search
through a tree.
You could make a table with 6 fields, populating each as you go through a
loop.|||In principle it isn't difficult to do a full enumeration of 6-edged paths,
assuming you model the network like this:
CREATE TABLE Paths (from_node INTEGER NOT NULL, to_node INTEGER NOT NULL,
PRIMARY KEY (from_node,to_node))
INSERT INTO Paths (from_node, to_node)
SELECT 1,2 UNION ALL
SELECT 2,1 UNION ALL
SELECT 2,3 UNION ALL
SELECT 2,9 UNION ALL
SELECT 2,6 UNION ALL
SELECT 3,2 UNION ALL
SELECT 3,4 UNION ALL
SELECT 3,5 UNION ALL
SELECT 4,3 UNION ALL
SELECT 4,5 UNION ALL
SELECT 5,3 UNION ALL
SELECT 5,4 UNION ALL
SELECT 5,6 UNION ALL
SELECT 6,2 UNION ALL
SELECT 6,5 UNION ALL
SELECT 6,7 UNION ALL
SELECT 7,6 UNION ALL
SELECT 7,8 UNION ALL
SELECT 8,7 UNION ALL
SELECT 8,9 UNION ALL
SELECT 9,8 UNION ALL
SELECT 9,2
DECLARE @.from_node INTEGER, @.to_node INTEGER
SET @.from_node = 1
SET @.to_node = 6
SELECT
P1.from_node, P1.to_node, P2.to_node,
P3.to_node, P4.to_node, P5.to_node
FROM Paths AS P1
LEFT JOIN Paths AS P2
ON P1.to_node = P2.from_node
AND P1.to_node <> @.to_node
LEFT JOIN Paths AS P3
ON P2.to_node = P3.from_node
AND P2.to_node <> @.to_node
LEFT JOIN Paths AS P4
ON P3.to_node = P4.from_node
AND P3.to_node <> @.to_node
LEFT JOIN Paths AS P5
ON P4.to_node = P5.from_node
AND P4.to_node <> @.to_node
WHERE P1.from_node = @.from_node
AND COALESCE(P5.to_node, P4.to_node, P3.to_node,
P2.to_node, P1.to_node) = @.to_node
I'll leave it as an execise for you to figure out how to limit this to a
single visit per node, if that's what you are actually sing.
David Portas
SQL Server MVP
--|||David,
This assumes that he can't move on once he gets to the target.
He might need to say:
@.to_node in (P5.to_node, P4.to_node, ...
Using something similar to this in the join conditions to stop searching
down a path that has already visited @.to_node. (In a similar way to the
solution to your exercise for avoiding hitting the same node twice)
RobF|||Thank you for your help so far. I do wish to limit this to a single
visit to a node and also wish to order the results by shortest route
first!
I will have a crack at this myself, however any hints would be useful
:)
rippo|||Assuming you define "length" in terms of the number of edges and assuming yo
u
don't have any nodes of negative numbers. Try this:
SELECT node0, node1, node2, node3, node4, node5, edges
FROM
(SELECT
P1.from_node, P1.to_node, P2.to_node,
P3.to_node, P4.to_node, P5.to_node,
SIGN(COALESCE(P1.to_node,0))+SIGN(COALESCE(P2.to_node,0))+
SIGN(COALESCE(P3.to_node,0))+SIGN(COALESCE(P4.to_node,0))+
SIGN(COALESCE(P5.to_node,0)) AS edges
FROM Paths AS P1
LEFT JOIN Paths AS P2
ON P1.to_node = P2.from_node
AND P1.to_node <> @.to_node
LEFT JOIN Paths AS P3
ON P2.to_node = P3.from_node
AND P2.to_node <> @.to_node
LEFT JOIN Paths AS P4
ON P3.to_node = P4.from_node
AND P3.to_node <> @.to_node
LEFT JOIN Paths AS P5
ON P4.to_node = P5.from_node
AND P4.to_node <> @.to_node
WHERE P1.from_node = @.from_node
AND COALESCE(P5.to_node, P4.to_node, P3.to_node,
P2.to_node, P1.to_node) = @.to_node
AND NOT EXISTS
(SELECT NULL
FROM
(SELECT P1.from_node AS n UNION ALL
SELECT P1.to_node UNION ALL
SELECT P2.to_node UNION ALL
SELECT P3.to_node UNION ALL
SELECT P4.to_node UNION ALL
SELECT P5.to_node) AS T
GROUP BY n
HAVING COUNT(n)>1)
) AS X(node0, node1, node2, node3, node4, node5, edges)
ORDER BY edges
David Portas
SQL Server MVP
--|||>From the next edition of SQL FOR SMARTIES:
30.02.04. Listing the Paths
I got data for this table from the book Introduction to Algorithms by
Cormen, Leiserson and Rivest (ISBN 0-262-03141-8), page 518. This book
was very popular in college courses in the United States. I made one
decision that will be important later; I added self-traversal edges
(i.e., the node is both the out_node and the in_node of an edge) with
weights of zero.
INSERT INTO Edges VALUES ('s', 's', 0);
INSERT INTO Edges VALUES ('s', 'u', 3);
INSERT INTO Edges VALUES ('s', 'x', 5);
INSERT INTO Edges VALUES ('u', 'u', 0);
INSERT INTO Edges VALUES ('u', 'v', 6);
INSERT INTO Edges VALUES ('u', 'x', 2);
INSERT INTO Edges VALUES ('v', 'v', 0);
INSERT INTO Edges VALUES ('v', 'y', 2);
INSERT INTO Edges VALUES ('x', 'u', 1);
INSERT INTO Edges VALUES ('x', 'v', 4);
INSERT INTO Edges VALUES ('x', 'x', 0);
INSERT INTO Edges VALUES ('x', 'y', 6);
INSERT INTO Edges VALUES ('y', 's', 3);
INSERT INTO Edges VALUES ('y', 'v', 7);
INSERT INTO Edges VALUES ('y', 'y', 0);
I am not happy about this approach, because I have to decide the
maximum number of edges in path before I start looking for an answer.
But this will work and I know that a path will have no more than the
total number of nodes in the graph. Let's create a table to hold the
paths:
CREATE TABLE Paths
(step1 CHAR(2) NOT NULL,
step2 CHAR(2) NOT NULL,
step3 CHAR(2) NOT NULL,
step4 CHAR(2) NOT NULL,
step5 CHAR(2) NOT NULL,
total_cost INTEGER NOT NULL,
path_length INTEGER NOT NULL,
PRIMARY KEY (step1, step2, step3, step4, step5));
The "step1" node is where I begin the path. The other columns are the
second step, third step, fourth step, and so forth. The last step
column is the end of the journey. The "total_cost" column is the total
cost, based on the sum of the weights of the edges, on this path. The
path length column is harder to explain, but for now, let's just say
that it is a count of the nodes visited in the path.
To keep things easier, let's look at all the paths from 's' to 'y' in
the graph. The INSERT INTO statement for constructing that set looks
likes this:
INSERT INTO Paths
SELECT G1.out_node, -- it is 's' in this example
G2.out_node,
G3.out_node, G4.out_node,
G4.in_node, -- it is 'y' in this example
(G1.cost + G2.cost + G3.cost + G4.cost),
(CASE WHEN G1.out_node NOT IN (G2.out_node, G3.out_node,
G4.out_node) THEN 1 ELSE 0 END
+ CASE WHEN G2.out_node NOT IN (G1.out_node, G3.out_node,
G4.out_node) THEN 1 ELSE 0 END
+ CASE WHEN G3.out_node NOT IN (G1.out_node, G2.out_node,
G4.out_node) THEN 1 ELSE 0 END
+ CASE WHEN G4.out_node NOT IN (G1.out_node, G2.out_node,
G3.out_node) THEN 1 ELSE 0 END)
FROM Edges AS G1,
Edges AS G2,
Edges AS G3,
Edges AS G4
WHERE G1.out_node = 's'
AND G1.in_node = G2.out_node
AND G2.in_node = G3.out_node
AND G3.in_node = G4.out_node
AND G4.in_node = 'y';
I put in 's' and 'y' as the out_node and in_node of the path, and made
sure that the in_node of each step in the path was the out_node of the
next step in the path. This is a combinatorial explosion, but it is
easy to read and understand.
The sum of the weights is the cost of the path, which is easy to
understand. The path_length calculation is a bit harder. This sum of
CASE expressions looks at each node in the path. If it is unique
within the row, it is assigned a value of one, if it is not unique
within the row, it is assigned a value of zero.
All paths will have five steps in them because that is the way to table
is declared. But what if a path exists between the two nodes which is
shorter than five steps? That is where the self-traversal rows are
used! Consecutive pairs of steps in the same row can be repetitions of
the same node.
Here is what the rows of the Paths table look like after this INSERT
INTO statement, ordered by descending path_length, and then by
ascending cost.
Paths step1 step2 step3 step4 step5 total_cost path_length
========================================
==============
s s x x y 11 0
s s s x y 11 1
s x x x y 11 1
s x u x y 14 2
s s u v y 11 2
s s u x y 11 2
s s x v y 11 2
s s x y y 11 2
s u u v y 11 2
s u u x y 11 2
s u v v y 11 2
s u x x y 11 2
s x v v y 11 2
s x x v y 11 2
s x x y y 11 2
s x y y y 11 2
s x y v y 20 4
s x u v y 14 4
s u v y y 11 4
s u x v y 11 4
s u x y y 11 4
s x v y y 11 4
Clearly, all pairs of nodes could be picked from the original Edges
table and the same INSERT INTO run on them with a minor change in the
WHERE clause. However, this example is big enough for a short magazine
article. And it is too big for most applications. It is safe to
assume that people really want the cheapest path. In this example, the
total_cost column defines the cost of an path, so we can eliminate some
of the paths from the Paths table with this statement.
DELETE FROM Paths
WHERE total_cost
> (SELECT MIN(total_cost)
FROM Paths);
Again, if you had all the paths for all possible pairs of nodes, the
subquery expression would have a WHERE clause to correlate it to the
subset of paths for each possible pair.
In this example, it got rid of 3 out of 22 possible paths. It is
helpful and in some situations we might like having all the options.
But these are not distinct options.
As one of many examples, the paths
(s, x, v, v, y, 11, 2)
and
(s, x, x, v, y, 11, 2)
are both really the same path, (s, x, v, y). Before we decide to write
a statement to handle these equivalent rows, let's consider another
cost factor. People do not like to change airplanes or trains. If
they can go from Amsterdam to New York City on one plane without
changing planes for the same cost, they are happy. This is where that
path_length column comes in. It is a quick way to remove the paths
that have more edges than they need to get the job done.
DELETE FROM Paths
WHERE path_length
> (SELECT MIN(path_length)
FROM Paths);
In this case, that last DELETE FROM statement will reduce the table to
one row: (s, s, x, x, y, 11, 0) which reduces to (s, x, y). This
single remaining row is very convenient for my article, but if you look
at the table, you will see that there was also a subset of equivalent
rows that had higher path_length numbers.
(s, s, s, x, y, 11, 1)
(s, x, x, x, y, 11, 1)
(s, x, x, y, y, 11, 2)
(s, x, y, y, y, 11, 2)
Your task is to write code to handle equivalent rows. Hint: the
duplicate nodes will always be contiguous across the row.|||Joe,
When is the next edition going to come out?
jp
--CELKO-- wrote:
> 30.02.04. Listing the Paths
> I got data for this table from the book Introduction to Algorithms by
> Cormen, Leiserson and Rivest (ISBN 0-262-03141-8), page 518. This book
> was very popular in college courses in the United States. I made one
> decision that will be important later; I added self-traversal edges
> (i.e., the node is both the out_node and the in_node of an edge) with
> weights of zero.
> INSERT INTO Edges VALUES ('s', 's', 0);
> INSERT INTO Edges VALUES ('s', 'u', 3);
> INSERT INTO Edges VALUES ('s', 'x', 5);
> INSERT INTO Edges VALUES ('u', 'u', 0);
> INSERT INTO Edges VALUES ('u', 'v', 6);
> INSERT INTO Edges VALUES ('u', 'x', 2);
> INSERT INTO Edges VALUES ('v', 'v', 0);
> INSERT INTO Edges VALUES ('v', 'y', 2);
> INSERT INTO Edges VALUES ('x', 'u', 1);
> INSERT INTO Edges VALUES ('x', 'v', 4);
> INSERT INTO Edges VALUES ('x', 'x', 0);
> INSERT INTO Edges VALUES ('x', 'y', 6);
> INSERT INTO Edges VALUES ('y', 's', 3);
> INSERT INTO Edges VALUES ('y', 'v', 7);
> INSERT INTO Edges VALUES ('y', 'y', 0);
> I am not happy about this approach, because I have to decide the
> maximum number of edges in path before I start looking for an answer.
> But this will work and I know that a path will have no more than the
> total number of nodes in the graph. Let's create a table to hold the
> paths:
> CREATE TABLE Paths
> (step1 CHAR(2) NOT NULL,
> step2 CHAR(2) NOT NULL,
> step3 CHAR(2) NOT NULL,
> step4 CHAR(2) NOT NULL,
> step5 CHAR(2) NOT NULL,
> total_cost INTEGER NOT NULL,
> path_length INTEGER NOT NULL,
> PRIMARY KEY (step1, step2, step3, step4, step5));
> The "step1" node is where I begin the path. The other columns are the
> second step, third step, fourth step, and so forth. The last step
> column is the end of the journey. The "total_cost" column is the total
> cost, based on the sum of the weights of the edges, on this path. The
> path length column is harder to explain, but for now, let's just say
> that it is a count of the nodes visited in the path.
> To keep things easier, let's look at all the paths from 's' to 'y' in
> the graph. The INSERT INTO statement for constructing that set looks
> likes this:
> INSERT INTO Paths
> SELECT G1.out_node, -- it is 's' in this example
> G2.out_node,
> G3.out_node, G4.out_node,
> G4.in_node, -- it is 'y' in this example
> (G1.cost + G2.cost + G3.cost + G4.cost),
> (CASE WHEN G1.out_node NOT IN (G2.out_node, G3.out_node,
> G4.out_node) THEN 1 ELSE 0 END
> + CASE WHEN G2.out_node NOT IN (G1.out_node, G3.out_node,
> G4.out_node) THEN 1 ELSE 0 END
> + CASE WHEN G3.out_node NOT IN (G1.out_node, G2.out_node,
> G4.out_node) THEN 1 ELSE 0 END
> + CASE WHEN G4.out_node NOT IN (G1.out_node, G2.out_node,
> G3.out_node) THEN 1 ELSE 0 END)
> FROM Edges AS G1,
> Edges AS G2,
> Edges AS G3,
> Edges AS G4
> WHERE G1.out_node = 's'
> AND G1.in_node = G2.out_node
> AND G2.in_node = G3.out_node
> AND G3.in_node = G4.out_node
> AND G4.in_node = 'y';
> I put in 's' and 'y' as the out_node and in_node of the path, and made
> sure that the in_node of each step in the path was the out_node of the
> next step in the path. This is a combinatorial explosion, but it is
> easy to read and understand.
> The sum of the weights is the cost of the path, which is easy to
> understand. The path_length calculation is a bit harder. This sum of
> CASE expressions looks at each node in the path. If it is unique
> within the row, it is assigned a value of one, if it is not unique
> within the row, it is assigned a value of zero.
> All paths will have five steps in them because that is the way to table
> is declared. But what if a path exists between the two nodes which is
> shorter than five steps? That is where the self-traversal rows are
> used! Consecutive pairs of steps in the same row can be repetitions of
> the same node.
> Here is what the rows of the Paths table look like after this INSERT
> INTO statement, ordered by descending path_length, and then by
> ascending cost.
> Paths step1 step2 step3 step4 step5 total_cost path_length
> ========================================
==============
> s s x x y 11 0
> s s s x y 11 1
> s x x x y 11 1
> s x u x y 14 2
> s s u v y 11 2
> s s u x y 11 2
> s s x v y 11 2
> s s x y y 11 2
> s u u v y 11 2
> s u u x y 11 2
> s u v v y 11 2
> s u x x y 11 2
> s x v v y 11 2
> s x x v y 11 2
> s x x y y 11 2
> s x y y y 11 2
> s x y v y 20 4
> s x u v y 14 4
> s u v y y 11 4
> s u x v y 11 4
> s u x y y 11 4
> s x v y y 11 4
> Clearly, all pairs of nodes could be picked from the original Edges
> table and the same INSERT INTO run on them with a minor change in the
> WHERE clause. However, this example is big enough for a short magazine
> article. And it is too big for most applications. It is safe to
> assume that people really want the cheapest path. In this example, the
> total_cost column defines the cost of an path, so we can eliminate some
> of the paths from the Paths table with this statement.
> DELETE FROM Paths
> WHERE total_cost
> FROM Paths);
> Again, if you had all the paths for all possible pairs of nodes, the
> subquery expression would have a WHERE clause to correlate it to the
> subset of paths for each possible pair.
> In this example, it got rid of 3 out of 22 possible paths. It is
> helpful and in some situations we might like having all the options.
> But these are not distinct options.
> As one of many examples, the paths
> (s, x, v, v, y, 11, 2)
> and
> (s, x, x, v, y, 11, 2)
> are both really the same path, (s, x, v, y). Before we decide to write
> a statement to handle these equivalent rows, let's consider another
> cost factor. People do not like to change airplanes or trains. If
> they can go from Amsterdam to New York City on one plane without
> changing planes for the same cost, they are happy. This is where that
> path_length column comes in. It is a quick way to remove the paths
> that have more edges than they need to get the job done.
> DELETE FROM Paths
> WHERE path_length
> FROM Paths);
> In this case, that last DELETE FROM statement will reduce the table to
> one row: (s, s, x, x, y, 11, 0) which reduces to (s, x, y). This
> single remaining row is very convenient for my article, but if you look
> at the table, you will see that there was also a subset of equivalent
> rows that had higher path_length numbers.
> (s, s, s, x, y, 11, 1)
> (s, x, x, x, y, 11, 1)
> (s, x, x, y, y, 11, 2)
> (s, x, y, y, y, 11, 2)
> Your task is to write code to handle equivalent rows. Hint: the
> duplicate nodes will always be contiguous across the row.
>|||Thanks Guys.This has been very helpful.
I will implement both solutions and come up with the best appraoch for
my problem.
I should probably have mentioned that the nodes are not closed and will
be added to constantly. I estimate that there will be getting close to
100,000 nodes with each node being linked up to around 5 nodes. Some
nodes however will be linked to serveral hundred.
Anyway thanks again
Rippo

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

Connected users

does anybody know how I get to obtain the number or connected users' list in
a base SQL Server for license control?
In Access I get through the function LDBUser_GetUsers of msldbusr.dll.
Thank you.Try sp_who.
All of the SPIDS below 20, I believe, are system and not counted as "users"
"Frank Dulk" <fdulk@.bol.com.br> wrote in message
news:u3n9TfncDHA.3708@.tk2msftngp13.phx.gbl...
>
> does anybody know how I get to obtain the number or connected users' list
in
> a base SQL Server for license control?
> In Access I get through the function LDBUser_GetUsers of msldbusr.dll.
> Thank you.
>|||In SQL2K spids 1-50 are reserved for internal use
--
Ray Higdon MCSE, MCDBA, CCNA
--
"Morgan" <mfears@.spamcop.net> wrote in message
news:OZ0TLzncDHA.2308@.TK2MSFTNGP12.phx.gbl...
> Try sp_who.
> All of the SPIDS below 20, I believe, are system and not counted as
"users"
> "Frank Dulk" <fdulk@.bol.com.br> wrote in message
> news:u3n9TfncDHA.3708@.tk2msftngp13.phx.gbl...
> >
> >
> >
> > does anybody know how I get to obtain the number or connected users'
list
> in
> > a base SQL Server for license control?
> >
> > In Access I get through the function LDBUser_GetUsers of msldbusr.dll.
> >
> > Thank you.
> >
> >
>|||Thanks for the clarification, Ray. Much appreciated.
"Ray Higdon" <rayhigdon@.higdonconsulting.com> wrote in message
news:ukjY87ncDHA.2112@.TK2MSFTNGP10.phx.gbl...
> In SQL2K spids 1-50 are reserved for internal use
> --
> Ray Higdon MCSE, MCDBA, CCNA
> --
> "Morgan" <mfears@.spamcop.net> wrote in message
> news:OZ0TLzncDHA.2308@.TK2MSFTNGP12.phx.gbl...
> > Try sp_who.
> >
> > All of the SPIDS below 20, I believe, are system and not counted as
> "users"
> >
> > "Frank Dulk" <fdulk@.bol.com.br> wrote in message
> > news:u3n9TfncDHA.3708@.tk2msftngp13.phx.gbl...
> > >
> > >
> > >
> > > does anybody know how I get to obtain the number or connected users'
> list
> > in
> > > a base SQL Server for license control?
> > >
> > > In Access I get through the function LDBUser_GetUsers of msldbusr.dll.
> > >
> > > Thank you.
> > >
> > >
> >
> >
>

Connected user list to a sql server database

Hi,
Is there any way to get the list of user names connected to a particular
database? Can any one give me the T-sql statement to get the list of users.
Venkat
Hi
Here is the query
Select Loginame,spid,db_name(dbid) from master..sysprocesses where
db_name(dbid)='dbname'
best Regards,
Chandra
http://chanduas.blogspot.com/
http://groups.msn.com/SQLResource/
"Venkat" wrote:

> Hi,
> Is there any way to get the list of user names connected to a particular
> database? Can any one give me the T-sql statement to get the list of users.
> --
> Venkat
>
>

Connected user list to a sql server database

Hi,
Is there any way to get the list of user names connected to a particular
database? Can any one give me the T-sql statement to get the list of users.
--
VenkatHi
Here is the query
Select Loginame,spid,db_name(dbid) from master..sysprocesses where
db_name(dbid)='dbname'
best Regards,
Chandra
http://chanduas.blogspot.com/
http://groups.msn.com/SQLResource/
---
"Venkat" wrote:
> Hi,
> Is there any way to get the list of user names connected to a particular
> database? Can any one give me the T-sql statement to get the list of users.
> --
> Venkat
>
>

Connected user list to a sql server database

Hi,
Is there any way to get the list of user names connected to a particular
database? Can any one give me the T-sql statement to get the list of users.
VenkatHi
Here is the query
Select Loginame,spid,db_name(dbid) from master..sysprocesses where
db_name(dbid)='dbname'
best Regards,
Chandra
http://chanduas.blogspot.com/
http://groups.msn.com/SQLResource/
---
"Venkat" wrote:

> Hi,
> Is there any way to get the list of user names connected to a particul
ar
> database? Can any one give me the T-sql statement to get the list of users
.
> --
> Venkat
>
>

Connected to which database

Hello all,

I have a scripts which needs the information about the database in
which it is running.

How can I find out this information.

For example if I want to know the User who has satrted this report, I
use the SYSTEM_USER procedure.

Does an equal procedure exist to find out, on which database the user
is connected to.

Regrads
Franz-JosefYou can the name of the current database with DB_NAME():

SELECT DB_NAME()

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Franz-Josef" <Post@.tophoven.net> wrote in message
news:a0fd39b2.0404280302.403618ee@.posting.google.c om...
> Hello all,
> I have a scripts which needs the information about the database in
> which it is running.
> How can I find out this information.
> For example if I want to know the User who has satrted this report, I
> use the SYSTEM_USER procedure.
> Does an equal procedure exist to find out, on which database the user
> is connected to.
> Regrads
> Franz-Josef

connected model Vs. disconnected model

hi !!
i have a question about the connected and disconnected model to access the Sql server DB......i know that there is better to choose one rather than the other in some situantions and there is no better model in all cases..... os i hope you can help me to decide what shall i choose...
i will use the DB to connect to Web services and read data from the DB and wrtie some data back......i do not know that to use .... i hope you advise me and tell me about the rules that will allow me to choose what model to choose ... i appreciate your help!!
Thanks !!!Very basically, if you're a single user application then you may get a benefit from staying connected. If you're expecting many users then disconnected is the way forward. Given the very disconnected nature of a web service I would think the clue is in the question...although re-reading your question I'm not sure who is the client and who is the server.|||my project will be a WS that will send SMS .... user will have a directory daved in the DB and contains addresees and groups that users can send them SMS and after the SMS goet sent i will dave all the information in the database...i think mainly i will use the insert and select commands and the update and the delete will be less used in the system.
i hope that will give you a good overview about the project.
thanks for your reply and i appreciate your help!

Tuesday, February 14, 2012

Connect to SSIS on clustered sql2k5

I got following error when try to expand msdb under SSIS in SSMS, the SSIS I connected to is on clustered server. The windows account used is member of local admin on both nodes in the cluster and sysadmin in sql. I tried with host name that SSIS runs on and virtual sql server name for connection, tried connect from remote client machine and server itself, got same error:

Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)

Login timeout expired
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
Named Pipes Provider: Could not open a connection to SQL Server [2]. (Microsoft SQL Native Client)

Login timeout expired
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
Named Pipes Provider: Could not open a connection to SQL Server [2]. (Microsoft SQL Native Client)

Anyone knows what's happen? Thanks.

I solve the problem by changing <ServerName>.</ServerName> to <ServerName>virtual_sql_server_name</ServerName> in %ms sql server%\90\dts\binn\MsDtsSrvr.ini.xml file on each node.|||

I have configured SSIS on the cluster after clustered DB installation. I have followed the directions on 'How to: Configure Integration Services on a Cluster' doc on msdn (http://msdn2.microsoft.com/en-us/library/ms345193.aspx) but I am still not able to connect and I get this error message (very similar to the message on beginning of this post)

TITLE: Microsoft SQL Server Management Studio

Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476


ADDITIONAL INFORMATION:

The SQL server specified in SSIS service configuration is not present or is not available. This might occur when there is no default instance of SQL Server on the computer. For more information, see the topic "Configuring the Integration Services Service" in Server 2005 Books Online.

Login timeout expired
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
Named Pipes Provider: Could not open a connection to SQL Server [2]. (MsDtsSrvr)


BUTTONS:

OK

Appreciate any help you can provide.

Thanks!

Connect to SSIS on clustered sql2k5

I got following error when try to expand msdb under SSIS in SSMS, the SSIS I connected to is on clustered server. The windows account used is member of local admin on both nodes in the cluster and sysadmin in sql. I tried with host name that SSIS runs on and virtual sql server name for connection, tried connect from remote client machine and server itself, got same error:

Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)

Login timeout expired
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
Named Pipes Provider: Could not open a connection to SQL Server [2]. (Microsoft SQL Native Client)

Login timeout expired
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
Named Pipes Provider: Could not open a connection to SQL Server [2]. (Microsoft SQL Native Client)

Anyone knows what's happen? Thanks.

I solve the problem by changing <ServerName>.</ServerName> to <ServerName>virtual_sql_server_name</ServerName> in %ms sql server%\90\dts\binn\MsDtsSrvr.ini.xml file on each node.|||

I have configured SSIS on the cluster after clustered DB installation. I have followed the directions on 'How to: Configure Integration Services on a Cluster' doc on msdn (http://msdn2.microsoft.com/en-us/library/ms345193.aspx) but I am still not able to connect and I get this error message (very similar to the message on beginning of this post)

TITLE: Microsoft SQL Server Management Studio

Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476


ADDITIONAL INFORMATION:

The SQL server specified in SSIS service configuration is not present or is not available. This might occur when there is no default instance of SQL Server on the computer. For more information, see the topic "Configuring the Integration Services Service" in Server 2005 Books Online.

Login timeout expired
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
Named Pipes Provider: Could not open a connection to SQL Server [2]. (MsDtsSrvr)


BUTTONS:

OK

Appreciate any help you can provide.

Thanks!

Connect to SSAS from SQL Management Studio

I'm trying to connect to an SSAS 2005 cube from my XP SP2 workstation. This is at a client's site & my workstation is not connected to their domain but they have given me a domain account & password that has access to the cube. My colleagues who are also running XP SP2 are able to browse to a UNC path on the SSAS server then when prompted enter the account & password. Then they go into SQL Management Studio to create a connection to the SSAS machine. But I can't locate anything different between our configurations. I'm also running Windows OneCare so I'm not sure if that may be the problem. Can you offer any suggestion please?

The trick with opening UNC share, entering credentials and then connecting to SSAS only works with NTLM authentication. Please make sure you are not on Kerberos. Also, it is important that you document the exact steps you do and exact outcomes (i.e. error messages if any etc) in order for the forum to help you.|||

I wasn't aware of that trick you mentioned. I would suggest one of the following:

1. Create yourself a shortcut with the following path:
C:\WINDOWS\SYSTEM32\RUNAS.EXE /net /user:TheirDomain\UserName "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWb.exe"
That will launch Mgmt Studio under the credentials of the right domain account (not the account you've logged onto your laptop). Then you should be able to connect to SSAS on their server.

2. An alternative is if they've got Microsoft VPN, if you VPN to their network, then you don't have to bother with the runas command. (This appears to work when using Microsoft VPN, but not Cisco VPN, for example.)