wynalazkowo - eksperymenty małe i duże

Renaming Physical Database File Names for a SQL Server Database

Renaming Physical Database File Names for a SQL Server Database

We will check the physical database file names by running the below T-SQL code to validate the database creation. USE Manvendra GO SELECT file_id, name as [logical_file_name], physical_name FROM sys.database_files 2. Our next step is to rename the physical database file names. The physical database file names cannot be changed or renamed while the correspondingWięcej oRenaming Physical Database File Names for a SQL Server Database[…]

MSSQL Server – stored procedures

MSSQL Server – stored procedures

Creating a simple stored procedure We will create a simple stored procedure that joins two tables and returns the result set as shown in the following example. CREATE PROCEDURE GetProductDescASBEGINSET NOCOUNT ON SELECT P.ProductID,P.ProductName,PD.ProductDescription  FROM Product PINNER JOIN ProductDescription PD ON P.ProductID=PD.ProductID END We can use ‘EXEC ProcedureName’ to execute stored procedures. Creating a stored procedure with parametersWięcej oMSSQL Server – stored procedures[…]

PostgreSQL – informacje o bazie

PostgreSQL – informacje o bazie

1. list of table indexes:SELECTtablename,indexname,indexdefFROMpg_indexesWHEREschemaname = ‚public’ \d table_name 2. DB & tables related \q: Quit/Exit \c __database__: Connect to a database \d __table__: Show table definition including triggers \d+ __table__: More detailed table definition including description and physical disk size \l: List databases \dy: List events \df: List functions \di: List indexes \dn: ListWięcej oPostgreSQL – informacje o bazie[…]

Oracle – errors

Oracle – errors

ORA-00001: unique constraint violated The ORA-00001 message is triggered when a unique constraint has been violated. Essentially the user causes the error when trying to execute an INSERT or UPDATE statement that has generated a duplicate value in a restricted field. The error can commonly be found when a program attempts to insert a duplicateWięcej oOracle – errors[…]

Postgresql – tips and tricks

Postgresql – tips and tricks

1) Connect to PostgreSQL database The following command connects to a database under a specific user. After pressing Enter PostgreSQL will ask for the password of the user. 1 psql -d database -U  user -W For example, to connect to dvdrental database under postgres user, you use the following command: 1 2 3 C:\Program Files\PostgreSQL\9.5\bin>psql -d dvdrental -U postgres -W Password for user postgres:Więcej oPostgresql – tips and tricks[…]

MSSQL Server – fundamentals

MSSQL Server – fundamentals

SQL Server Backup Types DB migration Restore DB from backup Clone/Copy DB https://blog.codeinside.eu/2018/07/31/easy-way-to-copy-a-sql-database-with-ssms/ ODBC – how to set up it https://www.techwalla.com/articles/how-to-create-and-setup-an-odbc-database-connection

How to install Oracle XE on Centos7

How to install Oracle XE on Centos7

install Centos on VirtualBox machine vagrant init/centos7 In order to login to machine via putty with password authentication in Vagrantfile add: ” config.ssh.username = ‚vagrant’ config.ssh.password = ‚vagrant’ config.ssh.insert_key = ‚false’ ” vagrant up login to host and change in /etc/ssh/sshd_config PasswordAuthentication=yes restart sshd deamon service sshd restart download Oracle components – as root 1.preinstallerWięcej oHow to install Oracle XE on Centos7[…]

Bazy danych – Powiązania pomiędzy tabelami

Bazy danych – Powiązania pomiędzy tabelami

Powiązania pomiędzy tabelami (związki pomiędzy relacjami) W praktyce spotkać możemy trzy fundamentalne związki między tabelami. Dzięki nim, możemy zapewnić integralność referencyjną danych i zamodelować odpowiednią logikę naszej struktury. Abstrahując od szczegółowej analizy wszystkich rodzajów związków jakie są możliwe w modelu E-R (opcjonalne, obowiązkowe, tetralne), skupimy się tylko na binarnych – czyli dwuargumentowych. ZWIĄZEK 1:1 (jedenWięcej oBazy danych – Powiązania pomiędzy tabelami[…]