Forum Replies Created

Viewing 15 posts - 601 through 615 (of 1,217 total)

  • RE: string operations..URGENT!!

    Try this:

    DECLARE @filename varchar(255)

    DECLARE @date varchar(10)

    SET @date = REPLACE(CONVERT(varchar(10),GETDATE(),101),'/','_')

    SET @filename = 'C:\'+@date+'__CollSoftware2.bck'

    BACKUP DATABASE [CollSoftware2]

    TO  DISK = @filename WITH  INIT , NOUNLOAD , Name = N'CollSoftware2',  NOSKIP ,  STATS = 10, ...

  • RE: Trigger issue

    Just one more suggestion to the code you posted:

    and xpophd.arcid IN (SELECT max(arcid) FROM xpophd where deleted.id=Xpophd.id )

    would better be

    and xpophd.arcid = (SELECT max(arcid) FROM xpophd where deleted.id=Xpophd.id )

    Yes, both will work,...

  • RE: Converting to int and aggregating at the same time

    True, I didn't mention error checking... thanks for bringing it up, Ramesh.

    Problem is that ISNUMERIC() does not always return what one would suppose. Be careful, even with this check some...

  • RE: Executing UDF within query

    Hmmm... I'm not absolutely sure about that. Subqueries tend to produce about the same behavior as UDF, but maybe not always. In any case, I'm trying to stay away from...

  • RE: Executing UDF within query

    Hi Chris,

    I think this is the same thing that was discussed here several times - you could find some references to it using the search tool - but in short,...

  • RE: Converting to int and aggregating at the same time

    Yes. You can use both SUM(CAST(P.Col006 AS INT)) or SUM(CONVERT (INT, P.Col006)).

    You can find this in the help files of SQL Server (BOL - Books OnLine) under "CAST and CONVERT".

  • RE: Trigger issue

    I agree with Jeff that you should not use SELECT * in the trigger code. Also it isn't a good idea to insert something and then update it, if you...

  • RE: HTML in SQL Mail

    I'm not sure what you can do in SQL mail.... we are using SMTP mail (EXEC master..xp_smtp_sendmail) which gives good opportunity to format the output. We use sp_makewebtask procedure to create HTML file...

  • RE: Manipulate rows in a especific order

    Could you explain WHY do you want to do this?

    SQL Server has no specific ordering of rows returned by query, unless you specify ORDER BY. That's why Sergiy is asking...

  • RE: Need reult in one line

    Hi,

    sorry, I was already away from work when you posted the question - but I see that you already found out how to use LEFT JOIN and IS NULL.

    How this works? When you use OUTER...

  • RE: T-SQL start: command

    To answer the second question, since the label points to something inside the same stored procedure, if the same version of SP is on both servers, I know of no...

  • RE: Nested Query Problem

    "But your query also returns rows that have a QuestionNodeTypeUID of 6"

    Yes it does 🙂 I didn't realize from the description that these rows shouldn't be included. Anyway, you fixed...

  • RE: Need reult in one line

    Without checking what your queries do and whether they couldn't be merged into one somehow.... you can do this (replace * with actual column names you want to display):

    SELECT...

  • RE: Nested Query Problem

    Hmmm... not as simple as Daryl understood it I think, but very close to it. I suppose it was meant as "where the ParentUID column does not point to QuestionTreeUID column (the...

  • RE: Stored Procedure Recovery

    If you don't have a backup, you can not recover the original procedure. It was overwritten with the new one.

    I suppose you used ALTER PROCEDURE, because if you use...

Viewing 15 posts - 601 through 615 (of 1,217 total)