11,379 reputation
11945
bio website
location Munich
age
visits member for 3 years, 3 months
seen 14 mins ago

Aug
17
comment MySQL add few column exception for TRIGGER UPDATE FOR EACH ROW
Cross posted: stackoverflow.com/questions/25347736/…
Aug
16
comment MySQL add few column exception for TRIGGER UPDATE FOR EACH ROW
Which DBMS are you using?
Aug
16
comment Update different columns on different clauses
Mihai's suggestion is good, except that you should add a where WHERE col1 > $VAR or col2 >= $VAR to the update to make sure that you only touch rows that you are interested in. Otherwise that single update would be much costlier than two updates if only parts of all rows are updated.
Aug
15
comment How to sum the buy order and sell order in one row per each ticker
Which DBMS are you using? Postgres? Oracle?
Aug
15
comment cascade delete doesn't work even though constraint is added
Are you sure you created the table identically on the staging server?
Aug
14
comment Delete from table where not in another table using two columns
A little nitpicking: the DBMS you are using is called SQL Server 2008. "SQL 2008" is not a DBMS product - it's an ISO standard that defines the SQL query language
Aug
14
comment Absent and Leave
Why do you think posting the exact same question and (and unformatted again) will give you any more answers.
Aug
14
comment Why is it @@SERVERNAME but not @@DBNAME?
Just a wild guess: @@servername can never change inside a single connection, whereas the current database can. Maybe the difference between a variable (initialized once at the beginning) and a function reflects this.
Aug
13
comment What does exec(text) do?
"What does this function do?" - postgresql.org/docs/current/static/…
Aug
13
comment What is the advantage of partition Date field into individual Year(int), Month(int), Day(int), Time(time) columns?
One advantage I can think of, is that you are able to store "partial dates" like "March, 2014", or "April, 4th" because you can leave some elements at NULL - which you can not do using a date or datetime data type. But if that is not a requirement, I don't see an advantage at all
Aug
13
comment SQL query to update columns in the same row
@Colin'tHart: maybe not. But "user id" sounds like a numeric value, whereas "name" sounds like a text value. Not all DBMS can cast numbers to strings the same way. Some are more strict than others (and the syntax for an explicit cast is also different in many cases)
Aug
13
comment SQL query to update columns in the same row
Which DBMS are you using? Postgres? Oracle?
Aug
13
comment PostgreSQL: schema diff/patch tool
You might try pg_comparator: pgfoundry.org/projects/pg-comparator (I have never used it though). Liquibase has a built-in diff as well and emits the results as a Liquibase changeset if I'm not mistaken so that might be a good starting point for more a controlled schema management
Aug
13
comment PostgreSQL: schema diff/patch tool
Rather than doing a diff, you should manage your migration scripts in a controlled way. Never do ad-hoc DDL changes to a DBMS, always put the change into a script (which is stored in a version control system) and then apply the script. Look into tools like Liquibase or Flyway
Aug
12
comment Can I install SQL Server Management Studio locally?
msdn.microsoft.com/en-us/evalcenter/dn434042.aspx
Aug
3
comment PostgreSQL 9.3 - Performance Issue: Counting table entries slower with jdbc postgres driver
Try a combined index on (id, date). Opening and closing the connection for each query definitely is a bad idea. You might want to consider a connection pool for this. Btw date (or timestamp) is a horrible name for a column. For one because it's also a reserved word,but more importantly because it doesn't document what it contains. A due date? A start date? An end date? A modified date? something different?
Aug
1
comment Can a connection's prepared statements be altered by Postgres's admin functionality?
@CraigRinger but you would need to manipulate the memory of the process that uses the prepared statement. Not something you can do from SQL and probably very hard to do "from the outside"
Aug
1
comment Can a connection's prepared statements be altered by Postgres's admin functionality?
No, I don't think that is possible.
Aug
1
comment sqlplus: ORA-01017 logon denied from one host but OK from another
Does ping host1 reveal the same IP address on both hosts?
Aug
1
comment Give every user 3 default 'bookmark' entries
"Is inserting 3 records for all users a design flaw?" - I wouldn't see that as a design flaw. Btw: which DBMS are you using?