Forum Replies Created

Viewing 15 posts - 16 through 30 (of 44 total)

  • RE: Get lenght of.....

    if you need the number of characters of your_column, try len(your_column) or max(len(your_column)) if you want to determine the max across the table

  • RE: DataType Issue in SQL 2005!

    Sandy,

    my answer to "Can I store in 2008-02-22 14:55:11.733 format by using datetime datatype" is no, you cannot.

    you would have to store that value as char()... ...

  • RE: DataType Issue in SQL 2005!

    hi

    if you must store the data in that format, use a column type char(23) with default value: convert (char(23), getdate(), 121)

    hope i understood your requirement right and that the solution...

  • RE: Need efficient way of writing this SELECT MAX query

    GilaMonster (2/22/2008)


    Could you add a TOP 1?

    SELECT TOP 1 f.forumid, forumname

    FROM Forums f

    LEFT JOIN Threads t ON f.forum_id=t.forum_id

    LEFT JOIN (SELECT forum_id, MAX(postdate) as last_postdate FROM Threads GROUP...

  • RE: Need efficient way of writing this SELECT MAX query

    hi

    if you do not care which of the two simultaneous posts are displayed you can use this

    SELECT f.forum_id, forumname, threadname,postdate

    FROM #Forum f

    LEFT JOIN #Threads t ON f.forum_id=t.forum_id

    JOIN (

    SELECT...

  • RE: Replication Problem

    you need to setup the sql agent service to run under a domain user account

  • RE: Find Instance in task manager

    run

    select serverproperty('ProcessID')

    on the specific instance

    that returns the "Process ID of the SQL Server service. ProcessID is useful in identifying which Sqlservr.exe belongs to this instance." (quote from BOL)

    use...

  • RE: SQL INSERT TRIGGER only updating first record inserted

    hi

    that is because the trigger, as you wrote it, deals with only one record.

    try rewriting it using joins

    if you do not figure it out, i'll try to help later this...

  • RE: where caluse help please.

    you have to add the simple quotes to the string

    so, the string changes to:

    set @STR = 'SELECT * from Employee WHERE empid=''' + @Empid + ''''

    the quotes are...

  • RE: Pull User / Server Data Info..

    i have typed extra characters in the key, please try again as i have corrected it

    still, please be notified that i have not tested this query 🙂

  • RE: Pull User / Server Data Info..

    try getting the info from the windows registry

    something like:

    EXEC xp_regread 'HKEY_LOCAL_MACHINE',

    'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon',

    ...

  • RE: Pull User / Server Data Info..

    if your sql server is not clustered, for the computer name you can use

    select serverproperty('MachineName')

    otherwise use select serverproperty('ComputerNamePhysicalNetBIOS') - see BOL, serverproperty function for details

  • RE: need help to create students accounts!!!

    i think you should create the database for each student, bind the login to it(i mean, give permission to the database only for the login and set the db as...

  • RE: need help to create students accounts!!!

    you want to change the default database for the login or to set the login as dbo for their database?

    if you can explain a bit please

  • RE: copying data from one DB to another

    hi

    i would have restored a full backup of the production database as the test database

    dragos

Viewing 15 posts - 16 through 30 (of 44 total)