Forum Replies Created

Viewing 15 posts - 211 through 225 (of 283 total)

  • RE: Split based on the input

    I got it thanks!!

    Create Function [dbo].[Splited_Values]

    (

    @CommaSeparatedString varchar(8000)

    )

    RETURNS @Table Table ( startid int,ID int)

    Begin

    Declare @TempStr varchar(8000),@tempval int=1

    Set @TempStr = @CommaSeparatedString + ','

    While Len(@TempStr) > 0

    Begin

    Insert Into @Table Select @tempval,SubString(@TempStr,1,CharIndex(',',@TempStr)-1)

    Set...

  • RE: Split based on the input

    hi,

    declare @input varchar(1000)='1,1,5,5,6,2'

    start, difference

    1,1

    2,1

    3,5

    8,5

    13,6

    19,2

    Go

    declare @input varchar(1000)='5,3,2'

    start, difference

    1,5

    6,3

    9,2

  • RE: Import Text file into SQL....?

    Ensure that SQL server service A/c has permission to access that file, logins should have access to that folder.

    Thanks!

  • RE: How to find column is having value or not

    I got the Solution

    Go

    CREATE TABLE TEMP (id int ,C1 INT, C2 INT, C3 INT,C4 INT,C5 INT, C6 INT)

    Go

    INSERT INTO TEMP (id,C1,C3,C5) VALUES (1,2,3,5)

    INSERT INTO TEMP (id,C1,C3,C5) VALUES (1,6,7,8)

    Select * from...

  • RE: Need Suggestions on creating new table

    Your are exactly right it is a meta data kind f thing only from meta data i will be getting this information,but there is no hard-cord rule like thing...

  • RE: Need Suggestions on creating new table

    This is the situation

    I need to create tables dynamically on run time the schema of the table will be given by customer and same time he will give the...

  • RE: Need Suggestions on creating new table

    These data hold the data of that customer related details which will be joined with some basic tables.There are some master tables are there and need to join with upcoming...

  • RE: Install SQL Server on Linux

    SQL Server can only be installed on a Microsoft Operating system, so you'd have to create a virtual environment in Linux running , say Windows XP, and then install SQL...

  • RE: Column Data Consolidation

    have some sample data here

  • RE: When was server last rebooted?

    you can get the time by running this query also

    Select name,crdate from sys.sysdatabases where name='tempdb'

  • RE: Dependent Delete statements

    You can use OR ,CASE Statements !

  • RE: Error in max(substring)

    ChrisM@Work (11/6/2012)


    DECLARE

    @MyInput VARCHAR(8000),

    @MyOutput VARCHAR(8000)

    SELECT

    @MyInput = '101011123',

    @MyOutput = ''

    ;WITH MyTable (startid, Length) AS (

    SELECT 1,1 UNION ALL

    SELECT 2,1 UNION ALL

    SELECT 3,1 UNION ALL

    SELECT 4,2 UNION ALL

    SELECT...

  • RE: Error in max(substring)

    How many different record layouts would you like to handle automatically?

    i am having some 80 columns

    And, no... this actually isn't a pivot problem. It's simply a...

  • RE: Error in max(substring)

    No, i am looking alternate method for pivot.

    i have used another way like

    DECLARE @input varchar(4000);

    DECLARE @sql NVARCHAR(MAX)

    select @input='101011123'

    SELECT @sql = ISNULL(@SQL+N','+CHAR(10),'') +

    ...

  • RE: Error in max(substring)

    Say i'm having a string like this '101011123'

    i need to split the sting based on my statid & endid

    startid, endid

    1,1

    2,1

    3,1

    4,2

    6,3

    which needs to split something like

    1,1---->1 starting position...

Viewing 15 posts - 211 through 225 (of 283 total)