Showing posts with label window. Show all posts
Showing posts with label window. Show all posts

Thursday, March 29, 2012

drag and drop .sql scripts problem

In SQL 2000 we used to be able to drop and drag one or more scripts into a
query window with being prompted for a separate connection for each script
file.
Is there any way do stop MSSQL 2005 from prompting for separate login
credentials for each and every script?
Thanks.D. Haber (DHaber@.discussions.microsoft.com) writes:
> In SQL 2000 we used to be able to drop and drag one or more scripts into a
> query window with being prompted for a separate connection for each script
> file.
> Is there any way do stop MSSQL 2005 from prompting for separate login
> credentials for each and every script?
This is certainly a request often heard about Mgmt Studio.
The best workaround is to use Ctrl-Shift-P or Edit->Insert->File from
with the tool.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Drag & Drop Multiple Query Files Into Management Studio

In SQL Server 2000, you could have a Query Analyzer (QA) query window open to a particular database, and drag and drop a group of query files from Windows Explorer on it. QA would then open a query window for each of the files, and automatically default it to that database.

I am trying to get the same functionality in SQL Server 2005 Management Studio, but it nags me with the "Connect to Database Engine" dialog box for every file. Worse still, it will not default to the same database being used by the query window on which it was dropped. And to add insult to injury, it makes you click the options button to change to other than the default database. The behavior is the same in both the tabbed and MDI environment.

I have looked for settings that would affect this behavior, but didn't notice any. Does anyone know if this behavior is possible with 2005? If so, how to you implement it? Thanks.

Kevin

Did you find an answer to your problem? I have just started using SQL Server 2005 and I am having the same problem.

Thanks

Danny

|||

Even if I use "open file" to open saved queries I get asked each time to connect to the database engine. What am I doing wrong?

Thanks

Danny

|||Unfortunately I still have not found a way around the problem. I assume it's something we will have to live with.|||

One of the solutions would be to create a SQL Project with connection info and the related query files as members of a the project. This is similar to the VS project model

You can have multiple projects with different connection settings in a solution.
You may also be able to leverage the new SQLCMD internal commands to embed the connect statement within your scripts.

Thanks,
Ramesh

|||There must be an easier solution to this. Shocking!|||

Please raise a suggestion at the product feedback centre

http://lab.msdn.microsoft.com/ProductFeedback

|||Added a suggestion - http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx?feedbackId=FDBK48385

Drag & Drop Multiple Query Files Into Management Studio

In SQL Server 2000, you could have a Query Analyzer (QA) query window open to a particular database, and drag and drop a group of query files from Windows Explorer on it. QA would then open a query window for each of the files, and automatically default it to that database.

I am trying to get the same functionality in SQL Server 2005 Management Studio, but it nags me with the "Connect to Database Engine" dialog box for every file. Worse still, it will not default to the same database being used by the query window on which it was dropped. And to add insult to injury, it makes you click the options button to change to other than the default database. The behavior is the same in both the tabbed and MDI environment.

I have looked for settings that would affect this behavior, but didn't notice any. Does anyone know if this behavior is possible with 2005? If so, how to you implement it? Thanks.

Kevin

Did you find an answer to your problem? I have just started using SQL Server 2005 and I am having the same problem.

Thanks

Danny

|||

Even if I use "open file" to open saved queries I get asked each time to connect to the database engine. What am I doing wrong?

Thanks

Danny

|||Unfortunately I still have not found a way around the problem. I assume it's something we will have to live with.|||

One of the solutions would be to create a SQL Project with connection info and the related query files as members of a the project. This is similar to the VS project model

You can have multiple projects with different connection settings in a solution.
You may also be able to leverage the new SQLCMD internal commands to embed the connect statement within your scripts.

Thanks,
Ramesh

|||There must be an easier solution to this. Shocking!|||

Please raise a suggestion at the product feedback centre

http://lab.msdn.microsoft.com/ProductFeedback

|||Added a suggestion - http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx?feedbackId=FDBK48385

Friday, March 9, 2012

DOS ODBC Driver

Does anyone know of an ODBC driver that can be used from
DOS? ie not from a DOS window, but from a system booted
into DOS 6.22?
Wanting to read a SQL or Access Database after making a
network connection from DOS.
Thanks,
Rob
There is not an ODBC driver for DOS.
Rand
This posting is provided "as is" with no warranties and confers no rights.

DOS ODBC Driver

Does anyone know of an ODBC driver that can be used from
DOS? ie not from a DOS window, but from a system booted
into DOS 6.22?
Wanting to read a SQL or Access Database after making a
network connection from DOS.
Thanks,
RobThere is not an ODBC driver for DOS.
Rand
This posting is provided "as is" with no warranties and confers no rights.

Sunday, February 26, 2012

domain user belonging to multiple windows group

If I have a domain user DOMAIN\user1 who belongs to multiple window groups say DOMAIN\LookupConfigUsers and DOMAIN\AuditConfigUsers. In sqlserver, I would create two logins - DOMAIN\LookupConfigUsers and DOMAIN\AuditConfigUsers and matching users in the database. Then I grant LookupConfig role to the LookupConfigUsers user and AuditConfig role to the AuditConfigUsers user in the database. When DOMAIN\user1 logs in, will it have both roles? I try to set this up but it does not seem to work. The domain user only picks up one of the role. Am I on the right track? If not, what is the proper way to grant multiple roles to a user when it belongs to multiple groups and each group has different privileges in the database.

Based on the scenario you described, DOMAIN\user should be a member of both roles ( LookupConfig role & AuditConfig role). You can use the following script to take a look to the login and user token on the current connection:

SELECT name, type, usage FROM sys.login_token ORDER BY type, name

SELECT name, type, usage FROM sys.user_token ORDER BY type, name

go

In the login token you should be able to look at all the server and Windows groups that are part of the token, while on the user token view you should be able to see the database roles and Windows roles that are part of the context.

The usage column will tell you how each row is used, typically it should be “GRANT OR DENY”, which means that row is being used to evaluate for both granted and denied permissions, while a “DENY ONLY” value means that only denied permissions will be honored.

Please let us know the results of this query. If you see both roles, my guess would be that either LookupConfig or AuditConfgi role has an explicit denied permission that is affecting the permission check.

Thanks a lot,

-Raul Garcia

SDE/T

SQL Server Engine

|||

It works now. It's actually my fault. I had one group defined initially and later when I add the other group, I simply disconnect and reconnect from the Management Studio. It did not pick up the new group. Today, I tried closing the Management Studio and reopen it, and it picks up both groups and roles. Your sql statements above showed me exactly what I expected - domin\user belongs to both LookConfig and AuditConfig Role.

However, I don't understand why it also belongs to the public role?

Also, the login_token output names like -

NT AUTHORITY\Authenticated Users, NT AUTHORITY\INTERACTIVE, NT AUTHORITY\NTLM Authentication, domain\None, \Everyone, etc...

What are these groups?

I am new to sqlserver and windows authentication. Any help would be much appreciated.

|||

No problem, we are happy to help.The public role is a role that everyone in the system belongs to, think of the public as “Everyone”. If you grant any permission to public, everyone will get it. This behavior is automatic and cannot be changed.

Regarding the other Windows groups in the login token. To generate the SQL Server login token we take the token from the Windows client connection and get every group from it. You can double check it in Windows using the whoami tool (i.e. whoami /groups).

I hope this information helps. Let us know if you have any further question, we will be glad to help.

Thanks a lot,

-Raul Garcia

SDE/T

SQL Server Engine

Domain to DMZ Question

How do you setup replication without using window authentication when trying to replicate from a domain to a workgroup in the DMZ, without using trusts?
use sql authentication and FTP.
"JLS" <jlshoop@.hotmail.com> wrote in message news:Ot6P$$MHEHA.3196@.tk2msftngp13.phx.gbl...
How do you setup replication without using window authentication when trying to replicate from a domain to a workgroup in the DMZ, without using trusts?