Forum Replies Created

Viewing 15 posts - 571 through 585 (of 1,473 total)

  • RE: substring NOT working

    3 different people have now responded with 4 different guesses as to what you're trying to do here. 😛 Please try to explain better.

    It is often a...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Outer Reference Explantion

    shalyn_bronson22 (9/29/2009)


    SELECT top 5 Customers.ContactName, Orders.OrderDate,

    (UnitPrice * Quantity) as Order_Cost

    FROM Customers, Orders, [Order Details]

    ...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: COUNT within a specified date range

    Try this. Note that criteria in your WHERE clause applies to your entire query. Moving it to the left join stops these rows from being filtered.

    SELECT officename...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: substring NOT working

    Of course you did, that's what you selected :hehe:.

    Are you trying to build a string that is FirstName + MiddleName + LastName?

    If so, you're using the wrong function.

    SELECT FirstName +...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: SQL Server 2000 4000 character query limit for adhoc queries

    I'm not familiar with Jasper, but the usual way around this is to split the string into 4000 character chunks and concatenate them in your dynamic sql.

    So you'd split your...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: substring NOT working

    What's the error? Also, why are you selecting a variable from a table?

    This works fine:

    declare @string1 varchar(100)

    set @string1 ='FirstName MiddleNameLastName '

    select substring(@string1,1,10) FIRST

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Patindex on large fields

    Patindex works on varchar(max). (I just tested it on strings over 10k)

    Are you certain that is what's causing the truncation? Patindex doesn't truncate anything, it just searches and...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Rows returned with null values in a criteria field.

    The double quotes might be messing you up. Use single quotes.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: How to skip checking the existence of objects when creating Stored Procedure

    This fails on my 2K8 server on 80/90/100 Compatibility levels. I'm honestly not sure how you have it working on yours.

    --CREATE DATABASE Test

    --GO

    ALTER DATABASE Test SET COMPATIBILITY_LEVEL = 100

    GO

    USE...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: How to skip checking the existence of objects when creating Stored Procedure

    See below.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: How to skip checking the existence of objects when creating Stored Procedure

    PP-564103 (10/2/2009)


    Roust_m (10/1/2009)


    bitbucket-25253 (10/1/2009)


    Do not know why you would want to create an SP and not know if it would function, but yes it can be done for example:

    CREATE PROCEDURE...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: How WHERE EXISTS works?

    J-F Bergeron (10/1/2009)


    Well, if you really want to use the exists clause, you need to add a condition with the first table #T1.

    Here's how you can do it:

    SELECT *

    FROM ...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: possibleto create View with Variable inside

    This is a stab in the dark. It likely won't work(or be obnoxiously slow), but try it.

    SELECT DISTINCT

    RTRIM(F.Fund_Number) AS Fund_Number,

    ...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: possibleto create View with Variable inside

    Yikes.

    Is the date you're looking to pass in always going to be a date only? (ie. no time)

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Stored Procedure Metadata

    Matt Whitfield (10/1/2009)


    As Richard says (and I did in a previous post), CommandBehaviour.SchemaOnly does SET FMTONLY ON behind the scenes for you.

    Nice, I wondered if it might do that. ...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

Viewing 15 posts - 571 through 585 (of 1,473 total)