Forum Replies Created

Viewing 15 posts - 12,916 through 12,930 (of 13,460 total)

  • RE: Need to display decimal value converting it to non decimal 13 character numeric string replacing unused character positions with ''''0''''

    might be a better way, i did it this way because of the decimal point:

    declare  @SomeValue        money

    Set @SomeValue=740002.64

    select right( '0000000000000' +  CONVERT(varchar,convert(int,(@SomeValue * 100))),13) AS FinalAnswer

    select right(REPLICATE('0', 13) +  CONVERT(varchar,convert(int,(@SomeValue...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Multiple Rows to One Column Results

    does this work?

    change the last statement at the end to the following:

    set @myAreaCode ='SELECT top 5 @myAreaCode = @myAreaCode + ISNULL(AreaCode,'') + ',' from @stage'

    set @myAreaCode ='''

    SELECT...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Multiple Rows to One Column Results

    the normal Caveats for this question: you should do this at the presentation layer, whether it is an app or a web page, because it's easier.

    here's one way to do...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Dynamic sql 4000 character limit workaround problem.

    I was under the impression that you could exec any size command like this:

    DECLARE @sql1 nvarchar(4000),

    @sql2 nvarchar(4000),

    @sql3 nvarchar(4000),

    EXEC sp_executesql @sql1 + @sql2 + @sql3, N'@hDoc int, @p_blnTracking bit,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to determine concurrent user ?

    hope what i posted was helpful.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to determine concurrent user ?

    assuming that one machine can run as many instances as you want, but only 5 users, this might get you started:

    in my poor example below, you can see that the...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: RefreshView for all dependcies

    yould want to use something like this:OBJECTPROPERTY(OBJECT_ID(OBJNAME), 'IsSchemaBound')=0  means false, and OBJECTPROPERTY(OBJECT_ID(OBJNAME), 'IsSchemaBound')=1 means true

     

    so i'd use something like this for the cursor:

    select name from sysobjects where xtype='V' and OBJECTPROPERTY(OBJECT_ID(NAME), 'IsSchemaBound')=0...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to determine concurrent user ?

    It kind of sounds like he wants a limit for an application, to prevent more than 5 instances, instead of 5 users to the sql database.... am i right?

    you'd still...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: RefreshView for all dependcies

    i was originally going to post about the wonders of sp_recompile, but it didn't work as expected. I thought it recompiled dependant objects as well, causing a chain reaction, but...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: RefreshView for all dependcies

    in SQL 2000 you can run sp_MSdependencies with no parameters to get the list of objects in a order of hierarchy, but it's not perfect if you have a circular ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: ODBC driver 2000.85.1117.00

    According to the Microsoft DLL search db (below)

       http://support.microsoft.com/dllhelp/default.aspx?dlltype=file&l=55&alpha=SQLSRV32.dll&S=1&x=9&y=9&start=150

    File sqlsrv32.dll is released

       2000.85.1117.00 for XP sp2

       2000.85.1022.00 for Mdac2.8 or Windows 2003

    same dll, two different...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Confused with the order of server and database collations

    here is a script i use to change collation for a db that is different than what i usually use.

    note that the sample below has TOP 5 limitation to see...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Is there a way to search the database for a certain datatype?

    SELECT

      SYSOBJECTS.NAME AS TBLNAME,

      SYSCOLUMNS.NAME AS COLNAME,

      TYPE_NAME(SYSCOLUMNS.XTYPE) AS DATATYPE

        FROM SYSOBJECTS

          INNER JOIN SYSCOLUMNS ON SYSOBJECTS.ID=SYSCOLUMNS.ID

        WHERE SYSOBJECTS.XTYPE='U'

        AND TYPE_NAME(SYSCOLUMNS.XTYPE) IN ('VARCHAR','NVARCHAR','CHAR','NCHAR')

        ORDER BY TBLNAME,COLNAME

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: listing contents of Store Procedures?

    i prefer to simply catch the results of sp_helptext PROCNAME into a recordset, and print hte results from that;

    Sub a()

        Dim sql As String

        Dim rs5 As ADODB.Recordset

        Set rs5...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: create a view in every db on server

    can't you just create a view and make the owner INFORMATION_SCHEMAS, so it shows up/is available everywhere? there's several articles and posts that mention doing that.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 12,916 through 12,930 (of 13,460 total)