What do you want to save?
Add Code snippet
New code examples in category SQL
-
MMD 2021-08-27 17:15:02
connect to sql server with python
import pyodbc # Some other example server values are # server = 'localhost\sqlexpress' # for a named instance # server = 'myserver,port' # to specify an alternate port server = 'tcp:myserver.database.windows.net' database = 'mydb' username = 'myusernam... Add solution -
Faaiz Haque 2021-08-27 16:26:02
mysql user grant database
-- Grants / privileges list SELECT * FROM information_schema.user_privileges; SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') FROM mysql.user; -- Grant a user /* ALL PRIVILEGES All privileges CREATE Create databases and tables ... Add solution -
Foxcat385 2021-08-27 16:14:02
sql character index
-- EXAMPLE select '0004V0' as TESTER_STRING , CHARINDEX('V','0004V0') -- OUTPUT: 5 , CHARINDEX('0','0004V0') -- OUTPUT: 1 , CHARINDEX('0','0004V0',4) -- OUTPUT: 6 from DUAL; -- SYNTAX CHARINDEX(/*substring*/, /*Main string*/, /*start index*/) Add solution -
Chris Fulton 2021-08-27 13:58:01
pdo mysql insert
<?php $pdo = new PDO('mysql:host=localhost;dbname=test', 'username', 'password'); $statement = $pdo->prepare("INSERT INTO users (email, vorname, nachname) VALUES (?, ?, ?)"); $statement->execute(array('[email protected]', 'Klau... Add solution -
Fabien Bouleau 2021-08-27 13:02:02
mysql connection string
Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword; Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; Server=serverAddress1, serverAddress2, serverAddress3;Database=myDataBase;Uid=myUsername;Pwd=myPa... Add solution -
Diego M. 2021-08-27 13:02:02
how to set foreign key in sql server
-- On Create CREATE TABLE tableName ( ID INT, SomeEntityID INT, PRIMARY KEY (ID), FOREIGN KEY (SomeEntityID) REFERENCES SomeEntityTable(ID) ON DELETE CASCADE ); -- On Alter, if the column already exists but has no FK ALTER... Add solution -
Adrian Smith 2021-08-27 12:42:01
create database dynamically sql server using sequalize
const config = require('config.json'); const mysql = require('mysql2/promise'); const { Sequelize } = require('sequelize'); module.exports = db = {}; initialize(); async function initialize() { // create db if it doesn't already exist const { h... Add solution
Best helpers
Eredani
+5
Dave Holly
+5
Hudhud
+5
Qwerp
+5
Asuka02
+5
Pulverize
+5
NinjaDuckie
+5
John Bottom
+5
RedRiderX
+5