Forum Replies Created

Viewing 15 posts - 271 through 285 (of 2,893 total)

  • RE: SQL Distinct comma delimited list

    Alan.B (7/24/2013)


    Erland Sommarskog (7/24/2013)


    Alan.B (7/24/2013)


    Why is the SELECT

    @x=@x+ method not guaranteed to work?

    Why would it?

    See this KB article Pay particular attention to the first sentence under Cause.

    I say it...

  • RE: Edit multiple stored procedures

    ...

    While I generally agree lets not go off on a rant.. Perhaps I read that wrong, but we don't need to be testy.

    As a rule you should never use...

  • RE: Edit multiple stored procedures

    NineIron (7/24/2013)


    Thanx. I don't think we're being served very well....................

    So, if you have no choice, but to rename database (as your client/employer requires you to do), you must go inside...

  • RE: Audit log for INSTEAD OF DELETE trigger

    RAISERROR cause transaction to rollback, so your log insert is rollbacked as well as delete...

    Check use of self-linked server in order to simulate autonomous transaction in SQL Server.

  • RE: Edit multiple stored procedures

    NineIron (7/24/2013)


    Thanx. So, if I were to copy a db and rename it from PROD to TEST, the sp's would run the same way on TEST without any code changes?...

  • RE: Edit multiple stored procedures

    Elliott Whitlow (7/24/2013)


    I'm pretty sure they are telling you wrong.. The USE statement is not permitted inside a stored procedure...

    Unless it's not in dynamic SQL, which is absolutely fine:

    CREATE PROC...

  • RE: Currious thing about Count

    dan-572483 (7/24/2013)


    I'm not sure what the point of this interview question would be, since in the real world if you needed a query that always returned 1 you would use...

  • RE: Simple Interview Question

    Sean Lange (7/24/2013)


    I would have to say that is an absolutely horrid interview question. It is not testing your skills with sql server. I have seen the binary AND around...

  • RE: SQL Distinct comma delimited list

    ksatpute123 (7/24/2013)


    Easiest way

    DECLARE @listStr VARCHAR(MAX)

    SELECT @listStr = COALESCE(@listStr+',' ,'') + Name

    FROM Production.Product

    GROUP BY Name

    SELECT @listStr

    🙂

    Yep, does look like. However...

    Correct concatenation of string values (eg. accumulating of numeric values)...

  • RE: Currious thing about Count

    tommyh (7/24/2013)


    I accidently had an unfinished piece of SQL code in my query window during execution. The code was

    select count(*)

    Now to my supprise it returned 1. Anyone know why it...

  • RE: Date convertion

    karunakar2351 (7/22/2013)


    The datatype of the column is varchar(50)

    Obviously very wrong choice for storing dates, as it allows to contain any string.

    Now, the best way to fix all possible issues...

  • RE: Date convertion

    if your column is of DATETIME or DATE datatype, it doesn't have any format. So you cannot change the format of it!

    The way SQL Server stores dates internally has nothing...

  • RE: Date Validations?

    Here is one of the short form which can be used for ITV function

    RETURN SELECT ISNULL(CASE WHEN ISDATE(@value) = 1 THEN CASE WHEN CAST(YEAR(@Value) AS CHAR(4)) = LEFT(@Value,4) THEN 1...

  • RE: Date Validations?

    Ananth@Sql (7/22/2013)


    How To Validate a year, month,and date and totaldate?Year should be in yyyy format,month should be between

    1 and 1 to 12 and date should be between 1 to...

  • RE: Do you allow Entity Framework? / Database Security Permissions

    If system architecture wants to use ORM methodology (eg. Entity Framework, NHibernate and any other) then, as DBA, you should provide relevant permission/access model.

Viewing 15 posts - 271 through 285 (of 2,893 total)