Forum Replies Created

Viewing 15 posts - 421 through 435 (of 3,221 total)

  • RE: calculating quarter

    If you want to create a table defining your quarters you could use:

    CREATE TABLE #Quarters(QuarterStart DATETIME,QuarterEnd DATETIME,[Quarter] INT)

    DECLARE @d DATETIME

    DECLARE @Q INT,@C INT

    SET @Q = 1

    SET @C = 1

    SET @d...

  • RE: SELECT - with ORDER BY - but field not in SELECT list

    In simple words yes it is. As an example:

    SELECT [Id],[Col1], [Col2]

    FROM [dbo].[QOD60] ORDER BY [Col2]

    Results:

    Id Col1 ...

  • RE: calculating quarter

    Is this what you require? Post edited 4:13 PM

    DECLARE @d DATETIME

    DECLARE @Q INT

    SET @Q = 1

    SET @d = '04/01/2012'

    SELECT @d as 'Quarter Start',@Q as 'Quarter',DATEADD(dd,-1,DATEADD(mm,3,@D))AS 'Quarter end date'

    SET @Q =...

  • RE: Find all tables without a Primary Key

    This is code by Jason Strate

    http://sqlserverpedia.com/wiki/Find_Tables_Without_Primary_Keys

    It should give you the result(s) you are seeking.

    SELECT SCHEMA_NAME(o.schema_id) AS [schema]

    ,object_name(i.object_id ) AS

    ,p.rows

    ,user_seeks

    ,user_scans

    ,user_lookups

    ,user_updates

    ,last_user_seek

    ,last_user_scan

    ,last_user_lookup

    FROM sys.indexes i

    INNER JOIN sys.objects o ON i.object_id = o.object_id

    INNER...

  • RE: looping through dates in a table

    Not the OP, but got this far and had to attend to other more important items, and I want to help the OP so posted what I had done, with...

  • RE: INTERSECT 1

    Hugo Kornelis (6/12/2012)


    Thanks for the question, Ron. And thanks Koen for the extra link.

    In case someone is wondering why the different data types have no effect - Ron included the...

  • RE: DOES IT EXIST???

    May I suggest that you post the T-SQL statement that you think you might be using and then some one will be able to assist you further.

    To post a...

  • RE: Read-Only Access to a DB

    Have you considered assigning that user to the datareader role

    db_datareader fixed database role can run a SELECT statement against any table or view in the database.

    Check out this link...

  • RE: DOES IT EXIST???

    Check the IF EXISTS statement using Books On Line or GOOGLE, this may be what you are loooking for.

  • RE: XQuery string functions

    Would have thought that the supporting documentation would have been

    http://msdn.microsoft.com/en-us/library/ms189254

    Above is, in my humble opinion a much stronger support for the correct answer.

  • RE: SQL 2012 BOL

    Koen Verbeeck (6/4/2012)


    Nice one, thanks.

    Easy to answer actually, as the first answer never could be the correct one (2 and 3 contradict each other), so you only had to figure...

  • RE: How to decrease Log file size?

    What recovery model are you using ... Simple or Full ..?

    How often are you backing up the database?

  • RE: SSIS 2012 - Versioning

    Ah spoon feeding us on the basics ... I like that approach.

  • RE: SQL Server Logs

    Koen Verbeeck (6/1/2012)


    Lucky guess for me 🙂

    +1

  • RE: Resource Database

    EL Jerry (5/31/2012)


    bitbucket-25253 (5/31/2012)


    Cliff Jones (5/31/2012)


    EL Jerry (5/31/2012)


    Thank you for the question, Ron.

    I also got the right answers by elimination of the first 2 false statements.

    "El" Jerry.

    +1 but like Tom...

Viewing 15 posts - 421 through 435 (of 3,221 total)