|
Hi again,
I installed another instance (with such an original name as Test ) After that I tried to add a new item and then in the dialog box from data node "Service-based Database". This failed with an error mesagge saying that the conection cannot be established because the server cannot be found. This is quite obvious since there's no dialog box asking where do I want to connect and the second instance is not listening on default ports and so on.
What I'm currently wondering is that the error I get is different from yours. Am I doing this differently?
Mika
|
|
|
|
|
I did some tests on the service-based database. When adding it to the project it actually starts SQL Server in desktop session. So the database is not added to service controlled sql server at that time. This didn't make any sense since one of the startup parameters is instance name. How can Visual Studio start the instance without knowing relevant parameters . Then I found this:
http://msdn.microsoft.com/en-us/library/ms345154.aspx#sseover_topic18[^]
Visual Studio Integration
SQL Server Express is installed with all editions of Visual Studio. Visual Studio installs SQL Server Express using the instance name SQLEXPRESS. In SQL Server Express, the applications rely on the SQLEXPRESS instance name. The goal of Visual Studio and SQL Server Express integration is to make database access with SQL Server Express as simple and easy as working with Jet. This is true not only for client applications but also for ASP.NET Web server scenarios.
This makes me wonder if there actually is any way to use non-default instances with Visual Studio...
Mika
|
|
|
|
|
Hmm, I'll try installing an instance named SQLExpress and see what happens. With regards to the error message it's a different one I think, it simply refuses to try and connect.
BTW, thanks for all the help that you're providing me with
|
|
|
|
|
Renaming the instance to SQLExpress fixes it. What a situation!
Thanks for your help and the research, I definitely owe you a
|
|
|
|
|
You're welcome
In the meantime I investigated the templates for new items under Visual Studio ItemTemplates, but I didn't find any way to define a new template against another instance name nor to change the default name of the instance to connect to. Seems that they have hardcoded this into VS. Nice...
Mika
|
|
|
|
|
Mika Wendelius wrote: Seems that they have hardcoded this into VS. Nice...
Perhaps it's because only the express edition supports user instances? Maybe they just haven't got around to refactoring it out
|
|
|
|
|
Hi All
I'm new to SQL reporting services and have bought a book on it but can't seem to find out how to do pagination on my reports.
Can anyone help?
Thanks in advance
"Sex is not the answer, it's the question and the answer is yes"
|
|
|
|
|
Is the pagination not a function of how your report is displayed - e.g. it will be differnt in a web page than in an excel file. I think the report manager (in 2005 anyway) handles it's own pagination.
|
|
|
|
|
I just want the report to display the page number in the footer but can't find how to do this?
"Sex is not the answer, it's the question and the answer is yes"
|
|
|
|
|
Hi,
- add a Textbox from toolbox
- right click on textbox
- select Expression...
- add formula to expression =Globals!PageNumber
Hope this helps,
MIka
|
|
|
|
|
Thanks, it worked perfectly! Just inquisitive to know now. Is there a way to say something like
"Page 1 of 10" instead of just the page number?
"Sex is not the answer, it's the question and the answer is yes"
|
|
|
|
|
|
Great, Thanks for the help. I really appreciate it.
Cheers
"Sex is not the answer, it's the question and the answer is yes"
|
|
|
|
|
You're welcome
Mika
|
|
|
|
|
How can I a make a bulk insert in Oracle from a csv file... like the "Bulk insert" statement in SQL server ..pls help me..
|
|
|
|
|
Hi,
SQL*Loader can be used for inserting data from a file to database. It's not a command like in SQL Server but an utility.
Hope this helps,
Mika
|
|
|
|
|
O.k, I'm re-wording my post.
How can I dynamically change the target database of some SQL code like a stored procedure or a function?
In other words...
I have this:
Execute MyDataBase..procAddHistoryEvent(@Blah,etc)
Update MyDataBase..tblWoof set WoofColumn1 = 'bark952' where WoofColumn2 = @Blah
but my solution requires something like this:
Execute @SelectedDB..procAddHistoryEvent(@Blah,etc)
Update @SelectedDB..tblWoof set WoofColumn1 = 'bark952' where WoofColumn2 = @Blah
My old post_________________________________________________________________________________________
Scenario...
Our system runs multiple DB's on a single SQL2005 Server. The DB naming is usually is not a problem since our software can be configured to which DB it should connect for which data. I.e Client1's application could connect to the DB Client1Data.
So when we restore data for debugging and don't want to overwrite an existing DB we simply restore it as (e.g.) Client1DataTest.
But...
Our software uses multiple DB's, so Client1's software also uses DB's for (e.g.) Client1Messages, Client1Mail etc. So for debugging we would load DB's for Client1DataTest, Client1MessagesTest, Client1MailTest etc.
So my question...
All our DB's run stored procedures (SP's) and in quite a few cases one DB will execute a SP on another DB with the following syntax:
Execute Client1Data..procAddHistoryEvent(@Blah,etc)
or simply select, update, delete and insert data on another DB e.g.:
Update Client1Messages..tblWoof set WoofColumn1 = 'bark952' where WoofColumn2 = @Blah
It's clear how the above is kinda hardcoded.
So when we run our system on a test DB say, Client1DataTest, it still wrongly accesses data from and executes code on Client1Messages instead of Client1MessagesTest.
Is there a better way of doing this OTHER than compiling and executing SQL strings all over the place?
Kind Regards
modified on Thursday, August 14, 2008 9:03 AM
|
|
|
|
|
Hi,
Synonyms are the helpfull for this
Mika
|
|
|
|
|
evilnoodle wrote: Our system runs multiple DB's on a single SQL2005 Server
I hope this is not the consequence of allowing your users to name the database when installing (question asked a few weeks ago). If Mika's suggestion does not help then you may need to go down the path of dynamic sql.
If the databases are identical (surely) then move the decision to the connection from the client not the procedure. Then you are executing the proc and the proc does no care what database/server it is on.
If the connection information needs to be within the proc I think you are screwed unless synonyms can help.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
id f_name l_name
1 dan silva
2 al gore
5 billy smith
6 jack wilder
9 ben douglas
11 chris ball
13 helen hunter
23 ruth south
24 sondra zelda
how can i get the row number, index for bill smith?
i dont want to get =5
i want to get =3
I created a extra column with 1,2,3,4...etc, but i don´t want to use that!!!
nelsonpaixao@yahoo.com.br
|
|
|
|
|
To get the record use and use the additional column
Select * from TableName where l_name = 'billy smith'
To get the rowindex in the table - what for! I can think of a number of reasons, most of which are in the UI.
Look into ROWNUMBER in BOL, this may help
[edit] forget rownumber look at RANK or ranking functions[edit]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
That would depend on ordering as well.
I imagine a function could be written to accomplish it, but doing so after you retrieve the data may be best.
|
|
|
|
|
Hi,
Why not...
select row_number() over (order by id asc) as Rowindex, *
from [Table]
Ryan
|
|
|
|
|
<br />
ALTER TABLE tableName ADD value int NULL<br />
<br />
DECLARE @i AS INT<br />
DECLARE @j AS INT<br />
SET @i=0<br />
SET @j=0<br />
<br />
WHILE @j<=(SELECT MAX(id) FROM tableName )<br />
BEGIN<br />
SET @j=@j+1 <br />
IF(SELECT COUNT(id) FROM tableName WHERE id=@j)=0<br />
BEGIN<br />
SET @i=@i+1 <br />
UPDATE tableName SET value=@i WHERE id=@j<br />
END <br />
END<br />
<br />
SELECT * FROM tableName WHERE value =3<br />
ALTER TABLE tableName DROP COLUMN value<br />
<code><br />
<br />
Hope it helps... <br />
<br />
<div class="ForumSig"><hr><small> <font color="Brown" size="2" face="Curier New">I Love T-SQL</font></small><br />
<small> <font color="Brown" size="1" face="Curier New">"Don't torture yourself,let the life to do it for you."</font></small><br />
</hr></div>
|
|
|
|
|
SELECT ROW_NUMBER()
OVER (ORDER BY EmployeeName) AS Row,
EmployeeId, EmployeeName
FROM Employees
|
|
|
|