Forum Replies Created

Viewing 15 posts - 2,581 through 2,595 (of 2,894 total)

  • RE: Finding non-zero minimum value in each numeric column in a table in SQL Server Database

    Try this:

    DECLARE @TblName NVARCHAR(1000)

    SET @TblName = 'YourTableName'

    DECLARE @sql NVARCHAR(MAX)

    SET @sql = ' SELECT ''Minimal Values'''

    SELECT @sql = @sql + ', MIN([' + isc.COLUMN_NAME + ']) AS ' + ' [MinOf'...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Calculate Working Hour Query

    It is not very good practice to call a column IsPaused to store start time of the Pause as it is totally missleading (and looks stupid, question: IsPaused? answer: 1...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Calculate Working Hour Query

    doobya (7/4/2010)


    even simpler and more efficient is to use a single record per session:

    create table dbo.TimeLog (

    [TimeLogID] int identity

    ,[EmpID] int not null

    ,[LoginTime] datetime not null

    ,[LogoutTime] datetime

    ,[PauseDuration] int not null

    ,[SessionDuration] int...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Calculate Working Hour Query

    doobya (7/4/2010)


    I don't like complex queries over large datasets when you can easily cache the data:

    declare @timeLog table (SNO int, EMPID int, [STATUS] char(10), [DATE] Datetime, [DURATION] int)

    the logout logic...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Calculate Working Hour Query

    scott.pletcher (7/3/2010)


    For the emps with matching in/out and pause/resume rows [and presumably you edit for those who don't match up], you don't have to go thru all that.

    ...

    If I will...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: DTS package is failing after the uninstall of SQL Server 2005 components

    Read this:

    http://msdn.microsoft.com/en-us/library/bb500440.aspx

    And learn how to google 😀

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Loop, Cursor or both?

    Yes, you need to convert everything into varchar (actually, you would need to do it anyway even using your cursors). Yes you can do it with money, numerics and datetimes....

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Insight to SQL Server

    The very common result of trying to get data by hands without using appropriate tool is:

    Steve Jones - Editor (7/2/2010)


    ... Scribbles on disks...

    And, as mentioned by Steve, DBCC utilities comes...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Insight to SQL Server

    ankur_dba (7/2/2010)


    ...

    1)If i am to retrieve data stored by me in a table, without using any tool (and SSMS ofcourse), how can i do it?

    ...

    I do really like...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: String manipulation

    vbradham (7/2/2010)


    ...

    Using sql 2000 so has to be T-sql. Thanks will try it.

    ...

    How you get this bar separated data in a first place?

    Does it come from GUI or loaded from...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Sql dynamic query

    You do allow sql injection in every place where you perform string concatination. To avoid it - use sp_executesql.

    What is your table structure and what are you passing in @Demographics...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: How to create duplicate copy of database

    Back it up and restore it as database with different name

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Implicit conversion question

    Paul White NZ (7/2/2010)


    ...

    Oh, and in case you were wondering, very very few professional DBAs know the precision and scale formulas - or even that they exist, so don't sweat...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: avoiding orphans in model that allows pending consolidation

    Sample of schema you have? Some data for representing a query which you don't like? What you would like instead?

    Please click on the link at the bottom of my signature...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Calculate Working Hour Query

    You are welcome!

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 2,581 through 2,595 (of 2,894 total)