Forum Replies Created

Viewing 15 posts - 2,326 through 2,340 (of 3,221 total)

  • RE: get precision part in casting

    DECLARE @Num AS Numeric(8)

    SET @Num = 73982597

    select cast(@Num/1000 as Numeric(8,3))

    This will also return what you seem to require

    select cast(73982597./1000 as numeric(8,3))

    In the code immediately above note the decimal point..

    Returns: 73982.597

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Update Table

    I belive this will give you the results you need.

    CREATE TABLE #Codes(Code INT,Subcode INT)

    INSERT INTO #Codes

    SELECT 1111, 0 UNION ALL

    SELECT 1111, 0 UNION ALL

    SELECT 222, 0 UNION ALL

    SELECT 222, 0...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: remove leading 0's from a character string

    Is this what you need?

    IF Len(REPLACE(@s,'0','' )) > 0

    select substring(@s,patindex('%[^0]%',@s),len(@s))

    ELSE

    SELECT LEN(REPLACE(@s,'0','' ))

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Issue with Data (white square AKA U+25A1 shown for Chr(10) and Chr(13)

    Are you using SQL Server Management Studio (SSMS) and displaying the query return in grid mode? If so switch the output to Text mode and the carriage return /...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Table Relationships

    gboyer (11/5/2009)

    Now I am not an expert in database design but I would say that is not a good design

    .

    Like many questions about SQL Server the answer is "It all...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Table Relationships

    Look in Books On Line (BOL) at:

    ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/41544236-1c46-4501-be88-18c06963b6e8.htm

    It will explain in great detail the information available thru the T-SQL previously posted.

    Then move on to the new system views available in SQL...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: How to improve processing of data

    For a question like yours it would be of great help to those who would try to help you to post the create tables SQL statements, supply some sample data...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Using OPENROWSET to import CSV files

    Have you tried using OPENROWSET as SELECT INTO which will create the table in the database.

    SELECT * INTO [i]you select the name of the table to be created[/i]...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Table Relationships

    Try this and see if it gives you want you need. Contribued by a member of SQLServerCentral whose name I failed to record

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    IF NOT EXISTS...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Find the List of Users and the roles ,privilieges in SQL Server

    Go to MSSQLTips.com and search for Michelle Gutzait work she has posted some sample code that will do all that you seem to want and then some more.

    Written By: Michelle...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Convert NVARCHAR columns to DATETIME

    Prehaps this will help

    CREATE TABLE #Client(ClientID INT,[bgn Date] VARCHAR(50))

    INSERT INTO #Client

    SELECT 1,'08/11/1999' UNION ALL

    SELECT 2, '26/11/1999' UNION ALL

    SELECT 3, '26/11/1999'

    SELECT Clientid,CONVERT( datetime, [bgn date], 103 ) as date from #Client

    WHERE...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: convert nvarchar to int

    Converting first to decimal and then that decimal to integer for example:

    DECLARE @Numb AS VARCHAR(50)

    SET @Numb = '-74,000.00'

    SELECT CAST(CAST(REPLACE(@Numb,',','') AS DECIMAL(10,2)) AS INT)

    But be careful as:

    DECLARE @Numb AS VARCHAR(50)

    SET @Numb...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Update with Sub Query

    For example do both the branches contain the same item identification

    It would be productive, that is getting you some assistance, to include any foreign keys, pertinent constraints...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Update with Sub Query

    It would be best if you would post the details of each of the tables, and what foreign keys exist in them in order for some one to give you...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Adjust server time for GMT

    From Books On Line

    ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/48a5b230-102e-4a89-bb2a-fcf0cac862bb.htm

    GETUTCTIME is a function in SQL 2005 check out the above link

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

Viewing 15 posts - 2,326 through 2,340 (of 3,221 total)