Forum Replies Created

Viewing 15 posts - 466 through 480 (of 626 total)

  • RE: SQL help please

    When I'm looking for that kind of info I just normally write a query something like this.

    USE AdventureWorks2012

    SELECT

    COLUMN_NAME,

    DATA_TYPE,

    CHARACTER_MAXIMUM_LENGTH,

    IS_NULLABLE,

    NUMERIC_PRECISION,

    NUMERIC_SCALE

    FROM

    INFORMATION_SCHEMA.COLUMNS

    WHERE

    TABLE_NAME = 'Address'...

  • RE: SQL help please

    Ed Wagner (9/14/2015)


    Duplicate post. Direct replies to http://www.sqlservercentral.com/Forums/Topic1719361-2799-1.aspx

    Although similar the other post asks about information regarding Foreign Keys while this thread asks for Columns Data Type and Size. ...

  • RE: High CPU from Distributed Query Cache??

    Sorry folks, just realized that I actually didn't ask a question.

    Any ideas what else I can do to troubleshoot this issue? There seems to be so little documentation around...

  • RE: Escape Double Quote

    I suspect there is a piece of info missing. Are you sure they are actually stored as double quotes.

    For example try this:

    DECLARE @test-2 TABLE(myString VARCHAR(25))

    INSERT INTO @test-2

    VALUES ('TEST FSC'),...

  • RE: Left Join with 2 references

    Click here on how to post examples.[/url]

  • RE: T sql help (database size track)

    If you just want AdventureWorks just simply change your code to...

    Use DBSizeTrack

    INSERT INTO Track (RunDate,Dbname,file_Size_MB)

    SELECT

    GETDATE() as RunDate,

    DB_NAME() AS DbName,

    SUM(size)/128.0 AS File_Size_MB

    FROM AdventureWorks2012.sys.database_files

  • RE: T sql help (database size track)

    That's because you execute it once for every DB but always tell it to use 'AdventureWorks'

    Try this instead

    EXEC sp_MSforeachdb

    'USE [?];

    SELECT

    GETDATE() as RunDate,

    DB_NAME() AS DbName,

    SUM(size)/128.0 AS File_Size_MB

    FROM sys.database_files'

    That...

  • RE: Are the posted questions getting worse?

    Lynn Pettis (9/1/2015)


    GilaMonster (9/1/2015)


    It probably did nothing, since the error was in code and repair can't fix that (short of deallocating pages from the system tables)

    Why don't you just leave...

  • RE: Are the posted questions getting worse?

    GilaMonster (9/1/2015)


    Ed Wagner (9/1/2015)


    ZZartin (9/1/2015)


    Now if only all websites used the same algorithm to determine whether a password is strong enough.....

    That's a neat approach...

  • RE: Are the posted questions getting worse?

    Just submitted my request to attend PASS this year. (First Time)

    Really hope it gets approved. :Whistling:

    However, I just noticed the housing block is all sold out. Maybe, I should...

  • RE: Need some help with compliancy calculation

    Luis Cazares (9/1/2015)


    A bit simpler:

    SELECT

    t5.pgroup,

    CONVERT(NUMERIC(5,2),SUM(CASE WHEN t6.state = 'INSTALLED' THEN 100. END) / COUNT(*)) AS INSTALLED,

    CONVERT(NUMERIC(5,2),SUM(CASE WHEN...

  • RE: Need some help with compliancy calculation

    This worked for me.

    SELECT DISTINCT

    t5.pgroup,

    CONVERT(NUMERIC(5,2),(CAST(COUNT(CASE WHEN t6.state = 'INSTALLED' THEN 1 ELSE NULL END) OVER (PARTITION BY t5.pgroup) AS NUMERIC)/CAST(COUNT(t6.state) OVER (PARTITION BY t5.pgroup) AS NUMERIC))*100) AS INSTALLED,

    CONVERT(NUMERIC(5,2),(CAST(COUNT(CASE WHEN t6.state...

  • RE: Help with a join

    ChrisM@Work (9/1/2015)


    yb751 (9/1/2015)


    You shouldn't have multiple CompanyID's stored this way. You'll want to normalize your data. You can't do joins that way unless the actual ID in tableB...

  • RE: Help with a join

    TSQL Tryer (9/1/2015)


    I've not designed the database or the table. I'm simply trying to get a report out of it

    In that case I suggest breaking out tableA in a temp...

  • RE: Help with a join

    You shouldn't have multiple CompanyID's stored this way. You'll want to normalize your data. You can't do joins that way unless the actual ID in tableB was "1,2,3,4".

Viewing 15 posts - 466 through 480 (of 626 total)