Category: Database


Open a Delimited Text file using OPENROWSET and OPENDATASOURCE

SELECT * FROM OPENROWSET (‘MSDASQL’, ‘Driver={Microsoft Text Driver (*.txt; *.csv)}; DefaultDir=C:\Users\Kevin\Downloads\zcugoem;Extended properties=”ColNameHeader=True;Format=Delimited;”’, ‘SELECT * FROM ZCUGOEM.TXT’); or SELECT     * FROM   OPENDATASOURCE(‘Microsoft.Jet.OLEDB.4.0’, ‘Data Source=E:\SQL\;Extended Properties=”Text;HDR=No;FMT=Delimited”‘)…[ZCUGOEM#TXT]


Microsoft Access Data Types

The following table shows the Microsoft Access data types, data types used to create tables, and ODBC SQL data types. Microsoft Access data type Data type (CREATETABLE) ODBC SQL data type BIGBINARY[1] LONGBINARY SQL_LONGVARBINARY...


Change or Alter multiple database table schema

Sometime as a database developer, we might come across changing the schema for the whole database This is one way to do it; by generating multiple queries in the query editor: SELECT ‘EXEC(”sp_changeobjectowner @objname...