Oracle SQL developer bug - sql

I'm trying to create a table with the create table GUI. It doesn't let me change the table names. Most of them are still on 'COLUMN'.
I tried editing using the GUI but the names revert back to 'COLUMN'.
It doesn't always automatically create a DDL. when it doesn't, it doesn't change/edit my table.
I've tried installing a different version but mlno luck.

Related

Fixing a broken database .NET

Okay so I am working in Web Forms but the problem would also apply to MVC I am assuming since both have the option of creating a users database on project creation. I deleted a data table on accident and updated the database instead of deleting the database itself because I was trying to recreate it with the seed data. I didn't realize that deleting a data table would do something different from deleting the database itself. The only backup I have is pretty old, so I would prefer to use a different way to fix things if that exists. How would I fix things?
I have it working now. What I did to fix it was I went to my back up although it could have just been a brand new project, both would have been fine, and I copied the SQL script for the data table that I deleted. Then I went to my broken program and created a new data table in the spot where it was before and replaced the code with the code from the back up. I saved it and hit update and it updated the database for me.

BigQuery browser tool doesn't reflect table schema

We have a table in BigQuery, and we wanted to change the column name. So we queried all columns, and the one that we wanted to change we used an alias to rename it. It appears to have worked, however the table schema in the browser tool still shows the old column name. We refreshed the project, and it still shows the old column name.
We renamed the field from "has_info" to "ct_info":
Is this a bug in the UI?
This is an issue with the UI. The problem is that the UI has cached the schema from the old version of the table, and doesn't realize that it has changed. A complete browser-level reload of the table will fix the problem.
I'll file a bug to see if we can improve this.

Peculiar happenings in SQL Server

I have just started an internship in I've had to learn a lot on my own. I'm learning MS SQL Server, but having a strange problem. I have a DB that has four small tables. Each one has a script to drop the table, recreate the table (I've avoided FK dependencies for the time being), and execute a demo query.
Problem 1: When I first started SQL Server Managmenent Studio would execute the script, but one table didn't show up in the Object Explorer. If I tried to execute a demo query from the same .sql file, it executed with no problem. If I tried to access it from another .sql, the table didn't exist. After many times of successfully executing the script, it finally just showed up.
Problem 2: Similar problem. When I updated one table, the changes wouldn't be reflected in queries.
Problem 3: Queries will fail, but if I click execute again with no changes being made, it will usually work correctly.
Problem 4: When I use an alias for a field name, sometimes the alias is recognized and sometimes it isn't. I've literally had single query in which the alias would work in one place, but not work in another and I had to use a fully qualified name.
I've tried the refresh and refresh local cache, but those seem to have no effect. If I exit Management Studio, that seems to usually fix the first two problems.
Am I going nuts or am I just in the dark about some weird specifics of SQL Server?
First of all, when you make a schema change you need to right-click on the "Tables" node for the database in management studio and hit refresh.
If you change a column or something in a table, right-click the table and refresh.
The refresh local cache only updates the intellisense stuff, and the refresh only updates the GUI. If you modify a table with SQL and do not refresh it in the UI, the query can still use the updated table.
If you query fails, you either have a bad query or it's not pointed at the database or connection you think it is.
For aliases, there are places where they will not work (update statements, for example) but if you don't post queries where they don't work we cannot read your mind and tell you what's wrong.
If you have specific queries that are failing, post them.

How can I make pentaho spoon auto-create a table?

I am having few issues with pentaho spoon: I want to copy a table from one database to another.
When I click on "copy table" in the tool menu, it auto creates the transformation for that. But when I run it then I get these issues:
The truncate table is ticked that's why I get the error that my table does not exist.
I have to manually un-tick that. Even then I get an error because the table is not created. I have to click on the SQL and then execute the query. Is there any way to automatically do it?
Third problem is that pentaho created table is not detecting the date field, so it's putting the date type as UNKNOWN. I have to manually change that to varchar. Is there any way to fix that or default to VARCHAR?
The UNKNOWN data type is typically a driver issue. What database are you using and do you have the right driver?
There is no way to automate the creation of the table within PDI - it's deliberate that it does not do this. You could however integrate PDI with a tool which does do this, something like dbDeploy is a good idea.
UPDATE There is now a way to automatically create tables, you can follow the blueprint here:
https://github.com/mattcasters/blueprints

Is there a special sp on SQL server 2008 to get a table change script?

I wonder how management studio generates the change table scripts each time i change a table, especially when i change the datatype from 'text' to 'varchar(max)'.
Peace,
Ice
Update: Concerning the already given Answers i want to precise my question, after say thank you for your posts.
Now, it is like already said, ssms generates the scripts on demand but i want to write a script to identify all the tables in a given database with datatype [text] and change them to [varchar(max)]. So the easy part is to scan the dictionary to find the tables and columns, the harder part is to generate the mentioned scripts which copies all the rows into the new structur.
--> Yes i can work manually thru the list of tables and click in ssms to get the scripts, but there are almost 200 tables... better a computer do that work, isn't it?
If what you're asking is "Given a table, is there an easy way to get the DML used to create that table?" then I don't believe you can just run a system SP and get it. You'd need write something that selected from the system tables to get columns and datatypes, indexes, and everything else.
I wish there was an easy way to generate the same scripts SSMS does (like right-click -> "Modify" on a stored procedure), but it doesn't seem to be that easy.
When you change a table using the Management Studio table designer, the script is already prepared in the background, and you can simply click on the "Generate change script" icon to view it (and copy it if you like).
In SQL 2008, the "Generate change script" option is in the "Table Designer" menu.
If you're asking what it does, it's quite simple: SQL will create a new table with the new structure, copy all the data from the old table, drop the old one and rename the new one. If you open the script as described above, you'd see that.