Tag Info

Hot answers tagged

4

It looks like you'll need to change the user's default database, as it appears this is currently set to DB1, which no longer exists. exec sp_defaultdb @loginame='user1', @defdb='DB2' OR ALTER LOGIN <login_name> WITH DEFAULT_DATABASE = <default_database>


2

You can compare checksum of output of SHOW CREATE TABLE product_today # mysql -NBe "SHOW CREATE TABLE sakila.actor"| sed -r 's/AUTO_INCREMENT=[0-9]+/AUTO_INCREMENT=XXX/g' | md5sum # 1bc0d72b294d1a93ce01b9a2331111cc -


2

All current RDBMS' tables can have CONSTRAINTS on columns. These constraints are checked every time data is inserted into the table. It can also check data against other tables. We know that each Plate Type has certain number of Rows and Columns. We can enumerate all Rows and Columns for each Plate Type. So, when data is inserted, the DB can check if a ...


2

This can be done. The column default for your serial primary key is typically defined as: ALTER TABLE schema_a.tbl ALTER COLUMN tbl_id SET DEFAULT nextval('schema_a.tbl_tbl_id_seq'::regclass); Two options: 1. Move sequence (my preference) to the public schema - or any schema with sufficient privileges: GRANT USAGE ON SCHEMA public TO public; -- or: ...


1

TWO TABLES IN THE CURRENT DATABASE If you want to know if two tables are different, run this SELECT IF(COUNT(1)>0,'Differences','No Differences') Comparison FROM ( SELECT column_name,ordinal_position, data_type,column_type,COUNT(1) rowcount FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name IN ...


1

No. You should combine receipts and purchases, because they are 1 to 1 correlated - there cant be more than one receipt for one paypal purchase, and vice versa. Same goes for Bank Purchases. Therefore ALL of these basically constitute "Purchases". What you call 'receipt' just seems to be the act of CONFIRMING the purchase, and nothing else. Withdrawals ...



Only top voted, non community-wiki answers of a minimum length are eligible