Forum Replies Created

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

  • RE: SQL Server Spatial Data - Working with Circles

    Simplest method is to use STBuffer, the parameter passed is effectively the radius.

    😎

    DECLARE @CIRCLE GEOMETRY = geometry::Point(1.00,1.00,0).STBuffer(1);

    SELECT @CIRCLE

  • RE: Converting Integer Values to Datetime

    My preferred method would be

    😎

    SELECT DATEADD(HOUR,@hour,CONVERT(DATETIME,CAST(@date AS VARCHAR(8)),112))

  • RE: sp_send_dbmail truncates when attaching query results.

    Francis S. Mazeika (7/13/2014)


    I have 12 SQL 2014 instances in 3 different domains (dev, test, stage).

    Each SQL instance has 3 distinct email profiles and each domain has its own mail...

  • RE: Importing Poorly Formatted Text File

    marg 14154 (7/14/2014)


    I am trying to import a text file to a SQL server table using SISS. I use SSIS but this is my first time in import this type....

  • RE: SQL as a service? How to manage abuse?

    jumbojim22 (7/14/2014)


    Hello,

    Consider a set of static data of which I want people to run their own queries against.

    What methods might be available to prevent someone from either purposely (or...

  • RE: Distinct Statement Mystery

    fgrubercpa (7/14/2014)


    I have a db of Contacts - it's real simple, NAME, ADDRESS, CITY, ST, ZIP, etc...

    I CAN DO

    SELECT ST

    FROM TABLE

    and I get all of the ST...

  • RE: Remove Hyphen from End of String

    My bad or rather a lack of tanker sized industrial strength coffee this morning, the RIGHT function isn't available in SQL Server 2000, sorry about the confusion here.

    😎

  • RE: Difference between ROWS UNBOUNDED PRECEDING And ROWS BETWEEN 2 PRECEDING AND CURRENT ROW

    The answer depends, the default framing of a window function varies depending on the function. As an example, the first_value function has the default framing of rows between unbounded preceding...

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

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