Все вопросы: [ssms]

171 вопросов

23
голосов
5ответов
24471 просмотров

How do I search for a ', ' and replace with ', '<cr><lf> in SQL Server Management Studio's editor</lf></cr>

I have a long query that I'd like to replace the , with a carriage return to put all the fields on their own line but I can't figure out how to do it in the editor. It wont be fool proof, but better than doing it by hand.

163
голосов
7ответов
169473 просмотров

How do I make a composite key with SQL Server Management Studio?

How do I make a composite key with SQL Server Management Studio? I want two INT columns to form the identity (unique) for a table

6
голосов
3ответов
2669 просмотров

Why does SQL Server Management Studio generate code using square brackets?

When generating code/scripts, why does SQL Server Management Studio generate code using square brackets and not double-quotes? SELECT [NAME] FROM [TABLE] and is there a way (setting/registry entry) to configure it to use double-quotes (the standard) instead? SELECT "NAME" FROM "TABLE" T...

0
голосов
1ответов
390 просмотров

Microsoft SQL Service Management Studio 2005 'Script XXX as CREATE To' problem

When using the 'Script Index as CREATE To' to duplicate an index from one table to another table I am not able to run the script. Without editing the generated code I get an error. I get the same error when working with any 'Script XXX as CREATE To' generated code. Any comments/suggestions to sol...

6
голосов
6ответов
1397 просмотров

SQL Server VARCHAR(10)

When desiging a table in SQL Server Management Studio 2005, if I specify VARCHAR(10) for a column, when I tab away from the data type, SQL Server changes it to VARCHAR(50). I have to then tab back, change it back to VARCHAR(10), and it will then accept it. I understand that there are storage and...

117
голосов
4ответов
289075 просмотров

How to quickly edit values in table in SQL Server Management Studio?

Aside from context menu -&gt; "Edit Top 200 Rows" from Object Explorer, is there a quick way to open a table in Edit mode where I can just quickly modify the value of a cell? I need to be able to page past the first 200 rows. And I dont want to write "insert" script for every minor tweak I nee...

1
голосов
1ответов
513 просмотров

How to: usage-based performance optimization in SQL Server 2008 Express

How can I do usage-based perfromance optimization if I am running SQL Server 2008 Express and using SQL Server Management Studio Express?

1
голосов
1ответов
436 просмотров

Management Studio 2008 Express Install issue

I have some trouble installing Management Studio 2008 Express through C#-Code. The code looks like this: using (Process MMSInstall = new Process()) { var psi = new ProcessStartInfo(PathExe.FullName, "/qs /Features=SSMS /Action=Install"); MMSInstall.StartInfo = psi; MMSInstall.Start(...

0
голосов
1ответов
198 просмотров

Why is the database diagrams view still showing dropped tables

Using SQLServer 2005 I have dropped some tables (via a T-SQL query) and they are still showing as tables when creating a database diagram! Already tried refreshing, disconnecting and reconnecting.

138
голосов
6ответов
149181 просмотров

How do I create a SQL table under a different schema?

This is from SQL Server 2008, ssms When I create a table, it creates under dbo. I would like to create it under a different schema, but when I use the 'New Table' dialog, I can never find the field where to specify this.

1
голосов
2ответов
476 просмотров

Management Studio 2005: Will Cancelling a Statement trigger a Rollback?

A few minutes ago, while working out a new sproc, I executed the wrong delete statement. Something like this: Delete From SomeTable Where SomeStatusID=1 10 seconds into it, I realized that I typed in the wrong status and hit cancel. It said that the statement was canceled. I did a restore to ...

2
голосов
3ответов
2081 просмотров

SSMS and SQLCMD displays only the first 8000 characters

In SSMS when I try to execute: SELECT CONVERT(VARCHAR(MAX), REPLICATE('a',9000)) I see only the first 8000 characters displayed. The settings Tool&gt;&gt; Options&gt;&gt; Query Results&gt;&gt; Sql Server&gt;&gt; Results to Grid is set to 65534 and Results to Text is set to 8192. Also wh...

342
голосов
16ответов
461904 просмотров

sql server invalid object name - but tables are listed in SSMS tables list

I am attempting to create a Stored Procedure for a newly created database. However the SSMS intellisense does not recognize more than half of the tables which have been created. For example whilst in the left hand column under tables I have a table dbo.Room, when I type "dbo." in the new query ...

0
голосов
1ответов
60 просмотров

Script to automatically open SQL Server Management Studio 2005 from another interface

Please I need help with a script that can help me open the SQL Server Management Studio 2005 from a button in an another interface. Thanks Roger

1
голосов
2ответов
723 просмотров

Script to automatically open SQL Server Management Studio 2005 from another interface

Please I need help with a script that can help me open the SQL Server Management Studio 2005 from a button in an another interface. Thanks Roger

25
голосов
9ответов
63044 просмотров

How can I execute a single query in SQL Server Management Studio?

Background: I'm using SQL Server Management Studio 2008 and I have a query window open that contains multiple queries. Is there a keyboard shortcut that will allow me to execute a single query without highlighting the query I would like to run first? Some other SQL tools have shorcuts that run ...

