Forum Replies Created

Viewing 15 posts - 61 through 75 (of 149 total)

  • RE: will u plz give me query for full back up

    I see you are using a third party tool to conduct your backups:

    master.dbo.colt_sp_sqlmanager ''FULLDBBACKUP''

    From reading your posting, it should have emailed an error...

  • RE: COUNT (Distinct Column) = 0 with GROUP BY

    Another possibility is to use a union statement as follows:

    SELECT DayOfWeek, SUM(NumberOfUser) AS [NumberOfUser]

    FROM (SELECT UPPER(LEFT(DATENAME(dw, StartTime), 3)) AS DayOfWeek,

    COUNT(DISTINCT UserID) AS NumberOfUser

    FROM testUserLoginDuration

    WHERE Archived = 0

    GROUP BY...

  • RE: dynamic sql in a function

    There are a couple of options that could work, but it depends on your {param2}. Could you please provide an example of {param2}?

    Dave

  • RE: How to store output message in a variable or temp table.

    The error you are now getting is caused by a length value for the 3rd parameter in the SUBSTRING function that is less then 1. Try replacing the CASE...

  • RE: How to store output message in a variable or temp table.

    I forgot the END statement on the CASE statement. Here is the correct SQL

    INSERT INTO #a (aline)

    VALUES (CASE WHEN @vcText = '0' THEN @vcText ELSE SUBSTRING(@vcText, 5, CHARINDEX(',', @vcText,...

  • RE: How to store output message in a variable or temp table.

    Just one work of caution. The sql that I listed to parse the error text takes as an assumption that the error text will always start with 'MSG '.

    Dave...

  • RE: How to store output message in a variable or temp table.

    I am going to make some assumtions here

    This is the error text returned for a bad file:

    Msg 50204, Level 19, State 1, Line 0

    LiteSpeed 2005 could not initialise the backup...

  • RE: How to store output message in a variable or temp table.

    Could you give us a sample of the error text returned so that we can see how to parse out the error value from the text?

  • RE: How to store output message in a variable or temp table.

    Try this:

    DECLARE @vcText varchar(200)

    EXEC @vcText = master..xp_restore_verifyonly @filename='C:\Backup\MyDB.lsb'

    INSERT INTO {table} ({field})

    VALUES (@vcText)

    This will capture the return values from the SP. Now the question is if it returns a 1/0...

  • RE: BRAKING A COLUMN INTO TWO

    Check out the CHARINDEX function and look for either the space or the comma or both depending on how clean you data is.

    You can use the CHARINDEX function in the...

  • RE: Problem With SUBSTRING

    Instead of puting the check in the where clause, why not use a case statement in the select to filter this. You will have to decide if the fullname...

  • RE: Passing String example "10013,10014,10015" in Stored Procedure

    Here is how you can accomplish Prasad's first reccomendation:

    CREATE Proc usp_GetTotalRecords

    @iisrid int,

    @iuserid int,

    @sPregionCities varchar(200),

    @iCampid int,

    @iTotalrecord int Output

    As

    declare @iStart int,

    @iPos int

    declare @tblArray (iZip int)

    IF RIGHT(@sPregionCities, 1) <> ','

    SET @sPregionCities = @sPregionCities +...

  • RE: Getting the Time part out of a DateTime

    Take a look at the Convert function

     

    CONVERT(varchar(20), {datetime field}, 8)

     

    You can also use 14 in place of the 8 to get milliseconds

     

    Dave

  • RE: Compression tool???

    This project was killed a few months ago.  Put I do thank you for your recent replies.  Actually, it was my boss that wanted to find out if there was...

  • RE: Problem with IN Clause

    If you are using SQL 2K or greater, you could great a user defined functions that returns a table variable.

     

    Pass the comma delimited array to the UDF which parses it...

Viewing 15 posts - 61 through 75 (of 149 total)