Forum Replies Created

Viewing 15 posts - 3,661 through 3,675 (of 13,462 total)

  • RE: Any ideas on how to accomplish this one?

    love to figure this one out!

    nice!

    i split the data with DelimitedSply8K, then grouped it, and then used FORXML to reassemble a new string:

    /*

    AcctNumFuelTypes

    0000000500444Biodiesel,Gas

    00000026104Diesel,Gas,Other - Non Fuel

    */

    With MyGroupedData

    AS

    (

    --split it up and...

  • RE: t-sql trimming before and after stored proc name

    yeah, but there's another version that supports varchar(max), which is the datatype for sys.sql_modules.definition;

    it's effectively the exact same code but varchar(max) instead of varchar(8000)

    good for massive strings you need to...

  • RE: Orphaned DB?

    check the same database in SSMS: is it set as offline? a lot of processes don't see offline databases, i know i've tripped over that a few times.

  • RE: t-sql trimming before and after stored proc name

    another way is to use dbo.Delimitedsplit on sys.sql_modules.defintion, so every word in the code is separate, then simply join it to the name in sys.procedures.

  • RE: Track asp pages that are deleting records from a table

    Sean Lange (4/12/2013)


    Why not just search the website directories for the name of the stored proc? Unless you have done something to the connection string, or pass a value to...

  • RE: Create DML trigger for single table in SQL 2008 and send email alert to group

    your issue is this part:

    SELECT @CAPTUREDSTRING = [DeletedItems]

    FROM (

    SELECT TOP 1 GETDATE()As TheDate,stuff(( SELECT ',' + Name

    FROM INSERTED s2

    --WHERE s2.WHATEVERID= s1.WHATEVERID --- must match GROUP BY below

    WHERE 1 = 1

    ORDER...

  • RE: Add prefix to all table name

    monilps (4/12/2013)


    Sorry, I was not clear enough. I need to update table name.

    From TableA, TableB to aaa_TableA, aaa_TableB.

    Thanks.

    well you alreayd got the advice that this is a bad idea, but...

  • RE: Format SQL (Pro)

    i installed both tools mentioned in this post the http://poorsql.com and http://www.dpriver.com, and between them both probably use them two dozen times a day.

    there are subtle style differences...

  • RE: udf?,isolation ?

    gurjer48 (4/12/2013)


    i have 2 questions??

    1.can we use insert,delete inside user defined function(i tried myself it showing error 'side-effecting operator 'DELETE' within a function.')?

    if not why?

    No you can't with the...

  • RE: Bulk Update???

    now that i had a sip of coffee, it's even easier:

    create the new table on the fly:

    --script out the constraints and indexes from the original table

    --create the new table instantly...

  • RE: Bulk Update???

    50 millions rows of data is not really that much data. it sounds like you are being blocked. exclusive schema locks, data , etc.

    this is my suggestion what you should...

  • RE: Server doesn't accept connections from the web!

    i'l repeat what has already been said: it's a badk idea to expose your SQL se3rver directly to the internet.

    that said, un doubtedly, you'll need to modify the router between...

  • RE: Relating tables barely related.

    you can do what some people call an exotic join...joins that are not T1.field = T2.field

    but things like :

    ON UserName = REPLACE(Userlogin,'\Domain','')

    or on char index/patindex

    ON (CHARINDEX(UserName , Userlogin)...

  • RE: how to select top 5 records per category.

    fantastic job providing the DDL and sample data!

    i think you can use row_number() to get what you are after:

    SELECT * FROM (

    SELECT

    ROW_NUMBER() OVER(PARTITION BY symbol ORDER BY quote_date DESC)...

  • RE: Data Dictionary in SQL

    datareaders gives them access to data, i think they just want to see the schema(table NAMEs and column NAMEs)

    that permission would be VIEW DEFINITION (in a single database)

    or VIEW ANY...

Viewing 15 posts - 3,661 through 3,675 (of 13,462 total)