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