Forum Replies Created

Viewing 15 posts - 1 through 15 (of 59 total)

  • RE: count every hour per day

    Looks like an excellent use case for a Tally table.

    [/url]

  • RE: Constant Data Types

    The following page shows how the result precision and result scale will be calculated.

    https://msdn.microsoft.com/en-us/library/ms190476.aspx

    It makes sense in the 2560/1024.0 example if 2560 is converted to numeric(5, 1) first

  • RE: Function call within Insert failing

    You could give the TRY_PARSE function a try (pardon the pun)

  • RE: SSIS variable not changing value

    Attached package with 2 variables:vValue depends on the value of vShowNew

    If vShowNew is changed by the Expression Task, the value for vValue will change to the value of the NewValue...

  • RE: SSIS variable not changing value

    Thanks.

    I need to have the default set as soon as I open the package otherwise my data flows that use the connection come up with warnings.

    The variable is used in...

  • RE: SSIS variable not changing value

    Thank you for your help. Really appreciated.

    Expression Task would be my prefered method. Attached a package that shows what I'm trying To do.

    I can get it to work if I...

  • RE: SSIS variable not changing value

    Don't think I follow.

    How would you change the expression at runtime?

    Surely you should be able to change the value of a variable. Hence the name.

  • RE: Find column values based on min and max of other columns

    You could use the ROW_number window function in a cte and then do a self join on it:

    WITH CTE AS

    (

    SELECT ID, IDDATE, JID, FROMID, TOID

    , ROW_NUMBER() OVER (PARTITION BY...

  • RE: Assign Variables

    As long as you can guarantee that you return only 1 row you can use select:

    SELECT @d1 = D1, @d2 = D2, @d3 = D3

    , @d4 = D4, @d5 =...

  • RE: cannot remove empty file group

    Please make sure no data files are part of the filegroup.

    SELECT * FROM sys.database_files F

    INNER JOIN sys.filegroups G

    ON F.data_space_id = G.data_space_id

    AND G.name = 'FileGroupCommon'

    BOL states:

    REMOVE FILEGROUP filegroup_name

    Removes a filegroup from...

  • RE: parent/child relationships

    Looks like a case for a recursive CTE

  • RE: Extract xml to table.

    You could try the following:

    DECLARE @xml as xml

    SET @xml =

    '<Item>

    <Item customerid="101" customername="Ram" gender="Male" married="Y"/>

    <Item customerid="102" customername="Sham" gender="Male" married="Y"/>

    <Item customerid="103" customername="Tom" gender="Male" married="N"/>

    </Item>'

    SELECT T.c.value('@customerid', 'int') AS Customerid

    , T.c.value('@customername', 'varchar(50)')...

  • RE: Calculate Head Cout

    Try the following

    COUNT(1) OVER (Partition BY a.PostalCode)

  • RE: Mirror Database - Cannot create snapshot

    I'm getting a similar error when creating snapshots:

    Msg 5014, Level 16, State 3, Line 1

    The file 'Admin' does not exist in database 'Admin'.

    When running the following script:

    CREATE DATABASE Admin_SnapShot...

  • RE: Snapshots Fail

    The SQL agent logs nor the SQL Server logs show any errors.

Viewing 15 posts - 1 through 15 (of 59 total)