Forum Replies Created

Viewing 15 posts - 4,876 through 4,890 (of 26,490 total)

  • RE: Convert Varchar to Int

    You want something like this:

    create table #TestData (Data varchar(5));

    insert into #TestData

    SELECT

    Data

    FROM (VALUES

    (CAST('1' AS VARCHAR(5))),('11'),('2'),('A1'),('A10'),('A11'),('246'),('AB1'),

    ('AB10'),('100'),('256'),('B1'),('B2'),('124'),('20'),('B21'),('B31'),('32'),('68')

    ) d (Data);

    select * from #TestData;

    select cast(Data as int) from #TestData where Data not like...

  • RE: Are the posted questions getting worse?

    Looks like I'll miss the SQLSaturday in Denver, I'll be at a U18 Girls soccer game since I am the head coach.

  • RE: Using XML Data in Microsoft SQL Server 2012 Management Studio: Set IDENTITY_INSERT [dbo].[Orders] ON/OFF problem! How to resolve it?

    From your post:

    -- #3 Table ------------------------------------------------------------------#3 Table

    /****** Object: Table [dbo].[Orders] ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE TABLE [dbo].[Orders](

    [OrderID] [Int] IDENTITY(1,1) NOT NULL,

    [CustomerID] [int] NOT NULL,

    [OrderNumber] [nvarchar] (50) NULL,

    [OrderDate] [datetime] NULL,

    CONSTRAINT [PK_Item]...

  • RE: what's the best practice to count distinct?

    halifaxdal (7/7/2015)


    You are the only one who can tell us which is correct. We can't see your data and you really haven't told us what the expected results should look...

  • RE: what's the best practice to count distinct?

    halifaxdal (7/7/2015)


    halifaxdal (7/7/2015)


    Thank you. Of the two queries, which returns the correct result?

    In some cases they give me same result, in some cases, different number. That's why I don't understand...

  • RE: HELP CONVERTING COMMA-DELIMITED COLUMN TO ROWS

    Nilssond (7/7/2015)


    CREATE TABLE ANCILLARYVALUES(CUSNO VARCHAR(11), STARTDATE DATE, ENDDATE DATE, VALUELIST VARCHAR(14))

    INSERT INTO ANCILLARY VALUES(CUSNO, STARTDATE, ENDDATE VALUELIST) VALUES('66655544401', 01/01/2015, NULL, 'RX0001,RX0002')

    INSERT INTO ANCILLARY VALUES(CUSNO, STARTDATE, ENDDATE VALUELIST) VALUES('66655544402', 01/01/2015, NULL,...

  • RE: what's the best practice to count distinct?

    halifaxdal (7/7/2015)


    Thank you. Of the two queries, which returns the correct result?

    You tell us.

    Try providing us with the DDL for the table(s), sample data for the table(s), and expected results...

  • RE: Asynchronous Cursor Population Slow for Large Result Sets

    Still would help to know what you are trying to accomplish. We can't see what you see and don't understand the problem you are trying to solve. From...

  • RE: Need help with DATE should be dynamic for every day summary.

    Ranzz (7/7/2015)


    Hi Palotaiarpad,

    the date logic is used in SQL agent t-sql code which runs @ 6AM in morning and exports a CVS file.

    when the job runs at 6AM it...

  • RE: Select Query

    Here is a framework to build on:

    declare @TableName sysname,

    @SQLCmd nvarchar(max);

    declare TableNames insensitive cursor for

    select

    tab.name as TableName

    from

    ...

  • RE: The Importance of Our Work

    Jeff Moden (7/6/2015)


    jckfla (7/6/2015)


    Steve Jones - SSC Editor (7/2/2015)


    Lynn Pettis (7/2/2015)


    Work to live, not live to work.

    yes

    +1 and Amen

    By the same token, work does allow you to live. It's...

  • RE: Skill Supply and Demand

    Lynn Pettis (7/4/2015)


    Jeff Moden (7/3/2015)


    andrew gothard (6/26/2015)


    Jeff Moden (6/25/2015)


    ... one of them even told me that he'd never worked with clustered indexes before because he'd never had to work with...

  • RE: Skill Supply and Demand

    Jeff Moden (7/3/2015)


    andrew gothard (6/26/2015)


    Jeff Moden (6/25/2015)


    ... one of them even told me that he'd never worked with clustered indexes before because he'd never had to work with clustered servers...

  • RE: Are the posted questions getting worse?

    SQLBill (7/2/2015)


    Lynn Pettis (7/2/2015)


    Sean Lange (7/2/2015)


    Lynn Pettis (7/2/2015)


    I'm taking the youngest down to ERAU for a Spy Camp next week followed by a Soccer Camp the following week. I...

  • RE: Are the posted questions getting worse?

    GilaMonster (7/2/2015)


    Informal survey before I make a fool of myself in an article (again)

    Do you get the feeling that IT people, especially ones at the top-end of the field, are...

Viewing 15 posts - 4,876 through 4,890 (of 26,490 total)