Forum Replies Created

Viewing 15 posts - 91 through 105 (of 112 total)

  • RE: Dynamicly creating a database

    Yeah i know, i managed to find a solution. i split the #DATABASE table into a #FILEGROUP table and a #FILES table

    CREATE TABLE #DATABASE (FILES VARCHAR(100), FILEGROUP VARCHAR(100))

    CREATE TABLE #FILEGROUP...

    --
    Thiago Dantas
    @DantHimself

  • RE: REPLACE Multiple Spaces with One

    --PREPARE

    CREATE FUNCTION dbo.fn_CleanUp(@FooString VARCHAR(max))

    RETURNS VARCHAR(max)

    BEGIN

    WHILE CHARINDEX(' ',@FooString) > 0

    ...

    --
    Thiago Dantas
    @DantHimself

  • RE: REPLACE Multiple Spaces with One

    dhananjay.n.kulkarni (11/16/2009)


    Hi , Article is nice. I have little very quick one liner solution for this :

    declare @str_having_multiplespaces varchar(200)

    set @str_having_multiplespaces = 'hi onespace 2spaces ...

    --
    Thiago Dantas
    @DantHimself

  • RE: REPLACE Multiple Spaces with One

    Richard Briggs (11/16/2009)


    So we have to loop to get around 6 character limit of REPLACE:

    I cant understand why REPLACE has that 6 char limit though?

    ALTER FUNCTION dbo.fn_CleanUp(@FooString VARCHAR(max))

    RETURNS VARCHAR(max)

    BEGIN

    WHILE CHARINDEX('...

    --
    Thiago Dantas
    @DantHimself

  • RE: REPLACE Multiple Spaces with One

    Richard Briggs (11/16/2009)


    Hi

    Does this simple replace not work then?

    REPLACE(@SomeText, ' ',' ')

    which is actually :

    REPLACE(@SomeText, '[space][space]','[space]')

    i.e. replace two spaces with one..

    This seams to work fine for me, but I...

    --
    Thiago Dantas
    @DantHimself

  • RE: Pivoting a one column table

    im not the one that clicks the "Import" button on the app

    im the one responsible for what the "Import" button will do

    the company i work for has a credit recovery...

    --
    Thiago Dantas
    @DantHimself

  • RE: Help with another select query please

    SELECT

    [ORD_NBR],

    [1ST_NME],

    [LST_NME] ,...

    --
    Thiago Dantas
    @DantHimself

  • RE: Pivoting a one column table

    as a crappy solution, i created 5 tables with the correct amount of columns, exported 5 new files from the main table, re-imported the files to the correct tables and...

    --
    Thiago Dantas
    @DantHimself

  • RE: retrieving data between two dates

    by standard our app always use full dates such as

    select * from table where date between '2009-01-01 00:00:00' and '2009-01-31 23:59:59'

    as others said, try droping the convert and let...

    --
    Thiago Dantas
    @DantHimself

  • RE: lock issue

    if DBCC inputbuffer only shows something like "exec USP_SOMETHING"

    and you have some execs or other procs called from the USP you could try

    SELECT TEXT

    FROM MASTER..SYSPROCESSES

    CROSS APPLY ::FN_GET_SQL(SQL_HANDLE)

    WHERE SPID...

    --
    Thiago Dantas
    @DantHimself

  • RE: How can I to read a XML from a URL using T-SQL?

    you really should get rid of the ole automation and jump into SQLCLR, not only it will give you more liberty it might already be common ground for you.

    if you...

    --
    Thiago Dantas
    @DantHimself

  • RE: Peer-to-Peer Replication

    no because the subscriber (second server) would be doing the data importing and that data would need to be relayed back to the main server

    --
    Thiago Dantas
    @DantHimself

  • RE: How get Windows NT/XP Logon ID in SQL Server ?

    i think i know what your going for, you want to differentiate terminal services logins using the sql server. don't think its possible through T-SQL

    --
    Thiago Dantas
    @DantHimself

  • RE: How get Windows NT/XP Logon ID in SQL Server ?

    i think the best you can get from inside sql server is the NT Username as provided from original_login()

    check the sysprocesses table to see if something in there interests you

    select...

    --
    Thiago Dantas
    @DantHimself

  • RE: Pivoting a one column table

    CREATE TABLE TEMP_IMPORT (DATA VARCHAR(8000), ID INT IDENTITY(1,1) PRIMARY KEY)

    GO

    INSERT INTO TEMP_IMPORT

    SELECT 'Id_Contacto'+CHAR(9)+'IdOperacion_SIR'+CHAR(9)+'Apellido_RazonSocial'+CHAR(9)+'Tipo_Doc'+CHAR(9)+'Nro_Doc'+CHAR(9)+'Cuil_Cuit'+CHAR(9)+'Tipo_Persona'+CHAR(9)+'Relacion'+CHAR(9)+'Sexo'+CHAR(9)+'Estado_Civil'+CHAR(9)+'Fecha_Nacimiento'+CHAR(9)+'Profesion'+CHAR(9)+'Categoria_IVA'+CHAR(9)+'Actividad'+CHAR(9)+'Caracteristica_de_la_Actividad'+CHAR(9)+'Tipo_Sociedad'+CHAR(9)+'Estado'+CHAR(9)+'Fecha_Verificacion'+CHAR(9)+'Usuario_Verificador' UNION ALL

    SELECT '647247'+CHAR(9)+'2690693'+CHAR(9)+'AARAO PEREIRA DE SOUZA'+CHAR(9)+'CPF'+CHAR(9)+'62965930744'+CHAR(9)+''+CHAR(9)+'Física'+CHAR(9)+'Titular'+CHAR(9)+'2'+CHAR(9)+''+CHAR(9)+'15/06/1959'+CHAR(9)+'PROPRIETARIO DE ESTABELECIMENTO COMERCIAL'+CHAR(9)+'Sin Datos'+CHAR(9)+''+CHAR(9)+''+CHAR(9)+''+CHAR(9)+'Contatado'+CHAR(9)+''+CHAR(9)+'' UNION ALL

    SELECT '647251'+CHAR(9)+'2672875'+CHAR(9)+'ABADIA BARBARA AMANCIO DE SOUSA'+CHAR(9)+'CPF'+CHAR(9)+'44689799687'+CHAR(9)+''+CHAR(9)+'Física'+CHAR(9)+'Titular'+CHAR(9)+'1'+CHAR(9)+''+CHAR(9)+'25/05/1957'+CHAR(9)+'OUTROS...

    --
    Thiago Dantas
    @DantHimself

Viewing 15 posts - 91 through 105 (of 112 total)