Forum Replies Created

Viewing 15 posts - 7,231 through 7,245 (of 8,760 total)

  • RE: Are the posted questions getting worse?

    GilaMonster (9/1/2014)


    Anyone feel up to some trigger fun?

    http://www.sqlservercentral.com/Forums/Topic1609279-1292-1.aspx

    Not certain there was a comprehension of the punchline:-P

    😎

  • RE: Can you perform 3 actions in one trigger?

    Here is somewhat a generic sample, should get you passed this hurdle. This is not a complete solution but rather a demonstration of the technique.

    😎

    First the schema and the sample...

  • RE: Can you perform 3 actions in one trigger?

    crazy_new (9/1/2014)


    Quick questions below

    😎

    First table that I am deleting from, i'm inserting the new values into. The reason I have to delete from that table is to avoid duplicate...

  • RE: Trimming Last 3 Numbers from some Records

    Guitar_player (9/1/2014)


    Eirikur Eiriksson (9/1/2014)


    Here is another method, find the last character which is not space or numeric

    😎

    Hi Eiriksson,

    There are also quite records like 'ABC DEF 210...

  • RE: Trimming Last 3 Numbers from some Records

    Here is another method, find the last character which is not space or numeric

    😎

    USE tempdb;

    GO

    ;WITH SAMPLE_DATA(ID,Column1) AS

    (SELECT ID,Column1 FROM

    (VALUES

    (1,'ABCD 123')

    ,(2,'XY 567')

    ,(3,'ghj 001')

    ,(4,'RUT')

    ,(5,'PUT')) AS X(ID,Column1)

    )

    ,T(N) AS (SELECT N FROM (...

  • RE: Query Assistance - pulling latest info data from table..

    cliffgettings (8/29/2014)


    Jack Corbett (8/29/2014)


    Sounds like a good use for RowNumber() something like this (since I don't have your schema I'm just guessing at some things see the first...

  • RE: enumerating gaps between islands, ideas?

    Here is another code example using your data sample

    😎

    USE tempdb;

    GO

    ;WITH system_log(PK_ID,Sequence_ID) AS

    ( SELECT PK_ID,Sequence_ID FROM

    (VALUES

    (1035590, 35587),

    (1035589, NULL),

    (1035586, NULL),

    (1035585, NULL),

    (1035584, NULL),

    (1035583, 35583),

    (1035582, NULL),

    (1035581, NULL),

    (1035579, NULL),

    (1035578, 35553),

    (1035554, NULL),

    (1035550, 35550)) AS X(PK_ID,Sequence_ID)

    )

    SELECT

    ...

  • RE: t-sql 2012 calculate age

    caffeinated (8/31/2014)


    True, date conversions get tricky depending on context. But taking into account students, and school system, I'm guessing that level of accuracy isn't necessary.

    Your example introduces division by...

  • RE: enumerating gaps between islands, ideas?

    Quick thought, no need to use recursion or loops, rather use the LAG window function. Here is a quick sample code with some test data.

    😎

    USE tempdb;

    GO

    DECLARE @TEST_DATA TABLE

    (

    ...

  • RE: t-sql 2012 calculate age

    Quick thought, the datediff function sometimes plays tricks on us, not to be trusted blindly, look at this sample

    😎

    USE tempdb;

    GO

    DECLARE @TEST_DATA TABLE

    (

    TD_ID INT...

  • RE: Can I use WHILE in a CTE?

    michielbijnen (8/31/2014)


    I have added CREATE and INSERT queries!

    Could you explain what you had in mind with the MOD function?

    Thx!

    Good job with the DDL and the sample data, will have a...

  • RE: using linked server object name in join statements, a best practice?

    polkadot (8/31/2014)


    Now the DB_2 is moved to another server, SRV_B, the LSRV_A would have to be changed to point to SRV_B etc.,

    Yes, and that's his point. That if a lot...

  • RE: using linked server object name in join statements, a best practice?

    polkadot (8/31/2014)


    Clarification of your answer please.

    If there are 2 servers whose databases are linking to a 3rd server's database, do each of the 2 server's linked server names have to...

  • RE: Tempdb grows from nothing to 10G in just a few seconds

    Thanks for sharing the information. One quick question, what is the isolation level set in the connection configuration?

    😎

  • RE: Trigger

    The default constraint will only work on inserts not updates. The code sample below demonstrates this.

    😎

    USE tempdb;

    GO

    CREATE TABLE dbo.TBL_TEST_CONSTRAINT

    (

    TC_ID INT IDENTITY(1,1) NOT NULL

    ...

Viewing 15 posts - 7,231 through 7,245 (of 8,760 total)