Forum Replies Created

Viewing 15 posts - 7,501 through 7,515 (of 13,469 total)

  • RE: bcp error through xp_cmdshell

    huslayer (6/1/2011)


    Hi,

    I'm having the same problem and Ive sybase client installed, so what path variables you're talking about here and how to change it?

    Thanks

    the %PATH% allows you to do things...

  • RE: What is the difference between for and after trigger?

    In SQL Server, they are the same thing...in ORACLE and maybe other DBMS systems an AFTER trigger is different.

    The first ingredient in properly employing triggers is to understand the differences...

  • RE: Data conversions for hours.

    ruff if you only have hours and minutes, how are you going to get a datetime? you need a base/starting point...is that jan 1 of this year, for example?

    you could...

  • RE: random select

    there's a trick that you can get randomly ordered records by using the NEWID() function...is that what you are after?

    select top 10

    ColumnList

    From SomeTable

    order By NEWID()

    and this?

    in both...

  • RE: create variable name???

    something like this?

    --SandBox_2011-05-27_10-51-42.bak

    SELECT db_name()

    +'_'

    + REPLACE(

    ...

  • RE: T-SQL help

    ColdCoffee (5/27/2011)


    Lowell, actually, if u look at the new dataset the OP provided, there are dups.. so, a GROUP BY of managerID with COUNT > 1 wont work on dups.....

  • RE: T-SQL help

    what i posted works...whether there's more than one manager or not.

    change the query to work on YourTable instead of mySampleData... then tell us what you expected that is different fromt...

  • RE: find out database name

    physical file? no...you have to ask the SQL isntance what databases it currently has ...usually via a query, though...for example

    SELECT name from master.dbo.sysdatabases

    why don't you want to connect to discover...

  • RE: T-SQL help

    you can do it with a subselect of something featuring row_number(), or simply with a GROUP BY:

    With MySampleData ([Record#],ManagerID)

    AS

    (

    SELECT 370868,1427894 UNION ALL

    SELECT 274658,1428292 UNION ALL

    SELECT 274658,1428293 UNION ALL

    SELECT 349883,1430095 UNION...

  • RE: How to manage databases without sysadmin role?

    i'm very weak on the reason why i had to do that trustowrthy thing;

    can you turn off trustowrthy, change the proc to WITH EXECUTE AS SELF, and...

  • RE: Read Access to All Databases on server

    Tom Van Harpen (5/26/2011)


    this is the command I was playing around with:

    EXECUTE master.sys.sp_MSforeachdb 'USE [?]; exec sp_addrolemember ''db_datareader'',''Domain\MyNTGroup'' '

    Tom the way i've done it is like this: you'd just have...

  • RE: retrieve views containing reference to a specific column

    hxkresl (5/26/2011)


    Kindly show me the edit that would include stored procedures in the result set:unsure:

    it's right at the end: remove the last AND to see ALL dependancies, ro make it...

  • RE: Read Access to All Databases on server

    not an easy way...

    every Login would need a user in each databaser, and each user would need to be added to a role that gives them read access and...

  • RE: retrieve views containing reference to a specific column

    glad I could help!

    Thansk for the feedback!

  • RE: retrieve views containing reference to a specific column

    here you go...look at the WHERE statement at the end..specific column name, and must be a view...you can change that to fit your needs if needed:

    /*

    obj_nmcol_nmdep_obj_nmdep_obj_typedep_col_nm

    GMAACCPACTTBLKEYVW_GMBENEFViewNULL

    GMAACCPACTTBLKEYVW_CDBGACCOMPViewNULL

    */

    DECLARE @ColumnName VARCHAR(100)

    SET @ColumnName =...

Viewing 15 posts - 7,501 through 7,515 (of 13,469 total)