Forum Replies Created

Viewing 15 posts - 14,266 through 14,280 (of 26,486 total)

  • RE: Dynamic query problem

    You need to read about sp_executesql in Books Online. This will show you how to return a value from a dynamic query.

  • RE: enforcing nulls performance

    What if someone updates the table from outside the application? Now you have the possibility of nulls getting inserted.

    If the column can never have a null value, specify NOT...

  • RE: using multiple columns in subquery with sql server 2000

    First, you really should start writing your queries using ANSI-92 style joins instead of ANSI-89 style joins. It makes your code easier to read and separates the join criteria...

  • RE: Are the posted questions getting worse?

    OMG

    Really??

  • RE: convert date in sql

    daveriya (10/13/2011)


    i am getting this error : [Microsoft][SQL Native Client][SQL Server]Conversion failed when converting datetime from character string.

    i place 'set @Account_date = convert(datetime,'yyyy-mm-ddThh:mm:ss.mmm',126)'

    What date are you trying to put...

  • RE: Finding "Max" Value from subquery

    drew.allen (10/5/2011)


    I did look at using an APPLY rather than a subquery, but the execution plans for both were essentially the same. The only difference I found was that...

  • RE: Field names with hyphens

    Andrew Clark-151434 (10/13/2011)


    Sorry, posted before i had finished.

    DB59 is a remote server but on the same LAN, we have no control over the field names (or I would have removed...

  • RE: convert date in sql

    daveriya (10/13/2011)


    that i know,i want the exact format

    Look up CONVERT in BOL. It will tell you exactly what you need to know.

    Here is the link: http://msdn.microsoft.com/en-us/library/ms187928.aspx

  • RE: Covert style 120 vs 102

    How about something like this:

    create procedure testsorting

    ( @sort varchar(60)

    )

    as

    BEGIN

    IF @sort = 'starttime'

    BEGIN

    SELECT

    ...

  • RE: Covert style 120 vs 102

    vick12 (10/13/2011)


    Hi All,

    Thanks for your replies. Actually I am using SSRS to develop a report and I need to sort the data based on a sort input parameter the user...

  • RE: Little help please

    Assuming that a vendor exists in only one location, what do you think this code will return?

    Look at the following to help you:

    SELECT

    VendorState, -- These values...

  • RE: Covert style 120 vs 102

    vick12 (10/12/2011)


    SELECT starttime, convert(varchar(20), starttime,102)+convert(varchar(20), starttime,108) FROM testdate ORDER BY convert(varchar(20), starttime,102)+convert(varchar(20), starttime,108)

    I don't see a distinct in the original query.

    Sorting on starttime will give the same results as sorting...

  • RE: Little help please

    Let me add this, what you need to do is the same thing we do when trying to debug code others have written. The skills we are trying to...

  • RE: Little help please

    You have given us guesses, but you haven't tried to support your answers by analyzing the code. Put together some sample data, 5 or 6 rows and step through...

  • RE: Little help please

    Homework? Test?

    No one here is going to give you the ansers. How about you tell us which answer you think is correct and why you think it is correct....

Viewing 15 posts - 14,266 through 14,280 (of 26,486 total)