Forum Replies Created

Viewing 15 posts - 181 through 195 (of 240 total)

  • RE: Statement(s) could not be prepared.

    Changing to LEFT JOINs would not be advised.  What they do is tell SQL server to include every row in the set preceeding the LEFT JOIN no matter if a...

  • RE: Case Statement

    This works and allows the set of rows to be included to be reduced by the values in the where clause.  Using some sort of case statment will force all...

  • RE: usp stored procedure prefix

    I feel that using forms of hungarian notation is generally a mistake.  As has been previously stated, when changes occur the prefixes are generally not changed or require mass search...

  • RE: How to check that remote server is accessible

    Sergiy doesn't want to create a view that takes parameters, he wants to dynamically create views based on parameters passed into a stored procedure.  The problem is that errors in...

  • RE: How to Create Time Dimension??

    Since the souce data is in the format you have, you could base the cube on a view that transposes the data into the format of:

    storefront, account, dateid, balance

    Sample SQL...

  • RE: How to Create Time Dimension??

    Since Analysis Services allows you to specifiy that a dimension is a time dimension when creating it, the following is the practice that I use:

    Create Table dimDate (DateID int Identity(1,1), Date Datetime)

    --Insert...

  • RE: Number of Mondays between two dates

    This could be wrapped in either a function or stored procedure.  As noted above this also depends on the value of @@DATEFIRST.

    --using a standard seq table

     SELECT TOP 9999

            IDENTITY(INT,0,1) AS...

  • RE: Update From Select

    Try this:

    UPDATE tableA

    Set tableA.ItemName = TableB.ItemName

    From tableA

    inner join TableB ON TableA.ID = TableB.ID

  • RE: Newbie question

    Try this:

    declare @Table1 table (ColumnID int,ColumnDescription varchar(20))

    insert @Table1 values(1, 'Description')

    insert @Table1 values(2, 'Age')

    insert @Table1 values(3, 'Type')

    declare @Table2 table (StatementID int, LeftColumnID int, RightColumnID int)

    insert @Table2 values(1, 1, 2)

    insert @Table2 values(2,...

  • RE: Query producing Dups

    It appears that there are multiple rows in the pdc table for number = 1186.

    Also, the need to have a DISTINCT clause on a SELECT statement is often a sign...

  • RE: get a list of similar strings

    The matching of similar strings is more complex than just comparing the first 10 characters.  By just comparing the first 10 characters, 'AAA Int'l' won't match 'AAA International' but they are...

  • RE: Refrence Input Param-Brain Farting I suppose

    When SQL creates the temp tables, each connection gets its own copy of a #TEMP table.  If you look in sysobjects after creating a #TEMP table, the name will be...

  • RE: Refrence Input Param-Brain Farting I suppose

    I would use a user defined function that returns a table as in:

    create function fnTable (@var varchar(20))

    returns @t table (

      Reference varchar(100)

    )

    as

    begin

    insert into @t

    SELECT @Var + '-1'

    UNION

    SELECT @Var + '-2'

    UNION

    SELECT...

  • RE: Refrence Input Param-Brain Farting I suppose

    You can't. You will have to do something like:

    declare @sql varchar(8000)

    set @sql = 'select top ' + cast(@MYLIMT as varchar) + ' * from ......'

    exec(@SQL)

  • RE: Query Analyzer

    The transaction log does not store a log of all queries.  It stores the changes that are made to a database.  It is also an unreadable entity.

Viewing 15 posts - 181 through 195 (of 240 total)