Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

mikecrengland
Not applicable

Select @@SERVERNAME

Hello All -

Our DBAs are suspicious of a connection string that we are using in our scripts. They asked if I could run Select @@SERVERNAME  to verify the connection, but I'm not sure how to make it work or if it's possible.

Any ideas?

Thanks!

Mike

Tags (1)
1 Solution

Accepted Solutions
Miguel_Angel_Baeyens
Not applicable

Re: Select @@SERVERNAME

If SELECT * FROM table does not work, there is definitely an issue with the permissions in the user that QlikView has n the connection string or the one defined in the DSN. If you cannot run queries with that user, then I don't know how else you can provide any useful data. They can see which IP is connecting the server, if that matches with Production server you are hitting then Production.

While LOAD is always a good idea, for this test there is no need to use it.

6 Replies
Miguel_Angel_Baeyens
Not applicable

Re: Select @@SERVERNAME

Yes, you can do that in the script, for example. If the driver supports that, that will return a field with the servername.

mikecrengland
Not applicable

Re: Select @@SERVERNAME

Thanks, Miguel. But I guess I'm doing something wrong.

I simply have the connection string, then:

@@SERVERNAME;

But get an error:

OLEDB read failed

Select @@SERVERNAME

The driver is:

Provider=SQLOLEDB

Do you see anything there that would make it fail?

mike

Miguel_Angel_Baeyens
Not applicable

Re: Select @@SERVERNAME

If you do any SELECT * FROM table does it work? (A simple one just to test that the connection is OK)

Has the user permissions to check that variable (i.e.: logging in as that user in SQL and selecting, does it return anything)?

mikecrengland
Not applicable

Re: Select @@SERVERNAME

SELECT * FROM table does work. I used the command from SQL Management Studio and it worked.


The database that we think we're hitting is a replicated reporting DB, but the DBAs seem to think it's hitting production. So they asked me to do this to prove it one way or the other...


Would it need some LOAD statement before the @@SERVERNAME ?

Miguel_Angel_Baeyens
Not applicable

Re: Select @@SERVERNAME

If SELECT * FROM table does not work, there is definitely an issue with the permissions in the user that QlikView has n the connection string or the one defined in the DSN. If you cannot run queries with that user, then I don't know how else you can provide any useful data. They can see which IP is connecting the server, if that matches with Production server you are hitting then Production.

While LOAD is always a good idea, for this test there is no need to use it.

mikecrengland
Not applicable

Re: Select @@SERVERNAME

Thanks!