Forum Replies Created

Viewing 15 posts - 3,781 through 3,795 (of 8,731 total)

  • RE: dynamic cursor

    ratloser99 36160 (11/19/2015)


    Excuse me, but this reply doesn't help me :unsure:

    Seriously? And should I know why? Or should I guess?

    It's a basic programming fact that variables have scope. In T-SQL,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: dynamic cursor

    You never declare the variable @db_name, which should be declared in the same scope that you declare the cursor.

    You really have a weird way of doing things, I missed things...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Insert into select from - View

    Minnu (11/19/2015)


    CREATE VIEW [dbo].[test_view]

    AS

    INSERT INTO s_info

    (

    s_num, s_name

    )

    SELECT DISTINCT p_id, p_name

    FROM unify

    ERROR : Incorrect syntax near the keyword 'INSERT'.

    Please help

    You can't do anything in a view except for a single...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: SQL Left join 4 tabels

    I'm sorry, I can't see the screenshot. It would be better if you post DDL for the tables instead of screenshots.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: concatenation of two columns as single

    I know this might seem like more work, but it should be faster than using the scalar function, which is basically a udf.

    SELECT DATETIMEFROMPARTS(

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: String Compare

    I would try to use an adequate collation for the comparison.

    DECLARE @C NVARCHAR(10),@R NVARCHAR(10)

    SELECT @C=N'12'

    SELECT @R=N'12'

    SELECT UNICODE(@C),UNICODE(@R), @C, @R

    IF @R = @C COLLATE Latin1_General_Bin

    BEGIN

    SELECT 1

    END

    GO

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    DonlSimpson (11/18/2015)


    ZZartin (11/18/2015)


    Ed Wagner (11/18/2015)


    anthony.green (11/18/2015)


    eccentricDBA (11/18/2015)


    crookj (11/18/2015)


    anthony.green (11/18/2015)


    Ed Wagner (11/18/2015)


    anthony.green (11/18/2015)


    Ed Wagner (11/18/2015)


    anthony.green (11/18/2015)


    djj (11/18/2015)


    Ed Wagner (11/17/2015)


    djj (11/17/2015)


    DonlSimpson (11/17/2015)


    djj (11/17/2015)


    Ed Wagner (11/17/2015)


    crookj (11/17/2015)


    Blizzard (Snow Day)

    Snow Thrower

    Shovel

    Dig

    Work

    Home

    Family

    Fortunes

    Savings

    Interest

    Investment

    Return

    Gosub 🙂

    BASIC

    Visual

    Foxpro

    Star

    Rock

    Paper

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Checking Multiple Fields in a Table

    Something like this?

    CREATE TABLE RACE(

    MEMBNO CHAR(15) NOT NULL,

    RACE_AI CHAR(1) NULL,

    RACE_AS CHAR(1) NULL,

    RACE_WH CHAR(1) NULL,

    RACE_BL CHAR(1) NULL,

    RACE_NH CHAR(1) NULL,

    RACE_NA CHAR(1) NULL)

    INSERT INTO RACE

    VALUES ('0001', 'Y', NULL, NULL, NULL, NULL, NULL)

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: String Function

    My options:

    SELECT

    MAX( CASE WHEN ItemNumber = 1 THEN Item END) AS Col1,

    MAX( CASE WHEN ItemNumber = 2 THEN Item END) AS...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Brandie Tarvin (11/18/2015)


    robert.sterbal 56890 (11/18/2015)


    Luis Cazares (11/18/2015)


    Why should we consider using hashtags? Is there any benefit on that? The forum software won't recognize them, I'm not sure if search engines...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Clause in ON vs Clause in WHERE what's the best for performance

    scorpman (11/18/2015)


    Hi,

    I have a question, in terms of performance what's best in a query with LEFT JOIN:

    - Put the clause in ON of the LEFT JOIN

    - Put the clause in...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    robert.sterbal 56890 (11/18/2015)


    have we ever considered using a hashtag in the forums #OMG #BooksOnline #etc?

    We're usually reference Books Online by name and most times include a link to the page...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Nested Schemas

    Carlo Romagnano (11/18/2015)


    patricklambin (11/18/2015)


    I would advice to prohibit this way of coding/naming.

    I disagree, naming conventions should reflect the factory needs. So, it may be that [Sales.XXX] is good in some...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Constraints renaming

    You're right, those issues might cause a problem. They didn't in my current environment, but I'd be willing to improve the script if you help me with some DDL to...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: t-sql 2012 passing lot of values in a parameter

    SoHelpMeCodd (11/18/2015)


    Luis Cazares (11/17/2015)Even if a strongly typed method is used, I would consider that fixing bad data should be important. Creating a list of integers and splitting it, shouldn't...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 3,781 through 3,795 (of 8,731 total)