Forum Replies Created

Viewing 15 posts - 976 through 990 (of 1,217 total)

  • RE: Sum of money

    You could try SELECT (SELECT ISNULL(sum(penaltyAmt),0)) FROM dbo.penalties) -

    (SELECT ISNULL(sum(awardAmt),0) FROM dbo.awards), or maybe SELECT (SELECT sum(ISNULL(penaltyAmt,0)) FROM dbo.penalties) -

    (SELECT sum(ISNULL(awardAmt,0)) FROM dbo.awards), or a combination of both. I guess...

  • RE: SQL Statement using sum function

    What values are possible in the point column? Any, or are there some limitations (like minimum = 5, maximum = 35, increment of 5)?

    Anyway, this request goes IMHO against the...

  • RE: maximum row size (16845) exceeds the maximum number of bytes per row (8060)

    I have never used SQLS with languages that use cyrillic letters like Russian or Bulgarian, but I understand that these languages don't require NVARCHAR datatype. It is necessary only for those...

  • RE: SQL change properties error

    Well, I didn't, but it seems you should check 2 things: whether your account has sufficient privileges on SQLS (are you System Administrator?), and whether you can access the new default location and...

  • RE: Login failed for user ''''(null)''''. Reason: Not associated with a trusted SQL Server connection."

    Just on a side note.. we are using NT authentication only and yesterday I received precisely the same error message when I changed my domain password from another computer, and then continued to work on my own PC without restarting...

  • RE: Update Query

    Well, it depends on what precisely you want to do. If you just want to replace a string that is known, this is the solution:

    select FilePath, REPLACE(FilePath,'SERVER1','MYSERVER') as NewFilePath

    from dbo.BulkImages

    where...

  • RE: Select statement for last 3 records

    You're welcome! In fact, my method works too, as long as the purchases of each customer can be ordered unambiguously (i.e. ORDER BY criteria are such, that there are no...

  • RE: Select statement for last 3 records

    Hello Carol,

    there are several ways to accomplish that. If you will prepare similar reports often, then it would be best to handle them with a reporting tool (like Reporting Services)....

  • RE: Receiving an syntax error

    Hmm... not sure what you need, but maybe it is this?

    SELECT p.ProductID, c.ProductCategoryName, p.CompanyID

    FROM Product p

    JOIN Categories c on c.ProductCategoryId = p.ProductCategoryId

    WHERE p.companyid = @idcompany

    AND c.Productcategoryid = 20

    HTH, Vladan

  • RE: line numbering

    You said to go easy, so I will try to describe the solution in words first.

    To create line numbering, you first have to decide how to assign line numbers (how do...

  • RE: Custom Sort

    You will have to assume at least something, otherwise it is hard to implement sorting... What about 6 or 10 digits for each number between the delimiters, wouldn't that be...

  • RE: UDB to SQL conversion

    Or, if you want to use aliases, you can write it like this (define alias in FROM, no table name or alias necessary for the column to be updated... it...

  • RE: Renaming tables in Enterprise Manager

    Well, I suppose tscott renames table this_month_sales to previous_month_sales or something equally horrible otherwise I can hardly imagine why anyone would need to...

  • RE: conditionally running a tsql-script

    If you need to run the entire sequence every time the condition is fulfilled, then I'd say SP is a good solution, and not at all patchy. Question is, whether GO is...

  • RE: Where clause depending of parameter

    Your code is fine, Lina - but if you really want to avoid IF/ELSE solution, then try this:

    create table #table1(id int identity, col varchar(10))

    insert into #table1 values ('yes')

    insert into #table1...

Viewing 15 posts - 976 through 990 (of 1,217 total)