Consulting

Results 1 to 5 of 5

Thread: different version of versions(dialects)

  1. #1

    different version of versions(dialects)

    Hi,

    I know that there are more than 1 version(dialect) of SQL.
    For example: T-SQL, SQL-92

    I want to learn one of the version.
    I guess that different database require different version of SQL.

    Could you please tell me which version of SQL do the following database require?
    Access
    Microsoft SQL server
    MySQL

    Thanks

  2. #2
    VBAX Regular
    Joined
    Sep 2011
    Posts
    10
    Location
    Access and SQL Server work fine with T-SQL

    From Access you need to create a connection to the server then execute the SQL statement from a string variable

    Suppose you want to insert something into an SQL Server Table called Fred


    Create Connection

    Dim db As ADODB.Connection
    Dim Mysql as string
    Dim MyInt as Integer
    Dim MyText as Sting

    Myint= 1
    MyText = "Something"


    Set db = CurrentProject.Connection (This assumes you are assuming using an access ADP or you will have to set up a connection if using an MDB)

    If you are using an MDB you will have to do DB.Open and put in the connection string to open a connection to the server. see at the bottom.

    Mysql = "Insert Into FRED (Integerfield1,TextField2) values (" & MyInt & ",'" & Mytext & "')"

    db.Execute Mysql

    This will execute the statement and put the values in SQL Server in table Fred

    If you need to connect to the server from an MDB you have to specify the connection string and open it first

    With db

    .ConnectionString = "Provider=SQLOLEDB; " & _

    "Data Source=" & ServerName & "; " & _

    "Initial Catalog=NAMEOFDATABASE;" & _

    "User ID=sa; Password=; Trusted_Connection=yes"

    .Open

    End With

    Then you can execute DB commands

  3. #3
    Quote Originally Posted by tcoombes
    Access and SQL Server work fine with T-SQL

    From Access you need to create a connection to the server then execute the SQL statement from a string variable

    Suppose you want to insert something into an SQL Server Table called Fred


    Create Connection

    Dim db As ADODB.Connection
    Dim Mysql as string
    Dim MyInt as Integer
    Dim MyText as Sting

    Myint= 1
    MyText = "Something"


    Set db = CurrentProject.Connection (This assumes you are assuming using an access ADP or you will have to set up a connection if using an MDB)

    If you are using an MDB you will have to do DB.Open and put in the connection string to open a connection to the server. see at the bottom.

    Mysql = "Insert Into FRED (Integerfield1,TextField2) values (" & MyInt & ",'" & Mytext & "')"

    db.Execute Mysql

    This will execute the statement and put the values in SQL Server in table Fred

    If you need to connect to the server from an MDB you have to specify the connection string and open it first

    With db

    .ConnectionString = "Provider=SQLOLEDB; " & _

    "Data Source=" & ServerName & "; " & _

    "Initial Catalog=NAMEOFDATABASE;" & _

    "User ID=sa; Password=; Trusted_Connection=yes"

    .Open

    End With

    Then you can execute DB commands
    Thank you for your reply.

    If I want to learn to use MySQL, which version of SQL should I use?
    T-SQL or SQL-92?

    Thanks

  4. #4
    VBAX Regular
    Joined
    Sep 2011
    Posts
    10
    Location
    Well T-SQL is definitely OK for SQL Server but I do not think it is right for MYSQL as there is a difference in how you create statements

  5. #5
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    T-SQL isn't really a version of SQL.

    It's an extension to SQL that's used by Microsoft and a few others.

    You shouldn't concentrate on learning a particular version of SQL.

    If you just learn 'standard' SQL you will be able to use that anywhere.

    When you are using a particular database or server you can learn the specifics for it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •