Forum Replies Created

Viewing 15 posts - 49,276 through 49,290 (of 49,571 total)

  • RE: Result from 2 tables with no link

    Select TableA.Col1 FROM TableA WHERE TableA.ID = 1;

    Select TableB.ColA FROM Table B WHERE TableB.ID = 2

    Put that as the commandtext for your .net SQLCommand. It will return 2 recordsets.

    That, or write...

  • RE: Question of the Day for 03 Jan 2006

    EXECUTE AS LOGIN = 'TestDomain\TestUser'

     -- run testing code here

    REVERT

    You need impersonate rights on the login that you're impersonating.

    See ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/613b8271-7f7d-4378-b7a2-5a7698551dbd.htm in the SQL 2005 books online

  • RE: Data Value

    A varchar will store spaces if they're part of the string that's put in the variable/field. It just won't pad with spaces to full length like char does.

    Note that LEN...

  • RE: stored procedure question

    And for dynamic sorts...

    CREATE PROCEDURE SortedPerson

     @SortField VARCHAR(30) = 'Surname'

    AS

    SELECT title, first_name, surname

     FROM Person

     ORDER BY CASE @SortField WHEN 'First_Name' THEN first_name

      WHEN 'Title' THEN title

      ELSE Surname

     END

  • RE: stored procedure question

    Here's another way

    create procedure FindPeople

    @Firstname varchar(30) = '',

    @LastName varchar(30) = '',

    @Title varchar(5) = ''

    AS

    Select title, first_name, surname

    from person

    where first_name LIKE ISNULL(@FirstName,'') + '%'

      and last_name LIKE ISNULL(@LastName,'') + '%'

      and title LIKE ISNULL(@Title,'') +...

  • RE: DateTime without hour

    So many ways to skin a cat.

    How about one of my least favorite ways. (Found this in my production system when I...

  • RE: DateTime without hour

    Becaust I want to be explicit about round off vs truncate fractions.

  • RE: DateTime without hour

    Picky, picky. Close enough. The second 2 ints are treated like a fractional value (select getdate()+0.25)

    How is a float stored? (

  • RE: Index hints and top operatror

    If the sort order requested is the same as the clustered sort order, would it now save processing time if the sorting on that column is avoided?

    If you do...

  • RE: DateTime without hour

    Or my personal favorite way

    DECLARE @dt DATETIME

    SET @dt = '2005-12-22 14:22'

    SELECT CAST(FLOOR(CAST(@dt AS FLOAT)) AS DATETIME)

    Takes advantage of the fact that a date is stored like a float, with the time...

  • RE: SQL 2000 Job Wont Stop Running

    Has the number of text files or size thereof increased recently?

    What happens if you invoke the application manually from the OS, not from SQL?

  • RE: Table Design

    There may be a limitation that you can't allow CASCADE update or delete when an identity column is involved.  Look for that.

    There's no problem defining a cascading update/delete if the...

  • RE: Getting problem while using getDate() to insert date in the Bulk insert

    That would be because SQL's trying to insert the string value 'getDate()' into a datetime field. Bulk insert just puts data into a table. It won't check to see if...

  • RE: Table Design

    CityId inthe Title table and TitleId in the city table. Isn't that a circular reference?

    And if those aren't the real tables, please post the real table definitions.

  • RE: Certification, how and when?

    Have a look at the microsoft certification site. There's good info there on the certifications that will be available for SQL 2005 and the exams that comprise them

    http://www.microsoft.com/learning/mcp/default.asp

Viewing 15 posts - 49,276 through 49,290 (of 49,571 total)