Forum Replies Created

Viewing 15 posts - 1 through 15 (of 16 total)

  • RE: Is this possible

    Hi, Hemant Kumar

    Here dbo.TRUE_VALUE() is a user-defined function. Why i  want this behaviour is because we have 3rd party people who give us space on their sql server with different...

  • RE: New SQL Guy need help

    If you want some tips how to optimize your query, you should post result of this script here.

    set showplan_text on

    go

    SELECT ... (your select)

    go

    set showplan_text off

    go

    OR You can do it yourself. The...

  • RE: help with using FOR XML

    Tanks, Karl

    You save my 'Grasshopper' time!

    Vlad

  • RE: New SQL Guy need help

    This is ODBC Outer Join Escape Sequence http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcouter_join_escape_sequence.asp

    change your code like below and try if it works:

    "...FROM

        myDatabase.dbo.tblBudgetPlanningXVYReportType XVYReportType INNER JOIN Mydatabase.dbo.tblBudgetPlanningXVYReportOutput XVY ON

            XVYReportType.xvyrtID = XVY.xvyroRTID WHERE..."

    Best Regards,...

  • RE: help with using FOR XML

    Hi grambowk, try this code:

    declare @cmd nvarchar(1000)

    set @cmd = 'bcp "select CustomerID from Northwind.dbo.Orders as Orders for xml auto, elements" queryout C:\test.xml -S'+@@servername+' -C ACP -T -w -r -t'

    exec...

  • RE: Decimals and formatting

    To Murthy: You are right, but what is the difference between .4790000000000 and .479 for SQL Server?

    SELECT CONVERT(DECIMAL(10, 3),ROUND(0.4799608993157, 3, 1)) / 1 -- .479000

    It is the client duty...

  • RE: Text to sp_xml_preparedocument

    To Bert De Haes:

    create procedure usp_tst ( @id int, @txt text = null )

    as

    begin

    set @@TEXTSIZE = .... ???

    select @txt = ... from...

  • RE: Decimals and formatting

    SELECT ROUND(0.4799608993157, 3, 1)

  • RE: Finding a zipcode

    Or like this:

    SELECT SQRT(POWER((38.492497-latitude),­2)+POWER((-121.404807-Longitude),2)) AS distance, *

    FROM location

    WHERE SQRT(POWER((38.492497-latitude),­2)+POWER((-121.404807-Longitude),2)) < .016 

    ORDER BY 1

  • RE: Searching for Text in Stored Procedures

    BOL: LIKE

    ...

    Symbol      Meaning

    LIKE '[[]'    [

    LIKE ']'      ]

    ...

    Check collation on your server, may be is case-sensitive and try this:

    select object_name(id) from dbo.syscomments where text like '%[[]Database].[[]dbo].[[]tblSpecificTable]%'

  • RE: Sort numerically from an alphanumeric column

    Hi jatighe,

    If you use SQL 2000 try this code:

    create function fn_GetOnlyNumbers

    (

        @string varchar(38)

    )

    returns numeric(38)

    as

    begin

        declare @numeric numeric(38)

        while patindex('%[^0-9]%', @string) > 0

            set @string = STUFF(@string, PATINDEX('%[^0-9]%', @string), 1,...

  • RE: sorting a column

    Jesper Mygind : Did you put any indexes on the table before running the test?

    No indexes, exept primary key on table #Numbers....

  • RE: sorting a column

    Jesper Mygind: ... It could be interesting to make a performance comparison of this to your function approach and VladRUS.ca's solution, which...

  • RE: Rows into CSV resultset

    The same result:

    SELECT @Result = COALESCE(@Result + ', ', '') + CONVERT(VARCHAR, ColA)

    FROM @MyTable

    ORDER BY ColA

Viewing 15 posts - 1 through 15 (of 16 total)