Hot answers tagged

5

SSMS always truncates long strings unless typed as XML in which case you can set it to allow unlimited. The workaround I usually use (from here) is below SELECT (SELECT YourTraceDataColumn AS [processing-instruction(x)] FOR XML PATH(''), TYPE) FROM YourTraceTable This adds a few leading (<?x) and trailing (?>) characters but otherwise leaves the ...


5

There are multiple entries because you can be granted the same permission multiple times, from different "grantors". If that principal (i.e. the "grantee") were already granted that same permission from two grantors, then you would see three entries for that same permission on this screen. For the "duplicate" entries that you are seeing, the one with the ...


4

In SSMS 2016, Navigate To... is gone. So the answer is that temporary presence of non-functioning Navigate To... feature in SSMS 2014 looks like forgotten artifact of adopting SSMS to Visual Studio platform. Perhaps we should seek nothing more serious behind it. Comment: SSMS 2016 seems to be much more polished, it fixes many weird technical and design ...


4

You don't have to change the option every time. If you change the selection in Tools > Options > Object Explorer > Scripting, it should persist. As for why not scripting indexes is the default, I have no idea. Not a great question for your peers; if you really want the background, hit up someone on the SSMS team and buy them a beer - maybe they'll be able ...


3

You have several SQL Server errors in the posted message: String or binary data would be truncated. The INSERT statement conflicted with the FOREIGN KEY constraint "FK_UPC_Item". The conflict occurred in database "PosBe", table "dbo.Item", column 'Item_ID'. The INSERT statement conflicted with the FOREIGN KEY constraint "FK_VendorPartNo_Item". ...


2

Just for reference, this problem seems to be related to this bug: https://connect.microsoft.com/SQLServer/feedback/details/791630/cannot-view-properties-of-database-when-using-db-owner-account I have the same problem with SQL Server Management Studio 2012. If anyone finds stuck with this problem, try to update the SQL Server Management Studio. This way, ...


2

You could do something like this: SELECT RIGHT('00' + CONVERT(VARCHAR(2), datename(mi,GETDATE())), 2)


2

You can run SSMS as a different user via runas /netonly as described here. However for that method you would need to know the other user's password. You can also use EXECUTE AS to impersonate that user from inside a query window logged in as you (as long as you have the required permissions to do so). EXECUTE AS 'user_name'; /* Some SQL Statements */ ...


1

You just need to add a case statement to your select list: declare @bid varchar(4) = '1007' select sr.release_date, sr.customer_id, sr.customer_name, sr.item_id, sr.item_desc, sr.order_no, sr.qty_on_hand, sr.release_qty, sr.qty_after_released, sr.extended_sell, sr.enough, case when sr.route_code in ('pm 01','...


1

You may want to consider using the query that will show you free space in the log and free space in the data file. If you add them up you'll get the similar value as the SSMS is showing. This is an excellent query which does just that: DECLARE @log_used DECIMAL(19,7); CREATE TABLE #x(n SYSNAME, s DECIMAL(19,7), u DECIMAL(19,7), b BIT); INSERT #x EXEC('DBCC ...


1

The easiest and most manageable way to achieve this is using Active Directory groups. Have your ad administrator create a security group called SQL_Writers (or something similar) for those users and add them (and any new users to that group). Then in SQL Server, simply grant that security group the appropriate permissions to the server / databases. If you ...


1

You can use sys.databases joined with sys.server_principals SELECT sd.NAME AS databaseName ,sp.NAME AS database_owner FROM sys.databases sd INNER JOIN sys.server_principals sp ON sd.owner_sid = sp.SID WHERE sd.state_desc = 'OFFLINE' --> since you want for offline databases ! You can even use at your own risk --> sp_msloginmappings ( <-- ...


1

I had exactly this issue. everything was working fine until I noticed that the green indicator on the database cylinder logo (next to the instance name) became white instead of green (exactly as you have). Permissions were also fine. I restarted SSMS and connected again to the same instance and issue was solved.



Only top voted, non community-wiki answers of a minimum length are eligible