Table Names

  • IHello All

    I hope that your day is going well.

    I have a question concerning table names and the single quotes that surround text. I have a table that contains the table names from a database.

    One example is: ttg_Customers

    I want to query that row out and place it into a variable in a Sproc. When the data comes out is looks exactly like it does above. However, I need to append a single quote mark on each side of that variable. Here is my code

    SELECT @Table_Name = MIN(Table_Name) FROM DB_Table_Names

    I need my @Table_Name variable to look like this:

    'ttg_Customers'

    How can I add the single quotes to each side of the variable?

    Thanks in advance for your help

    Andrew

  • SELECT @Table_Name = '''' + MIN(Table_Name) + '''' FROM DB_Table_Names

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply