SQL Tools :: HotKey To Change Server Connection In Query Window
Oct 15, 2015
Hotkey combination to be able to change the server connection from Server A to Server B in a query window in SQL Management Studio? This is so you do not have to Right click, chose "Connection" and then chose "Change Connection".
is there a way to change SSMS 2012 default query save location?
Scenario:
1. Open SSMS 2. Create new query 3. Click Save
I see "DocumentsSQL Server Management Studio" folder, but I want to change it to be "d:". How do I do this? I tried:
1. [URL]- in folder "DocumentsSQL Server Management StudioSettingsSQL Server Management Studio" there is a file NewSettings.vssettings, setting it to "d:" or "d:" didn't work.
2. Changing HKEY_CURRENT_USERSoftwareMicrosoftMicrosoft SQL Server100ToolsShell VisualStudioProjectsLocation didn't work too. There is no "Shell" under "110Tools"
Did I do something wrong, or is there another way?
I have an application that is using ADO connection strings from multiple clients. One site with about 20 users was recently upgraded to a newer version of my application, and the number of connections to the SQL Server I'm told went from about 20 to spiking over 100 from time to time. There were myriad changes to my app over the course of the last year since their prior version of my app. I need to nail down which version introduced a change in connection pooling (?) and I was wondering what tools I should use to monitor that.
I am trying to create a Datazen query against a Microsoft SharePoint List. The Data View successfully returns records from the list; however, it appears that the Query String parameter is entirely ignored. I want to use the query string to grab only records with a certain status value.
So far I have attempted specifying a View and Filters:
All return the complete set of records in the list. I do not see a single example or comment online other than the claim that SharePoint List sources are supported. How I can specify a Query String value that will filter the list records?
Howdy!Does any of you good folk know how to change window size of the DTSImport/Export Wizard window?Darn thing is very small and inconvinient to work with, no apparent way tochange it's size,may be there is a registry tweak or something.Thanks in advance,I.B.
I'm trying to write a query with named parameters/variables in the Management Studio - New Query pane. Where should I post a question about how to create parameters/variables?
I'm having some performance issues with a TSQL query. It's a complex statement but the main issue is the correlated query.
How can I convert this
SELECT TOP 5 (SELECT SUM(lt2.col3) FROM dbo.MyTable2 lt2 WHERElt2.col1 = lt.col1 AND lt2.col2 = lt.col2 AND lt2.id = lt.id ) AS Result FROM dbo.MyTable1 t1 ... to an inner join or a sql2012 window function?
By the way, I just added the TOP 5 myself while testing. It's not in the main query.
I'm looking into various technologies that can make our lives easier. I have a number of processes to define, including:
Auto rollback scripting Deployment to different environments (dev, test, production)Generation of deployment scripts from source control Tracking deployments (generation of reports detailing exactly what occurred in a deployment)
Rather than try to custom the processes, I've decided to use a technology that already does the above and more.
Can anyone recommend any tools?
I've looked briefly at SQL Farm Combine which looks good. Anyone using this?
I can't change the database owner..I noticed this when I went to create a database diagram and the error said the database does not have a valid owner.
So for that database I went to Properties > Files and sure enough, the owner is wrong. Why? I had changed the name of the PC recently, actually a couple of times. When I finally got the name right, I ran the following commands in the query window:
SELECT @@SERVERNAME to get the current server name and then sp_dropserver <old name>
[code]....
to change the server name.The owner in the Properties > Files is for a pc name that doesn't exist. But when I click on the '...' button to the right to select a new Database Owner I can't select the primary account on the PC.If I create a new database, it puts that old name in as the database owner.
I went down to <server>SecurityLogins and the old <pcname><username> is still listed, and I can't add the <newpcname><username> because it says that principle already exists . I'm afraid to make any other change without knowing for certain what to do.how to get a new database owner name on all the databases on this server.Do I delete that old Login and then try to add in the new name?
Have audit requirements that require that all schema changes to certain database are tracked and monitored. Any tools that can monitor these changes and log them for audit review?
I need to change the owner of an SSIS package. For some reason a developer created a package that is listed as <developer name>.Packagename. I'd lke to subsitute "dbo" for <developer name>TIA,barkingdog
In MSDN, it says that it is recommended to use windows authentication to connect to SQL Server rather than use mixed authentication.
I create user deltasqluser on windows OS, and I specify in my webform ASP.NET script below :
protected System.Web.UI.WebControls.Label Label1; private string _connString = @"data source=deltasql2000;initial catalog=northwind;integrated security=false;user id=deltasqluser"; /* comment : I login to my windows as deltakoronx, and I want to every user (including me), connected to sql server through IIS, will be identified as deltasqluser not as user's login (impersonate) */ private void Page_Load(object sender, System.EventArgs e) { SqlConnection conn = new SqlConnection(_connString); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "select suser_sname()";
at web.config, I add : <identity impersonate="false" userName="deltasqluser" password="" />
at IIS webApplication1's properties, tab "Directory Security", at "Authentication and access control" section, I checked "enable anonymous access" with user : DELTAIUSR_DELTA and checked "Integrated Windows Authentication",
at query analyzer, I login as "sa" and execute script below : exec sp_grantdbaccess 'deltasqluser','northwind'
when I run the ASP.NET script, error at conn.Open(); with error message : Login failed for user 'NT AUTHORITYNETWORK SERVICE'.
What should I do so that IIS login to SQL Server as user deltasqluser not as "NT AUTHORITYNETWORK SERVICE" ?
I've created a SQL Server Express Database that is used by an ASP.NET 2.0 application (developed using VWD Express).
I would like to be able to:
Make changes to stored procedures, views and table structures while developing/testing ASP.NET application - which, ideally, needs a SQL Server Manager Studio Express connection and Upload my application and data to a database on a network - which, ideally, needs a direct Database.mdf connection.
I know that I need to change my connection string - and am able to achieve that with ease - but I'm not sure what the best way of switching between the two ways of attaching on the database side. I keep getting logon type problems etc.
Login failed for user 'TOSHIBA-USERASPNET' I know that the file persmission for the web application have to include aspnet, so i keep resetting the folder permission for aspnet in file manager, but the login failed keeps coming back every day or two problem is after working with VS05 Pro, SQL Server Management Studio CTP, somehow the aspnet persmission get changed, use alot of sqldatasource wizards and often there is a conflict/hang between the datasource wizard and the need to have the mdf in a dettached state within VS server explorer, not sure but the procedure to fix this seems to be to reboot, detach and re-attach the mdf in the Sql server Studio tool, re-apply the aspnet file permission on the web app folders (wonder should i be doing this in IIS instead), make sure the mdf within server explorer is detached, the it works anyway, getting real tired of the resulting delays and design time derailment, clues greatly appreciated, thanks sometimes i can use View in Browser when in VS05 form view and i wont get the aspnet folder permission error and other times i do. last thing, is it a bad idea to give aspnet full permission for the entire web applicaiton??
I have searched every post and tried every connection string there but can't figure out how to connect to my database on my remote server. I am using Visual Developer 2005 Express Edition in C# and uploading it to a Windows server running asp.net 2.0. The domain has not resolved yet.
I am so new to this and have followed many tutorials step by step but none of them address this issue. They just show how to upload it to the server.
Do I need to use the SQL server provided by my host or can the database stay in the App_Data folder?
When I debug a page I get the <customErrors mode="Off"/> error message even thought I have already set it in my remote web.config file which may be causing problems itself:
I would like to be able to view the complete SQL command that is sent from a Microsoft Access query which has linked SQL Server tables through ODBC, and the query also has some VBA functions manipulating and filtering data.I tried using the SQL Profiler to view the sql command send to SQL Server but all I see is the simple query format and some of the fields. I don't see the fields that have a VBA function such as trim(fieldname) etc in the column. And If I use a VBA fucntion in the Criteria then nothing shows up in SQL Profiled under the TextData column.How can I see the complete SQL command sent to SQL Server?
Hi,I have a web application using Stored Procedure (SP). I see that there's a SP taking long time to execute. I try to capture it by Profiler Tool, and find out that with the same SP on the same db with the same parameter. The duration of executing by my web app is far bigger than the duration of executing on SQl server management studio - query windowPlease see the image attached http://kyxao.net/127/ExecutionProblem.png Any ideas for this issue?Thanks a lot Jalijack
I realise this'll probably seem like a very silly question, but is there any way of changing the font and font size in a query window in MS SQL Server Management Studio Express?
It would just make life a lot easier if I could see more of the text!
When one executes a query in v7.0, the results in the result window are hard to look at one as one has to scroll sideways to see the entire rpt. Is there a better way (hgighlight) to view it so I can see the whole report without scrolling sideways?
Hi , I have got an SQL query which gives me some report against some data fed in .How can I set this query to run from a browser window .Meaning there will be some form where we input the data ( say date ) and run that query from the browser windows against that data .and the results are displayed in the browser window . Thanks for your help
I am trying to transfer all jobs from one instance to another by using data tools. However, once i tried to make smo connection i am getting this error;
A network-related or instance-specific error occurred while establishing a connection to SQL Server.
In order to solve this issue i have tried these solutions;
1. SQL Server should be up and running. (OK) 2. Enable TCP/IP in SQL Server Configuration (OK) 3. Open Port in Windows Firewall (FW ACCEPTS ALL LOCAL PORTS) 4. Enable Remote Connection (CHECK OUT THE sp_configure SETTINGS, i even right-click instance then see from properties ) 5. Enable SQL Server Browser Service (sql server browser has been restarted) 6. Create exception of sqlbrowser.exe in Firewall (FW ACCEPTS ALL PROGRAMS) 7. I tried windows and sql authentication which has sysadmin role 8. INSTANCE name is also chekced millions of times
Does anyone know why a backup database statement aborts a job in a stored procedure so that you can't handle the error with @@error, but when you run the same stored procedure in a query window the error handling does get run?
Executing the stored procedure took 45 seconds. But copying the code to a query window and setting up the variables (instead of parameters), it took 7 seconds.
In the query window, most of the processing cost (86%) is right up front in a "Distinct Sort." But in exec stored procedure, the cost for this step is 11% and the significant costs are in later "Table Scans."
I don't know why SQL Server would choose different execution plans when the code is identical in each.
i have worked three days on a query to display all my results in a beautiful report. The query is fine because when i execute it in Query Analyzer i have all results i want to see in my statistics-table in my report...
One thing: it's contains about 100 unioned statements, which results in a super-long query. Performance is OK because it are all 100 very easy statements that are union-ed together.
But, when I copy-paste it in my query-string window/textbox of the report designer, I see that there's a maximum on that textbox lenght, which results in the fact that my long query suddenly stops.
Bit of a strange one here. We have a SQL Express instance running with one database which is accessed by a VB6 client application.
Performance between the application and the database isn't great, but bizarrely if you open a Query window from the Management Studio (against the database) the performance dramatically improves - to the extent that it is visually noticeable from within the application.
So, I'm thinking that the database connections being made by the application are taking longer because of instance name resolution or the like and with the Query window open this resolution is performed quicker.
Has anyone come across this situation? I can re-create it on several different computers each with their own Express instance and I've not found anything about this on the net.
Here's the connection string used by the application - I have tried various permutations of values to no avail:
Our app has been distributed on more then 300 different sites. On one of the sites we get the error "Could not continue scan with NOLOCK due to data movement" indicating that the query optimizer takes a NOLOCK for our select statement ( has been opened with adOpenDynamic, adLockOptimistic ).
It's no option to change the source, we have to solve this without touching the code.
Is there any way to tweak the query optimizer so that our app works correctly? I know that there will be a reduction of performance but it's our only choose.
Need to change vertical execution of query into horizontal in sql server
SELECT TL.TERMINAL_ID,T.IP_ADDRESS, T.LOGICAL_CONNECT_STATUS, SI.SCHEDULER_ID, SI.INSTRUCTION, SI.GROUP_ID, SI.MAX_READ_RETRIES, SI.DATA_CHAR, SI.SCHEDULE_TYPE,SI.FILEPATH_FLAG, T.STATION_NAME,T.BANK_ID FROM SCHEDULERINFO SI WITH (NOLOCK) INNER JOIN TERMINALGROUP TG WITH (NOLOCK) ON SI.GROUP_ID = TG.GROUP_ID INNER JOIN TERMINALGROUPLINK TL WITH (NOLOCK) ON TG.GROUP_ID = TL.GROUP_ID
Can anyone tell me if you can display line numbers in the query windowof SQL 2005 Management Studio and if so how do I go about doing it?Thanks a bunch. TFD