Forum Replies Created

Viewing 15 posts - 46 through 60 (of 100 total)

  • RE: Locking out a database for development

    I may be over-simplfying the issue- so with that said, why not remove the user's, or role's, access to the specific db itself?  And if you need to turn that ability...

  • RE: Retrieving next to last row in a recordset

    Can you show some of the sp?  That would help.

    That way you can get some help on how to pass the logic: select max(effective_date) where emply_status='A' to it.  I think...

  • RE: GetDate ?

    Forgot about the CONVERT and style paramters...good tip.

  • RE: Using SQL to CONVERT an int with Thousand Seperator!

    My thought process was this:

    Here is your returned number 15,345.00 which is a converted money datatype.  The round won't work because its not a numeric datatype and once you convert...

  • RE: GetDate ?

    Here goes:

    select cast(datepart(month,getdate())as varchar)+'/'+cast(datepart(day,getdate())as varchar)+'/'+cast(datepart(year,getdate())as varchar)

  • RE: Using Recordsets in DTS

    Not sure on your exact details, but I would look into using a cursor if you're trying to work with a selected record set, one line item at a time.

    BOL...

  • RE: GetDate ?

    The getdate() function will display date and time.  For example 1/4/2005 10:40:00.00, so when you run the query with the >= the current day (1/4/05) will be excluded.  You will...

  • RE: Using SQL to CONVERT an int with Thousand Seperator!

    I got an error with the round:  Error converting data type varchar to float.

    I hacked some code together that seems to work:

    SELECT substring(convert(varchar,cast(sum([column]) as money),1),1,charindex('.',convert(varchar,cast(sum([column]) as money),1))-1)

    from

    ..not sure about...

  • RE: SQL Rights - Administration

    There are two ways.

    You can manage by individual user and by role that you construct by db.  For this example I'll do it by user.  Go to the user under...

  • RE: change the onwer of a database

    sp_changeobjectowner [ @objname = ] 'object' , [ @newowner = ] 'owner'

     

    hope this helps.

  • RE: In Enterprise Manager, no servers listed

    You'll need to register the server name.  Open Enterprise Mgr and right click Microsoft SQL Servers.  You'll have the option to register a new group or server registration.  In your...

  • RE: How to "index" on Partitioned-View?

    I got this to work by building the index on the 1st select pass and commenting out the 2nd (and other union all passes).  I then uncommented out the Sql...

  • RE: Help with getting ''''DOMAIN\username''''

    use master

    declare @name varchar(50)

    declare @sqlscript varchar(2000)

    declare name_cursor CURSOR FOR (select [name] into #temp from syslogins where name like '[Domain Name]%')

     open name_cursor

     FETCH NEXT FROM name_Cursor into @name

     WHILE @@FETCH_STATUS = 0

     BEGIN

      set @sqlscript='EXEC...

  • RE: columns unequal? (column might be null)

    I would use a where exists (or not exists) statement.

    Select [column] from

    a

    where exists (select * from

    b where a.id=b.id)

  • RE: Restore Database to new SQL Server from backup

    Read up BOL for correct syntax and/or other needed arguments, but you'll need Restore with move.

     

    D. Restore a database and move files

    This example restores a full database and transaction log...

Viewing 15 posts - 46 through 60 (of 100 total)