32
голосов
3ответов
12842 просмотров

Keyboard shortcut to close a tab in SQL Server Management Studio?

Is there a keyboard shortcut to close a tab in SQL Server Management Studio 2008? like Alt-W in Firefox.

1
голосов
1ответов
304 просмотров

Integrating CVS with SSMS 2005?

Currently, I produce various .sql scripts (sprocs mainly) and have to copy them to another location where I had originally checked out a CVS project before I can add/update/remove the CVS repository accordingly (using TortoiseCVS). It's tedious, so I've been tasked with investigating if SSMS cou...

2
голосов
2ответов
2281 просмотров

SSMS in SQLCMD mode - Incorrect Syntax

It is my day for weird errors. I use a database project and as a part of Post Deployment, we use SQL Scripts to populate data in our tables. alter authorization on database::atlas to sa; go ALTER DATABASE ATLAS SET MULTI_USER WITH ROLLBACK IMMEDIATE; GO :r C:\Scripts\Script.DisableTriggers.sq...

3
голосов
6ответов
3329 просмотров

Creating a CHANGE script in Management Studio?

I was wondering if there is a way to automatically append to a script file all the changes I am making to my columns, tables, relationships etc... The thing is I am doing a lot of different changes on a TEST db and the idea will be to apply this change script when I move the test db to productio...

16
голосов
4ответов
15671 просмотров

Generate SQL server scripts from command line?

In Microsoft SQL Server Management Studio 2008 there is a "Generate scripts..." option under the Tasks menu. I'm just wondering if this tool is available from the command line somehow? It looks similar to the sqlpubwiz.exe command line tool that was available for SQL Server 2005, but I can't f...

1
голосов
2ответов
406 просмотров

Visual Studio &amp; SQL Management Studio: How to revert Ctrl+Tab behaviour to normal after using Microsoft Narrator?

By default, in Visual Studio and in SQL Server Management Studio, Ctrl+Tab opens a navigation popup which lists all the open windows. The idea is that you can press Tab multiple times while keeping Ctrl pressed; as soon as you release Ctrl, the navigation popup disappears and the selected documen...

19
голосов
2ответов
5623 просмотров

Stop SSMS from scripting SPs using sp_executesql?

When I use SSMS to script a stored procedure, it wraps the script in a sp_executesql statement which bugs me. Is there a way to stop SSMS from doing this and use a straight CREATE PROCEDURE...? EDIT: I meant SSMS not SSIS

1
голосов
1ответов
3465 просмотров

Case Sensitivity in SSMS

My SQL Server Management Studio suddenly went case sensitive on me. The database and server are both set to case insensitive SQL_Latin1_General_CP1_CI_AS I run queries like Select * From mytable and I get "invalid object name" but if i run select * from MyTable i get data!! I created...

1
голосов
5ответов
308 просмотров

Nonsense Error in SQL Server Management Studio

I have this query that spawns the following error: SELECT * FROM Quota WHERE LEFT(QtLabel, LEN(QtLabel)-2) IN ( '1032', '3300', '9682' ) Msg 536, Level 16, State 5, Line 1 Invalid length parameter passed to the SUBSTRING function. Am I doing something wrong? It tends to show up when I u...

130
голосов
2ответов
37013 просмотров

SQL Server Management Studio SSMS tries to "save to file" instead of execute on F5

This happens intermittently and seems to be related to accidentally hitting a key. Any ideas what causes this?

55
голосов
5ответов
89265 просмотров

How get the T-SQL code to find duplicates?

MS Access has a button to generate sql code for finding duplicated rows. I don't know if SQL Server 2005/2008 Managment Studio has this. If it has, please point where If it has not, please tell me how can I have a T-SQL helper for creating code like this.

40
голосов
2ответов
34669 просмотров

how to print database diagram sql

I would like to print a SQL Server database diagram. I'm using SQL Server Management Studio, I right clicked on the diagram, and selected "View Page Breaks". I wanted to have the diagram in A3 Format but when I tried to print it had 4 pages. Is there a way to print the whole diagram in just on...

3
голосов
1ответов
3292 просмотров

Microsoft.SqlServer.SqlTools.VSIntegration reference problem/oddities in Visual Studio 2010

SQL Server Edition: 2008 Enterprise Visual Studio: 2010 w/ .NET 4.0 SSMS 2008 Addin - Data Scripter project source code on CodePlex references Microsoft.SqlServer.SqlTools.VSIntegration.dll I have referenced the DLL under &lt;&lt;Microsoft SQL Server install location&gt;&gt;00\Tools\Binn\VSSh...

8
голосов
1ответов
1394 просмотров

Remove the date/time in SQL script generated using SSMS?

When I generate scripts in SQL Server 2008 Management Studio, it seems to insert the date/time in the script also. For example: USE [AdventureWorks] GO /****** Object: View [dbo].[vw_test] Script Date: 18/01/2017 3:27:10 PM ******/ SET ANSI_NULLS ON GO &lt;rest of script goes here&gt; Ho...