Forum Replies Created

Viewing 15 posts - 2,761 through 2,775 (of 2,894 total)

  • RE: Combining Two Tables or Question

    Friend, next time please test your setup code before posting it.

    Here we are, in first attempt (it may require some tuning):

    -- SETUP:

    /*

    CREATE TABLE USER_SESSION(

    USER_NUM int NOT NULL,

    LOGIN_DT datetime NOT...

  • RE: Combining Two Tables or Question

    Please test your code before posting it. USER is not very good name for the object.

  • RE: TSQL QUERY for Date

    Sorry man, The case should be presented as:

    CREATE TABLE #TestTable (Col1, Col2, ...)

    INSERT #TestTable SELECT Val1, Val2, ...

    ...

    Please work a bit to help minimize time required to help you.

  • RE: TSQL QUERY for Date

    Please provide ctreate table and sample data population script for your case!

  • RE: Getting a datetime with minutes & seconds set to '00'

    Sorry, I have edited the previous post as well:

    SELECT dateadd(hour, datepart(hour,GETDATE()),CAST(convert(varchar(20),getdate(),112) as datetime))

  • RE: Getting a datetime with minutes & seconds set to '00'

    SELECT dateadd(hour, datepart(hour,GETDATE()),CAST(convert(varchar(20),getdate(),112) as datetime))

  • RE: sp_rename on Primary key - dependent objects?

    Do:

    sp_helptext sp_rename

    and you will see how sp_rename does it...

  • RE: Insert Data to XML Comuln in distributed query

    Why not just use

    INSERT INTO Mehregan2_Report.dbo.tblActiveUsers ....

    Or use OPENROWSET instead of OPENQUERY

  • RE: Mentor

    I agree with Jeff. This sort of challenges, instead of teaching right tecniques and deep understanding of their mechanisms, might lead to the habit of writing code noodles.

    I would...

  • RE: Why should one use or not use Dynamic SQL

    AndrewSQLDBA (6/14/2010)


    Hello Everyone

    ...

    So please tell me, why you think that one should use or not use dynamic SQL in a sproc.

    ...

    If one knows what Dynamic SQL is for and how...

  • RE: Why should one use or not use Dynamic SQL

    Good article, I've seen it before.

    But where it said that the Dynamic SQL cannot be optimised?

  • RE: Mentor

    Almost right. Required data was only available on Monday morning but senior BA manager required that it should be the Friday report. So, the report is generated on Monday but...

  • RE: Why should one use or not use Dynamic SQL

    You can optimise dynamic sql as everything else.

    Dynamic sql is absolutely legitimate way of coding and it has own place in design and development of SQLServer based systems.

    As...

  • RE: Mentor

    Do you want the real challenge?

    How to get End-Of-Business Day Friday report that includes the data which will be inserted into the database only on the following Monday?

    :w00t:

  • RE: Mentor

    The most challenging part of your challenge was trying to understand given written requirements in the same way as you (and that is reall life challenge working with BA's :-D):

    scott.pletcher...

Viewing 15 posts - 2,761 through 2,775 (of 2,894 total)