Forum Replies Created

Viewing 15 posts - 391 through 405 (of 627 total)

  • RE: Are the posted questions getting worse?

    For film buffs out there I highly recommend 'Ex Machina'. Recently watched it on Netflix and it blew me away. I'm so rarely impressed by movies anymore...maybe I'm...

  • RE: numeric data in varchar datatype

    Just a couple things to consider. Make sure you validate your data to make sure it's actually a number. i.e. (ISNUMERIC). Secondly, try to avoid using CONVERT in...

  • RE: Return unique rows

    Please include any DDL statements for test data next time. People will be much more willing to help.

    I think this will do...cheers.

    DECLARE @test-2 TABLE (contractno INT, Address1...

  • RE: Make Rows to a Column

    Luis Cazares (1/29/2016)


    yb751 (1/29/2016)


    J Livingston SQL (1/29/2016)


    nice....but when there is an unknown number of values, how does the dynamic sql work?

    LOL...yeah now that you mention it, that would be a...

  • RE: Make Rows to a Column

    J Livingston SQL (1/29/2016)


    nice....but when there is an unknown number of values, how does the dynamic sql work?

    Here is a stab at it...but I'm not saying it's pretty. 😉

    CREATE TABLE...

  • RE: Make Rows to a Column

    J Livingston SQL (1/29/2016)


    nice....but when there is an unknown number of values, how does the dynamic sql work?

    LOL...yeah now that you mention it, that would be a complete pain if...

  • RE: Make Rows to a Column

    This is an example on how you can do it using a crosstab.

    DECLARE @myTable TABLE (ID INT, Name VARCHAR(10), Value VARCHAR(20))

    INSERT INTO @myTable

    VALUES

    (1, 'user', 'MYS12345'),

    (2, 'user', 'MYS12346'),

    (3, 'user', 'MYS123435'),

    (4, 'user1',...

  • RE: Can't ALTER COLUMN to NOT NULL and ADD PRIMARY KEY in the same SQL Batch?

    Hugo Kornelis (1/22/2016)


    The behaviour is as expected.

    SQL Server will always first compile an entire batch, then execute it. During compilation, various things are checked against the schema. But modifications made...

  • RE: Can't ALTER COLUMN to NOT NULL and ADD PRIMARY KEY in the same SQL Batch?

    Sorry if I misunderstand but there is a problem with doing this?

    CREATE TABLE test1 (col1 INT NULL)

    GO

    ALTER TABLE test1 ALTER COLUMN col1 INT NOT NULL

    GO

    ALTER TABLE test1 ADD CONSTRAINT PK_test1...

  • RE: Trying to find the percentage of on time shipments

    Providing sample data would have gone a long way for your cause. That being said I threw this together but since you have so little information I'm not sure...

  • RE: Cumulative Balance calculation

    ssc_san (1/21/2016)


    Thank you yb751!

    The real data has dates, but I wanted to simplify it.

    Thank you!

    At least you provided the sample data which is more than some. 😉

    Good to know the...

  • RE: Cumulative Balance calculation

    J Livingston SQL (1/21/2016)


    I do not see any transactional dates to determine an order......do you want all Bills to show before all Payments in a month?

    EDIT....moving on with a possible...

  • RE: JOIN HINTS

    Hugo Kornelis (1/14/2016)


    A very good question and I am absolutely happy with it.

    One thing that is missing is the explanation of WHY in this specific case enforcing the order impacts...

  • RE: A Bit of History

    I have to admit that I was awe struck when I first saw the Saturn Rocket up close during my tour some years back. You don't realize how massive...

  • RE: How to find duplicate sets of record?

    This is my stab at it but it's not quite right. The problem is making sure the set's are ordered correctly when they are together.

    i.e. Making sure you don't...

Viewing 15 posts - 391 through 405 (of 627 total)