PDA

View Full Version : SQL Server Setup



NYASMark
06-09-2004, 10:30 AM
I'm currently trying to setup an application that uses SQL Server Merge Replication so it can used offline so, in the SQL Login dialog box, can and how do you retrieve the MSDE name (or the computer name) rather than using (Local)?

johnludlow
06-09-2004, 11:41 AM
In the properties for the connection, go to the advanced tab. On this page, there are names for all the properties that are used by the SQL Server configuration functionality. I believe the one for Server name is IS_SQLSERVER_SERVER

hope that helps

NYASMark
06-10-2004, 03:52 AM
Surely that only gives you (Local). What I need is the computer name, because replication does not support (local).

johnludlow
06-10-2004, 04:44 AM
Ah, right. This is still quite easy to sort out.

Go to the dialogs view>SQLLogin dialog>Behavior. Choose the Next control in the list, click the Events tab, and add a new line. The line should have the following settings:

Event: [IS_SQLSERVER_SERVER]

Argument: [ComputerName]

Condition: IS_SQLSERVER_SERVER="." OR IS_SQLSERVER_SERVER="(local)" OR IS_SQLSERVER_SERVER="localhost" OR IS_SQLSERVER_SERVER="127.0.0.1" OR IS_SQLSERVER_SERVER=" "

Basically, this sets IS_SQLSERVER_SERVER to [ComputerName] if IS_SQLSERVER has a value of any of the constants that mean "local".

You can also add another clause:
OR IS_SQLSERVER_SERVER=""

or maybe NOT IS_SQLSERVER_SERVER would do the same thing, I suppose. However, for this to take effect, you must move the event up the list, since there is already a condition on the Next button that disallows blank strings for the server name.

NYASMark
06-10-2004, 04:53 AM
Would it make a difference if that event isn't showing in the events drop down list?

johnludlow
06-10-2004, 05:01 AM
No, just type it in.

This works because you can use property names as events. The effect is that the property gets set to whatever is in the Argument field (which is of Formatted type, so [Properties] are evaluated).

NYASMark
06-10-2004, 10:18 AM
This seemed to do the trick. However, renaming the subscriber in the SQL Script doesn't want to happen even when I use the "Find and Replace" feature.

johnludlow
06-10-2004, 10:31 AM
I don't know about replication at that level. Does it work if you open the sql script in notepad?

NYASMark
06-10-2004, 10:59 AM
Thanks to that, I think I've found where I was going wrong...

There was a username in the script that didn't exist in the system.