Forum Replies Created

Viewing 15 posts - 241 through 255 (of 1,473 total)

  • RE: How to get rowid in sql server 2005

    Thanks for the links. I actually did find both of those in my searching the other day, and part of the reason I thought it might exist in some...

    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 get rowid in sql server 2005

    Paul White NZ (3/28/2010)


    Lynn Pettis (3/26/2010)


    nitinkumar_tss (3/26/2010)


    I want to get the rowid internally generated at table level in sql server. Because I need to perform some task according to the...

    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: Cross apply Ambiguity

    Paul White NZ (3/27/2010)


    Jeff Moden (3/27/2010)


    And now we know why I've gotten in the habit of aliasing all column names. Out of habit, it's even bled over into queries...

    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: T-SQL Oddities

    I'm almost inspired to create a whole database with "picture text" table names like >^.^< and <('.'<).

    ...

    Almost.

    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: Cross apply Ambiguity

    That one can be nasty. There's a very similar version that can bite you as well.

    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: Need rows where a date is between start and end dates OR before a start date

    Windowed functions are definitely high on my list, but I think I'd have to go with DMV's for the win.

    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 get last 10 characters in all rows of a single(same) column?

    I think I've got you beat Bob. This is pretty performant... runs in well under a second.

    CREATE TABLE #Test(

    nvcnvarchar(MAX))

    CREATE TABLE #Output(

    nvcoutnvarchar(MAX))

    INSERT INTO #Test(nvc)

    SELECT REPLICATE(N'A',500) UNION ALL

    SELECT REPLICATE(N'B',600)

    -- Declare Variables

    DECLARE...

    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: Need rows where a date is between start and end dates OR before a start date

    Michael Meierruth (3/26/2010)


    DakotaPaul,

    The WITH statement is the best thing that came out with SS2005.

    And there is no need to wrap your head around it. It's really simple!

    It's like preparing 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: Creating Indices on Temp Tables from Stored Procedures

    kramaswamy (3/26/2010)


    @Dixie Flatline, that's pretty much spot on. The issue of the tables being badly designed / indexed is a major issue, but it's not something we can just drop...

    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 get rowid in sql server 2005

    It seems like Oracle uses something like this that you can access, but unfortunately MS SQL does not. If you can give more details on your goal, it's possible...

    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: Cross database execution

    If I understand this correctly, you're saying that it's failing even when you're not attempting to select from the table that you don't have rights to.

    I tried to duplicate this...

    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: What SQL or Stored Procedure is Running? SS2K

    No problem with the skepticism, I'm still running 2000 in my environment here, and these work fine (with the versioning restriction on fn_get_sql that I mentioned above, you need 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]

  • RE: How to findout columns involved in Joins, where clause, group by and having clause in a SQL Query?

    What are you trying to achieve? I know you want to get those columns... but for what purpose, what are you going to do with the info? I...

    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: What SQL or Stored Procedure is Running? SS2K

    Here's another snippet for working with fn_get_sql that might be helpful.

    CREATE TABLE #C(dbid smallint, objectid int, number smallint, encrypted bit, [text] text)

    DECLARE @handle binary(20),@textptr binary(16),

    ...

    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: What SQL or Stored Procedure is Running? SS2K

    You should be able to use DBCC INPUTBUFFER(@@SPID) and ::fn_get_sql (The second one only works if you have SP3, or more specifically the patch that added this and the sql_handle...

    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 - 241 through 255 (of 1,473 total)