Forum Replies Created

Viewing 15 posts - 7,831 through 7,845 (of 8,753 total)

  • RE: Search Special characters

    Quick suggestions, you could use the UNICODE function, something like this

    😎

    USE tempdb;

    GO

    DECLARE @TEST_STR TABLE

    (

    TEST_STRING NVARCHAR(255) NOT NULL

    );

    INSERT INTO @TEST_STR(TEST_STRING)

    VALUES

    (N'MFY RLHH CSQÉ')

    ,(N'Aamj Gxmolwn Slf Yytrzgan Hiwd...

  • RE: RTRIM not removing trailing spaces

    Quick question, what do you get from the following query?

    😎

    SELECT UNICODE(RIGHT([the string in question here],1))

  • RE: Removing xmlns="" in child tags and elements

    Quick questions,

    1. Can you provide some sample data?

    2. How are you querying the staging tables?

    3. What is your SQL Server Version?

    😎

  • RE: Locking behavior on indexed views

    Quick thought, a solution might be replacing the group by with the over clause

    😎

    SELECT [BusinessEntityID],

    [FirstName],

    [MiddleName],

    [LastName],

    SUM([Quantity]) OVER (PARTITION BY [BusinessEntityID], [FirstName], [MiddleName], [LastName]) AS [SUMQuantity]

    FROM [Person].[Person]

  • RE: Remove Hyphen from End of String

    Ouch....of course my code is overly complicaded and will fail on 2K because of the values clause. More coffee...

    😎

  • RE: Remove Hyphen from End of String

    GF (7/13/2014)


    Thank you for your reply.

    I am using SQL 2000, sorry I did not mention that.

    Thanks

    Gary

    Sorry about that, my bad and a typical BFC (Before First Coffee) syndrom:-P

    😎

    Here is a...

  • RE: Remove Hyphen from End of String

    This should get you passed the hurdle

    😎

    USE tempdb;

    GO

    DECLARE @Cars TABLE

    (

    Car_id INT IDENTITY(1,1) PRIMARY KEY CLUSTERED NOT NULL

    ,Description NVARCHAR(255) NULL

    );

    INSERT INTO @Cars(Description)

    VALUES...

  • RE: Single Quotation Marks in SQL

    For fun and to further on my previous post on simplifying nested string handling, here is another method which uses a pass-through parameter for sp_executesql.

    😎

    DECLARE @ONELL NVARCHAR(50) = N'O''Nell';

    DECLARE @PARAM...

  • RE: In control flow: how to create date time stamp to use in downstream tasks.

    You can use an ExecuteSql task with a query that returns the date time string, here are two of quite few options.

    😎

    SELECT CONVERT(VARCHAR(32),GETDATE(),112)

    ...

  • RE: Cursors

    Just throwing in my 2 cents here, some different looping and different type of cursors. Note that the STATIC cursor is the fastest of the lot.

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    DECLARE @SAMPLE_SIZE...

  • RE: The "Numbers" or "Tally" Table: What it is and how it replaces a loop.

    Jeff Moden (7/10/2014)


    Performance test code?

    Firstly, apologies for the late response, slightly busy period:-D

    I am not going to even bother with the code I posted earlier, it doesn't stand a chance;...

  • RE: How to call a stored proc once per each row of a table, without using CURSOR

    From what I can gather, there is no need for a cursor. It can change depending on the actual work required!

    😎

    USE tempdb;

    GO

    IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.ROUTINES

    ...

  • RE: Insert text in a text field

    Claudio Pinto (7/12/2014)


    Thanks a lot Eirikur 🙂

    You are welcome Claudio;-)

    😎

    You should anyway look into replacing the text data type, as according to MSDN "ntext , text, and image data types...

  • RE: Insert text in a text field

    First a quick question, why use [text] data type? Better change that to a (n)varchar(max)!

    Below is a quick example of the replace function (on varchar(max)), does not work on text.

    😎

    USE...

  • RE: Splitting time span into multiple entries

    Just a quick thought on this problem; there is no need for any string manipulation.

    😎

    DROP TABLE #Sample

    CREATE TABLE #Sample (Startdate DATE, [start-time] INT, [end-time] INT, duration INT)

    INSERT INTO #Sample (Startdate,...

Viewing 15 posts - 7,831 through 7,845 (of 8,753 total)