Forum Replies Created

Viewing 15 posts - 3,766 through 3,780 (of 8,731 total)

  • RE: Checking Multiple Fields in a Table

    Sjey (11/19/2015)


    Thank you very much Luis.

    You're welcome.

    Now the most important question. Do you understand how the code works? Would you be able to explain it if needed?

    Remember that you'll be...

  • RE: Are the posted questions getting worse?

    Jack Corbett (11/19/2015)


    Sean Lange (11/19/2015)


    It is however pretty clever.

    Talking about me again. I'm both "pretty" (in a very masculine way) and "clever". 😛

    As my wife says, mother's...

  • RE: Table design question

    Something like this? Or I misunderstood the question?

    CREATE TABLE Company_Messages(

    CompanyId INT,

    MessageID INT,

    CONSTRAINT PK_Company_Messages PRIMARY KEY (CompanyId, MessageId),

    ...

  • RE: Are the posted questions getting worse?

    You're missing the obvious way to get the current date. :hehe:

    USE [msdb]

    GO

    DECLARE @jobId BINARY(16);

    EXEC dbo.sp_add_job @job_name=N'GetCurrentDate',

    @enabled=1, @job_id = @jobId OUTPUT;

    EXEC dbo.sp_add_jobserver

    @job_name = N'GetCurrentDate' ;

    EXEC...

  • RE: LIKE unicode character in SQL Select

    vantuan02t1 (11/19/2015)


    I want to use a variable (ex: @test-2) to replace value 'College' in LIKE

    Sample:

    Select * from Table_1 where Description like N'%@test%'

    We already know this. I already post a test...

  • RE: LIKE unicode character in SQL Select

    Actually, have you tried this?

    Declare @test nvarchar(50)

    select @test = N'College'

    I'm assuming that you have a unicode character in the value which won't translate correctly into ASCII strings, instead of...

  • RE: LIKE unicode character in SQL Select

    vantuan02t1 (11/19/2015)


    Naturally I will declare a variable, sample:

    Declare @test-2 varchar(50)

    select @test-2 = 'College'

    (1) Select * from Table_1 where Description like N'%' + @test-2 + '%'

    But test result is different with

    (2)...

  • RE: Are the posted questions getting worse?

    I'm sorry, I'm just watching too much Green Batman Arrow, lately. 😀

  • RE: LIKE unicode character in SQL Select

    How did you declare the variable?

    Using this, you might get a hint:

    PRINT N'%' + @test + '%'

  • RE: Are the posted questions getting worse?

    jasona.work (11/19/2015)


    I was going to post this over in Steve's call for Good Basic T-SQL Exercises but decided not to pollute the topic with fluff...

    So I'm posting it here...

    Just for...

  • RE: concatenation of two columns as single

    You have the wrong formulas to calculate each part. Check my previous post for correct formulas.

  • RE: dynamic cursor

    Jeff Moden (11/19/2015)


    Easy guys. 'Tis the season to be jolly. 🙂

    That's me being jolly.

  • RE: Nested Schemas

    sestell1 (11/19/2015)


    I like to add square brackets around my nested schemas. :-D:crazy::hehe:

    CREATE SCHEMA [[a]].].[c]]]

    I'm not sure if that's confusing enough. 😀

  • RE: Insert into select from - View

    Minnu (11/19/2015)


    Thanks its working good.

    also wants to delete from table before insert.

    is it possible in this view...

    The insert is not part of the view, you might want to use a...

  • 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,...

Viewing 15 posts - 3,766 through 3,780 (of 8,731 total)