Forum Replies Created

Viewing 15 posts - 376 through 390 (of 728 total)

  • RE: How to use the AS table???

    Use it like this:

    Select TOP 10 Device.nDeviceID,

    Device.sDisplayName,

    sgroupname,

    sDescription,

    dPollTime,

    MIN(nUsed_Min),

    MAX(nused_Max),

    SUM(nSize),

    (CAST(SUM(nUsed_Min) AS FLOAT(2)) / CAST(SUM(nSize) AS FLOAT(2)) * CAST(AVG(100) AS NUMERIC(10, 2))) AS Inuse

    from statisticalDisk

    where (CAST(SUM(nUsed_Min) AS FLOAT(2))...

  • RE: Running updation in SQL

    Hope this helps:

    with CTE1(Id, name, value1, value2, value3)

    AS(

    SELECT Id, name, value1, value2, value1+value2 AS value3

    FROM dbo.T1 a

    WHERE a.Id = 1

    UNION all

    SELECT a.Id, a.name, a.value1, a.value2, b.value3+a.value2

    FROM dbo.T1 a

    inner join CTE1...

  • RE: Distinct

    Nice Ez Pz question. 🙂

  • RE: Timestamps

    Nice question. Had to give lots of time to go through each statement. 🙂

  • RE: space issue

    Lolz. Start taking backups and put a strategical purging mechanism in place for tables to purge old data. The data will be saved in the backups taken. No big deal....

  • RE: help to resolved: Login security to asign to perticular user

    Hi Mahi, I'll not give you the exact solution, but here is the clue:

    selectsu.uid, su.name, su1.uid, su1.name

    fromsys.sysuserssu

    inner join sys.sysmemberssm on su.uid = sm.memberuid

    inner join sys.sysuserssu1 on sm.groupuid = su1.uid

    This query...

  • RE: How to convince people for small changes

    GilaMonster (5/13/2013)


    sqlnaive (5/13/2013)


    One more thing, even if these indexes are getting used, the stats from dmv sys.dm_db_index_usage_stats says that index_seek+index_scan_index_lookups are almost none as compared to index_write. The question here...

  • RE: mdf file growing

    kevaburg (5/16/2013)

    arooj300I have a database whose size is almost 25 GB, there log size 18 GB and mdf file is 6.30 GB, and everyday millions of records is coming and...

  • RE: Identity Insert

    Easy question. 🙂

  • RE: Columnstore index

    Great great question. Never used Columnstore index but theoretically knew the only fact that all columns in the clustering key must be present in the nonclustered columnstore index. So picked...

  • RE: Table Alias

    Nice and easygoing question.

  • RE: Have I been smoking something?? Insert construction question.

    You can use some other buttons like [Enter], [Tab] etc and format it as per your requirement. Here comes your creativity in picture. 🙂

  • RE: mdf file growing

    arooz, could you confirm if it is log file or data file in question here ?

  • RE: Have I been smoking something?? Insert construction question.

    Well in that case, you can simply provide the columns while inserting as well:

    insert into dbo.T(ColA, ColB) select 'xxx', 'yyy'

    or

    insert into dbo.T(ColB, ColA) select 'xxx', 'yyy'

    depending on whether...

  • RE: Have I been smoking something?? Insert construction question.

    "=" is causing an issue.

    You can use either of there:

    declare @ValueA varchar(10)

    set @ValueA = 'aaa'

    insert into dbo.T select @ValueA, 'yyy'

    GO

    insert into dbo.T values ('xxx', 'yyy')

    GO

    insert into dbo.T select 'xxx', 'yyy'

Viewing 15 posts - 376 through 390 (of 728 total)