Broadband
Dial-Up
Email
Hosting
Wireless
Security
Useful Tools
Quick Reference
Contact Us
Customer Portal
Site Search

Zen Internet Support Forum

Welcome to the Zen Internet community support forums.

Before posting we recommend you search our
extensive Knowledge Base or the forum archives
as an answer to your query may already be available.

Welcome to Zen Internet Support Forum Sign in | Join | Help
in
Forums Forum Rules

SQL Syntax Problem

Last post 22-05-2008, 1:27 AM by James Sweet. 1 replies.
Sort Posts: Previous Next
  •  11-05-2008, 10:25 AM 30486

    SQL Syntax Problem

    I cant seem to get the syntax right, anyone help? it returns the error :-

     Line 5 Incorrect syntax near ''.

    declare @sql nvarchar(1000)

    select @sql = '' create table ey_report_temp (
    county nvarchar(100),
    fname nvarchar(100),  '' + STUFF((SELECT distinct '','' + sport + '' nvarchar(10) ''
    FROM ey_report
    FOR XML PATH('''')
    ), 1, 1, '''') + '')''

    SQL2000

     

  •  22-05-2008, 1:27 AM 30591 in reply to 30486

    Re: SQL Syntax Problem

    You use single quotes to delimit SQL strings, not double quotes

    ie

    select @sql = '.... 

    not

    select @sql = "....

    Kindest regards,

    James Sweet
    http://www.zen.co.uk
View as RSS news feed in XML