Forum Replies Created

Viewing 15 posts - 2,401 through 2,415 (of 2,458 total)

  • RE: Please give query for below output

    Expanding on mohankollu's solution... You can get this returned as text in the result set with

    DECLARE @aa table(col varchar(20))

    insert into @aa values('100'),('200'),('300'),('400'),('500');

    WITH t(col) AS

    (

    SELECT col+','

    FROM @aa FOR...

  • RE: Subscriber DB size is growing larger than Publisher

    ashwinboinala (8/21/2012)


    hi all,

    i have an issue Subscriber DB size is growing larger than Publisher , publisher db is 21gb , but subscriber db is 72 gb i am using...

  • RE: how to put together or exclude the result from two or more select query

    There are many, many ways to procuce each result set. For the first one you could use UNION (not UNION ALL).

  • RE: high reads

    Can you post some ddl? how many rows are in these tables? It would be helpful to understand your indexes, contraints, etc.

  • RE: Backup size

    GilaMonster (8/20/2012)


    Actually it probably will be.

    That query returns the total size of the DB files. A backup does not back up the entire file, just the used portion of...

  • RE: Backup size

    This will tell you the minimum size (the size of your MDF and NDF files). The backup, unless compressed, will never be less than this.

    USE {myDB};

    SELECT SUM(size/128) AS mb...

  • RE: Full vs Transaction Log Backup

    Transaction log maintenance can be a drag. The stairway about this topic is great.

  • RE: SQL server table on a PC

    Beginner2012 (6/8/2012)


    Hello,

    can we create a SQL server table on a PC based on a query on the sql server ?

    Thank you

    edited... Misunderstood your question.

    ... Perhaps some more detail would...

  • RE: Error Handling: TRY...CATCH

    TRY/CATCH is traditionally used more for stuff like this:

    SET NOCOUNT ON;

    DECLARE @pos TABLE (sale_id varchar(4), product_id int)

    DECLARE @err varchar(200)

    BEGIN TRY

    INSERT INTO @pos VALUES ('ccc', 'a')

    END TRY

    BEGIN CATCH

    --...

  • RE: Just starting first job - SSIS & SSAS

    Read, read, read: books online, a web page or blog...

    Practice, practice, practice...

    Microsoft E-learning, plenty of free stuff there. Go to products > SQL Server. There's tons of free...

  • RE: Landing The First SQL Job....

    First, being a DBA and a SQL developer is an excellent experience on bothaccounts. This is also a great time as there is a HUGE shortage of DBAs and Database...

  • RE: Dynamic File Location

    Kirby1367 (8/3/2012)


    I have written a series of script that uses xp_cmdshell (I know the various views on this so don't worry). This is just a very small snippet but...

  • RE: index size for sql server 2008

    I agree with everyone re: "Why the big ol' index?"

    Do you have any idea how many reads this table gets vs writes?

    If the index is not used often...

  • RE: Addition Of Digits

    Here is my solution:

    DECLARE @i varchar(50)='122333444455555';

    WITH val(x,n) AS

    (

    SELECT LEFT(@i,LEN(@i)),'0'

    UNION ALL

    SELECT LEFT(x,LEN(x)-1),RIGHT(x,1) FROM val WHERE LEN(x)>0

    )

    SELECT SUM(CAST(n AS int)) FROM val

    What's cool is you can replace SELECT SUM(CAST(n...

  • RE: Addition Of Digits

    SomewhereSomehow (8/3/2012)


    Here is my solution

    declare @i int = 985;

    with nums(n) as(select n from (values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10))nums(n))

    select sum(convert(int,substring(convert(varchar(10),@i),n,1)))

    from nums where n <= len(convert(varchar(10),@i))

    This is good. A couple things to note:

    First, the...

Viewing 15 posts - 2,401 through 2,415 (of 2,458 total)