Forum Replies Created

Viewing 15 posts - 10,831 through 10,845 (of 26,489 total)

  • RE: how to split a comma seperated value in a table into diffrent column?

    sivag (7/6/2012)


    i used this way

    Create table #temptable2 (firstlevel varchar(200),ThirdLevel varchar(8000) ) ;

    insert into #temptable2 (firstlevel,ThirdLevel ) VALUES ('count1','serv,dan,ton');

    insert into #temptable2 (firstlevel,ThirdLevel ) VALUES ('count2','wers,tdan,tondrer,fhhgj,tern') ;

    WITH Cte AS (

    ...

  • RE: Update records

    Then your trigger needs to be modified to handle multiple rows.

  • RE: Update records

    With as little information as you provided, other than telling you to lookup cursors in BOL, nope.

    First question I have is why do you have to it row by row?...

  • RE: last day of any year

    Brandie Tarvin (7/6/2012)


    tim.cloud (7/6/2012)


    For my business, it begins on the first day of October and ends on the last day of the following September.

    In addition to what everyone else has...

  • RE: last day of any year

    Code has been replaced and I included some test data with it.

  • RE: last day of any year

    tim.cloud (7/6/2012)


    For my business, it begins on the first day of October and ends on the last day of the following September.

    The follow snippet should work for you. Simply...

  • RE: Starting to Program

    mstjean (7/6/2012)


    Keypunch/Show of Hands

    And how many decks of cards did YOU drop before you learned to be certain the switch on that machine was set to PRINT = ON ?

    (and...

  • RE: Starting to Program

    Steve Jones - SSC Editor (7/6/2012)


    Michael Meierruth (7/6/2012)


    Steve,

    I got a real bang seeing that photo on the right hand side of your editorial. Not many people can say they actually...

  • RE: Basic operation with range of date

    Have to agree, as I came up with the same code:

    DECLARE @StartRange DATETIME = '2012-07-06 03:01:00';

    DECLARE @EndRange DATETIME = '2012-07-06 8:20:00';

    WITH SampleData AS (

    SELECT

    TableName,

    CAST(TableStartTime AS DATETIME) TableStartTime,

    CAST(TableEndTime AS DATETIME) TableEndTime,

    TableIndex

    FROM

    ...

  • RE: last day of any year

    dan-572483 (7/6/2012)


    How about create procedure sp_lastdayofyear (@year int) as

    select Convert(date,convert(varchar(4),@year)+'-12-31')

    No real difference between CAST or CONVERT.

    SET NOCOUNT ON;

    DECLARE @MyDate DATE;

    SET STATISTICS TIME ON;

    WITH e1(n) AS (SELECT n FROM (VALUES (1),(1),(1),(1),(1),(1),(1),(1),(1),(1))...

  • RE: how to split a comma seperated value in a table into diffrent column?

    Also, be sure you read the comments and the article that is referenced in the comments, and then follow that up by reading the discussion for the article as well....

  • RE: how to split a comma seperated value in a table into diffrent column?

    Like this, code includes a new delimited split function for you.

    USE [SandBox]

    GO

    /****** Object: UserDefinedFunction [dbo].[DelimitedSplit8K] Script Date: 07/06/2012 10:14:55 ******/

    IF EXISTS (SELECT * FROM sys.objects...

  • RE: last day of any year

    Gullimeel (7/4/2012)


    hello fellas,i need some code or logic that will always provide the last day of any year.i know its a vague question but any help is appreaciated. thanks

    Last...

  • RE: declare variable

    surma.sql (7/5/2012)


    GilaMonster (7/5/2012)


    surma.sql (7/5/2012)


    s.vcDisplaySchoolName = '@vcDisplaySchoolName'

    By wrapping that in quotes you're asking for rows that have a school name of "@vcDisplaySchoolName", not the value of the variable. Lose the...

  • RE: I want to move a database server to server without using Backup and restore?

    Daxesh Patel (7/5/2012)


    What about taking compressed backup over network?

    If the network is stable, it would work. I personally prefer to do backups to a local resource as even a...

Viewing 15 posts - 10,831 through 10,845 (of 26,489 total)