logic apps with multiple sql connections - azure-logic-apps

i have a scenario as below.
retrieving data from topic(xml).
finding an element value(for ex: xxx ) from xml (using xpath)
depending on the value i need to connect to different sql servers.
i.e. if XXX is 10 then connect to SQLServer_1
if XXX is 20 then connect SQLServer_2
the value is dynamic here. i have 3-4 possible values for XXX and in future it may increase.
I am not able to create a logic app which connects to SQLServers based on the XXX value.
Can someone please help me on this.
Azure sql server

Related

View Connection String Information inside MS Access

I have been given a task, which is the eventual re-write, but in the meantime, I need to document all that is going on.
We have an Access database that doesn't actually store any data. The Access database is simply the UI (MS Access Forms) that a user uses and the data is actually maintained in a SQL Server database. One thing I cannot seem to find is: the connection string used for MS Access to connect to the SQL Server. I need to find what database / server is used to store the information, but cannot seem to figure this out, nor has Google been able to give me the answers. Would anyone be able to help?
Open the Immediate Window (Ctrl+G)
? CurrentDb.TableDefs("a_linked_table").Connect
will give the connect string.
Or open a table in design view and open the properties.
you can run this query:
SELECT * FROM msysobjects WHERE connect <> '';
the result is the list of the objects with a connection string that is not empty.

How to connect to MS-SQL 2012 and MS-SQL 2008 on same machine

I have a an application where you can log on to either MS-SQL 2012 and MS-SQL 2008.
Fields that can be defined are:
Server IP
Database Name
User Id and Password
Schema Prefix
Previously I had no issues with this.
Now I am puzzled.
I am told MS-SQL 2012 and MS-SQL 2008 are on same box with same IP.
I googled this arrangement and it is quite OK to do that.
I have no mental picture of how connecting to one or both of these servers might be carried out.
Are these two installs folded into one? Do they listen on the same port 1433?
Should I be able to access using just the 4 fields I can specify?
Server IP,Database Name, User Id and Password and Schema Prefix.
Help if you can, please ;-)
Tony
No, that is not enough information to reach separate SQL Server instances on the same server.
When installing multiple instances of SQL Server, only one instance can be a default instaince, the other instances have to be named instances. Thus, you also need the instance name to reach one of the databases.
However, if the IP address is not strictly only an IP address but a string, you can include the instance name. Example:
123.14.314.73\sql2012
(Note: IP addreses with components above 255 are reserved for examples and movies. ;) )

Advice on transfering data from one db to another, syntax

I'm fairly new to SQL Server. I have done basic admin, backups etc. I have also spent 2 years doing MySQL for a software company offering software support for their MySQL bespoke program. I'm mainly a tech guy (desktop, Networking) but getting my head round this DB stuff!
I have started with a company that run SQL Server 2005 and need some stuff doing, and I am struggling with the syntax more than anything. The company have 4 SQL Servers running the same db's (program wise) for 4 differing locations.
What I am trying to do is copy the updated cost price list from table 1 to the other tables with * criteria. Basically copy table.parts from server1.parts to server2.parts * currencyconvertion field * markup (%)
That bit seems to be quite easy except I cannot get the db's to link. I enter the server name which contains - and the syntax says wrong eg uk-server1 'can't find 'uk'? Also I am unsure in the 4 part address is correct servername, dbname, schema, table?
Right ok. Previously when tried I was unable to link the two servers. I have now resolved this and the server is now linked. I have been told that maybe there is a need for [] to quote'' server name. I have tried this with no success. The problem seems to be the name of the server having a - uk-efacs. as soon as I type this and remember it is now linked the herror is can't find server efacs an uk is wrong?? It's not ready the full server name? WHY?
Figured this out by trial and error just needs [] by server name ie [uk-efacs].db.table.field. This now is ok just need to work on my syntax as the query shows errors.
Try creating a Linked Server record on the server you're running this from. In Object Explorer (in SSMS) expand Server Objects, right click Linked Servers and select new. Select SQL Server and type the name of your remote server and then try your query again. Bit puzzled as the snippet you provided
update partmaster
set partmaster.fsunit = uk-efacs.efacsdb.partmaster.fsunit * uk-efacs.efacsdb.currency.currate * 1.32
Seems to parse just fine.

Executing SQL functions

I'm not a programmer, so I need assistance with executing a SQL function in SQL Server 2000.
We have outsourced some work for an iPhone app which uses a web services located where I am. Everything is set-up correctly, but the outsourcing company has asked me to execute an SQL function on the database. I have no idea where to start with this.
This is the email they sent me, I received a txt file with the function in it:
1) Please execute SQL functions in your database that is written in the attached document i.e UDF.txt.
2) Some parameters are added in query string , these are accessed as a parameter in SQL query.
("ShowWhat") = To switch between two SQL query
("latitude") = Latitude
("longitude") = Longitude
("distance") = Distance of KM in which nearby ATM located.
("page") = For which page records user want to see. (Ex: Page 1)
("strPageSize")= Results will be displayed as per size limit parameter for records.
It sounds like you need to run a script against your SQL Server 2000 database.
Find and execute the shortcut for SQL Query Analyzer whereever the SQL Server tools are installed. Likely they're installed on the server loaded with SQL Server 2000.
Connect to the database instance. It could be an IP address or host name. i.e. "localhost"
Change the database using the dropdown in the toolbar. The screenshot below shows master. Change it to whatever target database you want this function created in.
*Open the script your vendor has supplied you by 'opening' the file/script. Alternatively you could copy/paste in the text into a new Query window.
Press F5 to run the script, or click the green triangle in the toolbar.
whatever SQL statements are in the file will be executed. Perhaps it's 1 or more CREATE or ALTER statements.

How to close and open access to SQL Server 2008 in Windows application?

I'm using SQL Server 2008 (without application server or anything).
Numbers of users can be up to 1000. Windows Authentication is used.
The question is:
How to handle modes, so
some users will be allowed to work
in read-only mode
some users won't
have access to db for some time
My versions:
Using a table with a mode id for
every group of users, that will work
the same way. On Form Load
application will query that table
for mode id.
Using trigger on the tables, that
must work according to that mode.
The trigger will query mode value
and doesn't work if access is closed
or it's in read-only mode
I know these are not the best solutions, that's why I'm asking for your advice.
There's one more point.
If the mode is changed to "access-is-closed" for a group of users, that group must not be able to query to DB starting that moment.
With first solution I wrote it won't work, because user can be in application at that moment and no form load event will work. How can I do this?
Is there any optimal solution?
Thank you. Any help would be appreciated.
It depends somewhat on how you Access app interacts with the server, but for number 1 why not just use the built in Role/User permissions system in SQL Server?
For number 2, as your using Windows Authentication you can restrict logon hours in active directory on a per-account/OU basis this should prevent them from logging on to SQL server.
You could also do it via Logon Triggers which would not also prevent access to other domain resources.

Resources