Forum Replies Created

Viewing 15 posts - 61 through 75 (of 330 total)

  • RE: Using CTE

    luissantos (4/3/2011)


    Hello comunity

    Don´t worry anymore about my problem , but i solve them.

    best regards

    Luis Santos

    Great that you yourself had tried and solved the problem.can you post how did you achive...

  • RE: Updating tables

    Hi,

    There are many ways you can have history of your data,since you are using SQL 2008 there are new features are there where you can use them depending upon...

  • RE: F5 Problem

    There is another 2 opition

    1." CTRL+E " to execute the query same as F5.

    2." ALT+X " to execute the query same as F5.

  • RE: Converting Decimal to Varchar

    It is very simple.

    You need to cast whole thing not the particular price alone

    SELECT Case when Cgi.SUBJECT_TO_PER_DIEM = 'F' then CAST(Cgi.EXTENDED_LIST_PRICE AS VARCHAR)

    ...

  • RE: Testing Two Tables Data for Equality

    You can check with BINARY_CHECKSUM()

    BINARY_CHECKSUM can be used to detect changes to a row of a table.

    declare @Temp table(Col0 int ,Col1 int ,Col2 int )

    declare @Temp1 table(Col0 int...

  • RE: Query

    Hi,

    This is what you are looking for

    declare @Temp table(h varchar(50) ,J varchar(5))

    insert @Temp

    Select '10.69.56.109', 'A'

    UNION ALL Select '10.69.56.109', 'B'

    UNION ALL Select '10.69.56.109', 'C'

    UNION ALL Select '10.69.56.109', 'D'

    UNION ALL...

  • RE: Display 2 rows as 1 result in a column

    SpitFireXVII (4/1/2011)


    Thanks Guys. That string concatenation doc is very useful.

    I knew I had a solution using for xml path but just couldn't get it right.

    Grasshopper, your query works like...

  • RE: Need Records from strings

    Try this,

    CHARINDEX will help u

    CREATE TABLE #abc_tmp

    (Path nvarchar(850))

    insert into #abc_tmp values('rptclientrifvdistrictgrantstatuschangelog_MillmanR_9dfb3dfa-081b-48d1-8bbf-81361bbd9cb9')

    insert into #abc_tmp values('rptclientrifvdistrictgrantstatuschangelog_MeiA_e472f742-c6a3-4a70-822e-1c5417efb293')

    insert into #abc_tmp values ('rptclientrifvglobalgrantproposalbytrackingnumber_BateyK_23eafa59-e222-462d-a08c-27ed8131c274')

    Select SUBSTRING(Path,0, CHARINDEX('_',Path) ), * from #abc_tmp

    DROP TABLE #abc_tmp

  • RE: Compatibility Check across multiple Modes

    hi,

    Have a look on this

    declare @flg tinyint

    Select @flg= case when cmptlevel=100 then 1 when cmptlevel=90 then 2 when cmptlevel=80 then 3 end

    from master.dbo.sysdatabases

    Select @flg

    IF @flg=1 exec...

  • RE: Don't understand pivot

    hi,

    Have a look at this

    declare @SomeTable1 table (Project varchar(200),users varchar(30), Roles varchar(200))

    insert into @SomeTable1 values

    ('Project 1' , 'Bill', 'Project Leader'),

    ('Project 1 ', 'Jim ', 'Executive Lead'),

    ('Project 1 ',...

  • RE: Getting the query based on Cols

    pawan.boyina (3/9/2011)


    Please provide a query which would be similar to......which would be helpful for table containing more number of columns and you want to remove few.

    select * from a table...

  • RE: use go inside a transaction

    Just for the information to Know;

    Go : Signals the end of a batch of Transact-SQL statements to the SQL Server utilities.

    From the below you may get the idea:

    declare @i...

  • RE: Without using CTE, Please provide a recursive method

    dba.varun.in (3/3/2011)


    Hi friends,

    I had a table which contain customerID,Invoice,TotalPayment

    CID InvoiceAmount Total_pay Result

    A ...

  • RE: how to display the months based on date

    Hi

    You no need to hardcode the months,we can get them by

    Select datename(month,getdate()-30)-- Last Month

    Select datename(month,getdate())-- Current Month

    Select datename(month,getdate()+30)-- Next Month

    need to pass the date,...

  • RE: Difference in tables columns

    Hi,

    Is this what you needed.

    declare @Tb1 table (OrderID int, ProductID varchar(2), Quantity int, Price int ,Total int )

    declare @Tb2 table (OrderID int, ProductID...

Viewing 15 posts - 61 through 75 (of 330 total)