Forum Replies Created

Viewing 15 posts - 4,726 through 4,740 (of 5,111 total)

  • RE: SQL comma separated values and a loop

    IF my understanding is correct, STUFF and FOR XML PATH should do what you want. I haven't tested this mind, as I don't have any sample data or DDL.

    CREATE...

  • RE: SQL comma separated values and a loop

    Firstly, please put your code in IFCODE Tags, putting it straight into the box makes it quite difficult to read, and has no formatting.

    Secondly, you've provided what you've attempted which...

  • RE: Calculate opening hours between 2 dates

    Fast.Eddie (12/7/2016)


    Thom A (12/7/2016)


    Ok, I've used the Tally Table within the query, however, I still strongly suggest you have a Calendar table made on your SQL server. There's really no...

  • RE: Calculate opening hours between 2 dates

    Ok, I've used the Tally Table within the query, however, I still strongly suggest you have a Calendar table made on your SQL server. There's really no reason why your...

  • RE: Calculate opening hours between 2 dates

    Fast.Eddie (12/7/2016)


    Not possible, there's a whole change request which takes ages and a lot of the requests we stick in are rejected because it's not 'business critical'. The company that...

  • RE: Calculate opening hours between 2 dates

    Fast.Eddie (12/7/2016)


    Thom A (12/7/2016)


    This would be an extremely easy task with a Calendar Table[/url].

    This should get you started:

    Thanks, but with our remote access to MS Server, we can't create Views...

  • RE: Calculate opening hours between 2 dates

    This would be an extremely easy task with a Calendar Table[/url].

    This should get you started:

    USE DevTestDB;

    GO

    CREATE TABLE #OpeningHours

    (

    WorkingDay VARCHAR(12), --Why was this a TEXT field!? Use VARCHAR, TEXT is deprecated.

    from_time...

  • RE: SchemaName.ObjectName

    Rechana Rajan (12/7/2016)


    As per my understanding for this user it will check the [bill] schema first and then dbo and it wont go any further. Please correct if I...

  • RE: Schema

    padmakumark26 (12/7/2016)


    Thanks All.

    Schema prefix is must for function ? Like Select myschema.myfunction('Test')

    Correct; if using a function, the schema must always be declared.

  • RE: Schema

    John Mitchell-245523 (12/7/2016)


    As Thom said, all objects have a schema. However, you can refer to an object without using its schema name if, I think, your login's default schema...

  • RE: Schema

    padmakumark26 (12/7/2016)


    Is it possible to create sqlserver objects with out schema like Test not like dbo.Test or Function like F_GetData not like dbo.F_getdata.

    Schemas are a part of SQL Server. You...

  • RE: Script to replace ","

    drew.allen (12/6/2016)


    adonetok (12/6/2016)


    I tried the way from SSChasing Mays but got an error once I changed table name from "orders" to my table's name.

    Where is "near '-'" from script?

    (352866 row(s)...

  • RE: Script to replace ","

    Why do you want to Loop? That would be incredibly inefficient.

    Are you sure that you want to do this to all fields, regardless? Do I assume that you don't...

  • RE: Multiple datasets into multiple grids for a single record per page

    From you initial description, I assume that you've created a separate dataset for each employee? What happens if an Employee leaves, or joins? You'd have to update the report (not...

  • RE: Unable to import data from xml in MS SQL Server 2014

    If you're using SSIS, why are you completing this task in SQL? Would it not be easier to use the XML Task?

Viewing 15 posts - 4,726 through 4,740 (of 5,111 total)