JocaPC

My feedback

  1. 4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    under review  ·  2 comments  ·  SQL Server » Bugs  ·  Flag idea as inappropriate…  ·  Admin →
    JocaPC commented  · 

    Could you include data that you used. I cannot reproduce this:

    declare @t as table (COLUMN_NAME varchar(100))
    insert into @t values('a'), ('b'), ('c'), ('d')
    SELECT STRING_AGG(COLUMN_NAME,',') WITHIN GROUP (ORDER BY COLUMN_NAME DESC) FROM @t
    --d,c,b,a
    SELECT STRING_AGG(COLUMN_NAME,',') WITHIN GROUP (ORDER BY COLUMN_NAME ASC) FROM @t
    --a,b,c,d

  2. 6 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  SQL Database  ·  Flag idea as inappropriate…  ·  Admin →
    JocaPC commented  · 

    BULK INSERT statement is available in Azure SQL DB see https://docs.microsoft.com/en-us/sql/t-sql/statements/bulk-insert-transact-sql . you can specify FORMAT='CSV' option to parse CSV files.

  3. 22 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  SQL Database » Bugs  ·  Flag idea as inappropriate…  ·  Admin →
    JocaPC commented  · 

    Are you using user defined TVF dbo.string_split or new system TVF string_split? In your code you are using dbo.string_split that is user defined function and not built-in.
    I tried to repro this and I cannot create function dbo.tt if I don't have user defined function dbo.string_split. If I have user defined dbo.string_split or if I replace dbo.string_split with string split, export works. Example:

    alter database MyDB SET COMPATIBILITY_LEVEL = 130

    /* MUST HAVE THIS IF USING dbo.string_split below
    drop function if exists dbo.string_split
    go
    create function dbo.string_split
    (@string varchar(max), @separator varchar(1))
    returns table
    return select '1' as value
    */

    drop function if exists dbo.tt
    go
    create function dbo.tt
    (@id varchar(max))
    returns table
    return select value from dbo.string_split(@id,',')

    Note that I had to simplify example because I don't have your numbers table.

Feedback and Knowledge Base