If I want to save any changes in a table, previously saved in SQL Server Management Studio (no data in table present) I get an error message: Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can’t be re-created or enabled
Join 2 Tables and display everything
I have 2 simple tables: table a: id | txt —+—- 0 | aaa 1 | bbb 2 | ccc table b: id | tel —+—- 0 | 000 2 | 111 I am trying to join 2 tables like this: SELECT a.*,b.* FROM a,b …
Which is the most common ID type in SQL Server databases, and which is better?
Is it better to use a Guid (UniqueIdentifier) as your Primary/Surrogate Key column, or a serialized “identity” integer column; and why is it better? Under which circumstances would you choose one over …
Variables in TOAD scripts
I have a SQL script that is being executed in TOAD. Currently, I have it laid out with just statement after statement, thusly: And so on. Some of the where clauses end up being repetitive because I have complex inner queries to get particular IDs to operate on. I’d like to capture the ID in the beginning of the script
Seeing the underlying SQL in the Spring JdbcTemplate?
I am learning about the wonders of JdbcTemplate and NamedParameterJdbcTemplate. I like what I see, but is there any easy way to see the underlying SQL that it ends up executing? I’d like to see this for debug purposes (in order to for example debug the resulting SQL in an outside tool). Answer The Spring documentation says they’re logged at
Fetching 3 tables at a time, retrieve only the table which matches the condition (SQL)
I have 3 tables: WATER_TENDER,ENGINE and TRAILER. All of them have the EQ_ID as primary key and some other attributes, different for each table. for example, EQ _ ID=’WT-123′ points a row inside the …
How to see the values of a table variable at debug time in T-SQL?
Can we see the values (rows and cells) in a table valued variable in SQL Server Management Studio (SSMS) during debug time? If yes, how?
Does SQLite support replication?
In an application which embeds SQLite3 and uses an in-memory database, is it possible to replicate the database between two running instances of the application? I could do this by hand with a homebrew protocol duplicating all my DB accesses, but it seems like something that should be done inside the DB layer. Answer Brute force approach: Send it the
MySql – Way to update portion of a string?
I’m looking for a way to update just a portion of a string via MySQL query. For example, if I have 10 records all containing ‘string’ as part of the field value (i.e., ‘something/string’, ‘…
Database design, which table has the foreign key
I have an Table USER (USER_ID, PASSWORD, NAME, …) and an Table ACCESS_ROLES for the Users, every user can have one ACCESS_ROLE (ONE-TO-ONE). Which table has the Foreign Key? I would put the USER_ID into ACCESS_ROLES table. Is there any best practice approach? Answer Since you will be having a one-to-one relationship, the solution suggested by Philip Kelley is better.