Forum Replies Created

Viewing 15 posts - 6,226 through 6,240 (of 8,731 total)

  • RE: DTS to Excel

    Sachin Nandanwar (6/20/2014)


    Couple of months back I used a VBScript in Script task component of SSIS package to change file extensions.Not sure about DTS.

    How does that help?

    I know that I...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Input paramter for Store Procedure like in statement 'Value1','Value2'

    Or you could avoid the need for a table if you're using them just once.

    Select *

    from YourTable

    WHERE Id in (Select Id from dbo.DelimitedSplit8K(@Parameter, ','))

    Notice that I used the...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: DTS to Excel

    You can use a Transform Data Task with your DB Server as the Source and an Excel Connection as your Destination.

    To make it read-only, you might need a script task....

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: SQLServer won't recognize copied database

    Why don't you create the DB on the cloud and restore it from a backup (which might be compressed if you're on 2008R2+). It seems safer than using mdf and...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Help to do this query!!

    There's no need for window functions, they won't work better than a simple aggregate function.

    You don't need to write a complete CASE either. Here are two options to shorten the...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How to insert sql table item list into one row in table

    You might want to take a look at cross tabs. It's fairly easy and it just requires copy-paste-replace. 🙂

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    SELECT

    MAX(CASE WHEN ItemNumber = 1 THEN...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Replace keyword or a better way?

    Here's what I got from playing a little bit with the information.

    SELECT SUBSTRING( Place, CHARINDEX('(', Place ) + 1, CHARINDEX(')', Place ) - CHARINDEX('(', Place ) - 1)

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: returning only portion of string

    And a different way of doing this with the Pattern Splitter.

    http://www.sqlservercentral.com/articles/String+Manipulation/94365/

    WITH sample_data(val)

    AS

    (

    SELECT '1.9999-Q1'

    UNION ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Recursive loop between a table and itself

    If those are calculated columns, why do you need them at all?

    You certainly don't need a table per month. On the worst scenario, you could use a self join.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Create UDF (Function) with one parameter - returns True/False from VBA code

    So, what's the question again?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Calculate 2 weeks every week

    Take a look at the DATEADD function.

    After you understand how does it work, you could go further by using this date routines: http://www.sqlservercentral.com/blogs/lynnpettis/2009/03/25/some-common-date-routines/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: T-SQL Order by on date descending in a column

    You don't need the order by CID as there's only one CID on your subquery.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: T-SQL Order by on date descending in a column

    You were overcomplicating your ORDER BY clause.

    SELECT u.CID,

    STUFF(( SELECT '; ' +CAST(tu.Dept AS VARCHAR(MAX))+' '+CONVERT(VARCHAR(25), tu.CDate,101)

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: DELETES not wrapped in a transaction, will they commit after each one?

    Just to be clear on what Sean said.

    The current delete is rolled back and the previous ones remain commited.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: String occurrence count with Cross apply

    Maybe something like this?

    SELECT ISNULL( w.Word, 'None'),

    COUNT(t.String),

    ISNULL( SUM((LEN(t.String)-LEN(REPLACE(t.String,w.Word,'')))/LEN(w.Word)), COUNT(t.String))

    FROM @word w

    RIGHT

    JOIN @t t ON String LIKE '%' + Word + '%'

    GROUP...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 6,226 through 6,240 (of 8,731 total)