Tag: database

DBeaver can't connect to the database

Trying to connect to the Sql Server via DBeaver, but I can’t connect to the database. And also all credentials for DB correct. Error: OS: macOS Sierra 10.12.3 java version: java version “1.8.0_121” Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

How do I join tables using two database which are in different sql server in laravel

I am searching for a solution to join two tables from two db which are in two different connection. Is there any solution to join tables from different db which are in different connection. I have following db connections ‘connection1’ => array( ‘driver’ => ‘mysql’, ‘host’ => ‘*****.*****.co.za’, ‘database’ => ‘abc’, ‘username’ => ‘root’, ‘password’ […]

Trying to delete Database (MsSQL) from PHP with PDO

As the title might have explained, i have a php project here. Inside i use PDO to connect to my database. At first PHP was connected to a MySQL-Database. But now things have changed and I use a MsSQL-Database. In MySQL you can easily do the following: DROP DATABASE IF EXISTS mydatabase; How can this […]

Updating an existing user does not work in php

when I try to update my database to change the location of an existing user, I receive the text in an echo which is desired but the details of a user are not changed. Here is my code – server details have been removed on purpose for privacy. { $server = ”; $connectionInfo = array(“Database”=>””); […]

Export SQL Server database as .mdf without take it offline

Does somebody know the a way to export a SQL Server database as .mdf file without taking it offline or detaching? I need to export it with the actual tables and data but without stopping the SQL Server service or so…

Comma separated values vs multirow approach for storing data in SQL Server based on performance and handling of data

Scenario: There are 2 tables. Table1 contains users and Table2 contains Hobbies User can have multiple hobbies(20-40). and number of users is over 100k. Approach 1. Create a UsersHobby Table with column 1 as UserID and column 2 as Hobbies and store hobbies as comma separated values. It reduces the number of rows. For example […]

Changing ntext to nvarchar using C# and Entity Framework

I have to add sorting to existing database created in SQL Server. The problem is that this database contains ntext columns that are not supported by LinQ’s OrderBy method. The database was written in a code-first approach, so I have access to template of database, but I can’t look at ready database working on the […]

SchemaCrawler not able to find MSSQL tables

I’m trying to export a schema from MSSQL database using SchemaCrawler & jTDS driver (version 1.3.1). The command is: ./schemacrawler.sh \ -server=sqlserver \ -password= \ -command=schema \ -outputformat=png \ -outputfile=./output/result.png \ -infolevel=standard \ -schemas=.*XYZ.*DOMAIN.user.* \ -tabletypes=TABLE \ -tables=.* \ -routinetypes= \ -loglevel=ALL \ -url=jdbc:jtds:sqlserver://server.com:1433/XYZ\;instance=dbinstance\;useNTLMv2=TRUE\;domain=DOMAIN\;user=user\;password=pwd The DB tables were created under the user’s schema, e.g.: DOMAIN\user.Table1 […]

Billing Database

I have created 2 tables @ CustomerHistory and @ CustomerPaymentHistory here is the sql syntax CREATE TABLE [dbo].[CustomerHistory] ( [ID] INT IDENTITY (1, 1) NOT NULL, [HistoryID] AS (‘CLI’+right(‘000000000’+CONVERT([varchar](10),[ID]),(5))) PERSISTED NOT NULL, [CustomerID] INT NOT NULL, [InvoiceNumber] NVARCHAR(30) NOT NULL, [InvoiceDate] DATETIME NOT NULL, [InvoiceTotal] NVARCHAR(20) NOT NULL, [Balance] NVARCHAR(20) NOT NULL, CONSTRAINT [PK_CUSTOMERHISTORY] PRIMARY […]

Duplicate a Database in SQL Server 2014

I have a live database. I need to create a test database with all the data from the live one, but I’ve encoutneered an error. I’ve tried to create this new one by restoring from a “live database .bak”, but an error message appears saying that could not do the process because the database is […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.