how to rename sql server tabs - ssms

I used to be able to rename the tabs in sql server in my old company. The sql server looks the same in my current company, but i'm not able to completely rename the tabs, and it gets confusing when many tabs are open.
(I'm able to add new names to the name that's already there. e.g. the tab is now called "SQLQuery20.sqlComputernameuser". And I'm able to rename it to "NewnameSQLQuery20.sqlComputernameuser". But I would like it to just be called "Newname" instead.)
Thank you!

Short answer: you can sort of do this still, but with SSMS 2012 and later, you're limited to using the sql file name, db name, etc. and you can't just type in the name directly anymore. The solution linked to below still should be helpful for you!
See this question I found titled Manually Rename Tabs in SSMS
Good luck! Please mark this as the answer if it's sufficient for you :)

Related

can't see tables in SQuirrel

I am using a HSQL driver to connect to my database. I am able to connect without any errors but I can't see any of my tables in the table tree under public. I am able to create new tables which do appear, but I can't see the already created ones. Also when I check the .script file I can't see the new tables. Something strange is going on but I can’t work out what.
Anyone able to help.
I've worked it out now. It was the format of the connect string for HSQL.
I needed to add :file: in the string like this... jdbc:hsqldb:file:
Also I was using .script at the end of the file name, like this jdbc:hsqldb:.script
This was creating temp files in the format .script.lck .script.log etc.
Dropping the .script at the end of the file name opened up the database and allowed me to see the tables. Now my problem is I can't get any updates to commit. Updates happen with no errors in the console. But when I close the file and check the .script file the data is the same. Permissions I guess.
Only posting this answer to help others that might get stuck at the same point.
Try here:
How can I list all tables in a database with Squirrel SQL?
Where most of us fails is to choose the right schema in the Catalog dropdown. (Just above the Objects tab). But there are other ideas if you follow the related question.

Microsoft Access ADP view designer always adds _1 to tables and does not show the fields inside each table

The view designer inside Microsoft Access ADP always adds _1 to all table names, also all table fields are not shown. The only thing that shows inside the table is *(All Columns)
I have tried access 2007 and access 2010 and both have the same output.
Every view inside the database is shown in this way, and the fields never show.
This problem is within a specific database. Other database show normally.
I am forced to make my changes inside the SQL Sever.
I found something on the Microsoft website that says if the database server driver does not have permission then the fields will not populate, but I cannot seem to find a solution.
Please help!!
I found the solution, if someone else has the same issue.
Turns out that the database name included the "." and space character, and this was the source of the problem even though everything else worked fine. Access was not finding the table fields. I renamed the database and the problem was solved.

Create a log for all SQL action in Access

I'm currently having a problem at work.
Someone in the is modifying the table directly.
For example in my database I have school names like ETS. Well, today it was named Polytechnique.
What I'm trying to tell who did this modification either by his/her IP address or any other way. I currently have no ideas on how to proceed.
What I would like is just the beginning of a solution as to let me figure a part of it . I sadly don't have any ideas for the moment.
Thank you (I'm sorry for any errors english is not my first language. Also I could be mistaken for the tags)
(Welcome to SO. Sorry no one answered your question yet. It almost never takes this long.)
The short answer is: No. There is no way to find out who was modifying your tables directly. Access does not have any kind of automatic change logging, and you cannot create any logging procedures in VBA that will monitor manual changes to the tables.
One of the requirements for Access as a front-end is that you trust your end-users to not open tables and edit the data directly.
To prevent this in the future, here are some options:
Right click on your table to hide it. However, the user can just unhide it if they know it is there.
In your Access db is an option called "Display Navigation Option". Disabling this will hide the side-bar so the user can't see the tables. However, pressing F11 will still display them again. This can be easily googled, so I don't recommend it if your users are motivated.
Store your data in a SQL server and use connection strings (not direct links) to retrieve and store information.
Distribute your Access db via Sharepoint. The user will only be able to access the forms you specify and will have no direct access to the tables.
Consider another software package for your problems.

Referencing external database in a View?

In a project on which I am performing maintenance, I am referencing a database stored on another server. This reference was previously pointing at a database on the same server, but my testbed server isn't large enough to store both databases, so I'm having to refer back to the live database.
Anyway, whoever created this application made use of SQL Views, and I have found that when trying to edit the view, that it cannot reference an external database.
The existing reference is to myDatabase.dbo.tableName. When I try to change that to [MyServer.com].myDatabase.dbo.tableName moving away from the editor removes all of the square brackets, leaving me with MyServer.com.myDatabase.dbo.tableName which is not a proper table reference.
Any ideas what I can do to fix this?
It looks like you have added a linked server with the name "MyServer.com" I suggest you rename this to something without the dot, MyServerCom would be fine. Its ok if the details in the linked server point to a server that happens to be at that address.
Then the four part name can be MyServerCom.myDatabase.dbo.tableName
Don't edit the view definition in Enterprise Manager - use query analyser to script the view for ALTER, make the appropriate changes, and then run the script.
Enterprise manager does some fairly nasty things. I'd similarly recommend scripting an ALTER rather than using the "Design" option if you're using SSMS to manage your server/database.

SQL behind an external data query in Excel

I have inherited an Excel spreadsheet which contains an external data query. I can edit the query, which provides a list of the columns returned, but it does provide the table that this data comes from. Is there any way to retrieve the actual SQL behind the query?
I think this may depend on the version of office you're using and the type of external data you're connecting to.
I believe if you're using Office 2003, and you're seeing columns like you say, there may be a SQL icon in the toolbar.
Click that to view the SQL used to return the data.
If you're using Office 2007, Go to the Data tab, click connections, then properties, then the definition tab, and change the command text.
However I believe you're using the first method.
This is from what I can remember, so I hope it's correct.
It could also be somewhat obsfuscated by using an ODBC link or something. Another way to get it is to run SQL Profiler on the SQL Server to see the exact SQL being executed. Of course, this won't help you edit it but you'll know what it is doing.