New answers tagged ssms
If you want to insert Unicode text in your update statement you need to supply a Unicode string of the form N'...', as in update foo set test = N'褠ఓ�ᵂ뱗텬㰗' where id = 1 Otherwise the characters really are converted to question marks if SQL Server is unable to map them to corresponding non-Unicode characters, even in an nvarchar column.
By default, all logins can see all databases. This is done through the "public" role. To change that, you just have to revoke the permission from the public role. REVOKE VIEW ANY DATABASE FROM PUBLIC However, master and tempdb will always be visible to the public role. See here for more information: VIEW ANY DATABASE Permission As far as logins is ...
You can hide the system database in SQL Management Studio following Way that I have mentioned below. Navigate Tools-->Options-->Environment-->General and choose "Hide system objects in Object Explorer". OR In the SQL Server Management Studio, Right click the server and click "Properties". Click on "Permissions" and then select the "Public" role ...
This has been asked before and there are a couple of useful posts. But the work is still being left in your hands. You might check these posts: richardtallent has a post: http://stackoverflow.com/questions/1455018/replication-from-mysql-to-ms-sql AndrewSQL offered an outlined approach that got more votes at: Replicating a remote MySQL database to MS SQL ...
This is just Standard SQL join syntax with the optional parentheses removed: SELECT * FROM tableC LEFT JOIN ( TableB RIGHT JOIN TableA ON TableA.ID = TableB.ID ) ON TableB.TypeID = TableC.TypeID If you don't like the syntax generated by the SSMS view designer (which is buggy and rarely updated anyway), simply write the views by hand using ...
There's no way to do this automatically but you can query the catalogue views to find constraint names not in the desired pattern then generate the desired script that way. Something like DECLARE @Script NVARCHAR(MAX); WITH FK AS (SELECT *, 'FK_' + OBJECT_NAME(parent_object_id) + '_' + OBJECT_NAME(referenced_object_id) ...
You can use sp_rename systems stored procedure to change the name of the keys. sp_rename 'dbo.PK_TableName_OldName', 'PK_TableName_NewName';
You can use sp_rename to change the names of constraints such as Foreign Keys. The syntax is simple: From the SQL Server documentation: http://msdn.microsoft.com/en-us/library/ms188351.aspx exec sp_rename 'YourSchema.FK_OldName', 'FK_NewName'; Note that the schema is required when renaming constraints.
If it was possible to connect to a SQL Server without setting up a security context on that server, that would be a serious security hole. So, there must be a security context. If you can ride on some existing rights that are already defined, then fine, but likely any existing security context was not tailored for your need. And since you want a specific ...
I just found a post that answered this question: This may not work in all cases, but I was trying to install the Semantic Search Database and got the same error. You have to run SQL Server Management Studio as an administrator, and it works.
Never mind. Found it. sp_helptext 'TriggerName' worked like a charm.
Parse checks that the syntax of the query is correct, but it does not check the object names. It can not check object name: if you are using nested SPs with temp tables for example, the temp table will not exist when the subsequent SP is parsed (it is defined in the 'parent' sp).
I don't think there's any way to do this with a parse, but you could try running the script inside a transaction then rolling back that transaction at the end. If there's an error, it should throw it, but even if there isn't, there won't be any lasting changes.
Top 50 recent answers are included