Forum Replies Created

Viewing 15 posts - 10,351 through 10,365 (of 13,469 total)

  • RE: Need to pull string out of a filename

    by using the CHARINDEX2 function below, which returns the nth position of a given string, this worked fine for me:

    /*

    Example:

    SELECT dbo.CHARINDEX2('a', 'abbabba', 3)

    returns the location of the third occurrence of...

  • RE: Inserting records for missing values

    good job on giving us the CREATE TABLE; you gave us sample data, but not in an easy-to-use format.

    you'll see below, along with the INSERT INTO statements, we are able...

  • RE: Incorrect syntax near 'S'.

    i'm guessing it's the wrong S?

    @filename='\\VCDB02\j$\Microsoft SQL Server\MSSQL.2\MSSQL\Backup\Step_11_xapi_backup.BAK'

    should that be

    @filename='"\\VCDB02\j$\Microsoft SQL Server\MSSQL.2\MSSQL\Backup\Step_11_xapi_backup.BAK"'

    note the path is wrapped in double quotes to allow file names with spaces?

  • RE: Modifying Script

    as far as i know, if the path to the folder does not exist, the backup would fail.

    if the path exists, the .BAK file would get created or overwritten...

  • RE: ALTER DATABASE statement not allowed within multi-statement transaction.

    don't do this in a trigger.

    do it in a schedule job that occurs every X days, which would determine if the filegroup needs to be created yet or not....and if...

  • RE: Disk space eats up rapidly when I execute a insert statement

    pink.thereisnoif (11/4/2009)


    Hi All,

    We have a database named 'Track' running on a 64 bit Sql Server 2005 enterprise edition.

    Currently the Track DB occupies about 100G space, with 77G data, 16G index,...

  • RE: currently running stored procedure name

    not sure what you mean...inside a TSQL code block, you could use

    print object_name(@@PROCID)

    or do you mean show me all the sql statements that are currently running...

  • RE: Basic trigger help?

    Bru Medishetty (11/3/2009)


    So you mean,when some one updates the Customer Table column RepNum from 65 to 20 again it should update the counts in the Rep table and also like...

  • RE: Basic trigger help?

    i would still strongly recommend using a view instead of triggers: it will never be wrong.

    CREATE VIEW VW_REP

    AS

    SELECT

    Rep.*,MyAlias.CustomerCount

    From Rep

    Left Outer Join (Select Count(CustomerNum)AS CustomerCount, RepNum From Customer Group...

  • RE: Basic trigger help?

    Thanks Bru; i posted my example before the schema got posted, and i edited my examples to use RepNum

  • RE: Basic trigger help?

    two things..first, your trigger model is for ORACLE/PLSQL..SQL Server is slightly different.

    second it just a logical solution...instead of updating a static table because of an INSERT, you could just replace...

  • RE: How to convert some Access SQL into TSQL?

    george.greiner (11/3/2009)


    Yes it does. What is the purpose of having a table with 10000 integers in it?

    a Tally/Numbers table lets you leverage the way SQL server uses Set Based...

  • RE: Need to show HH and "AM" or "PM'

    here's one way to do it, i'm sure you'll get other examples to choose from:

    select CONVERT(varchar,datepart(hour,getdate()) % 12 ) + ' ' + CASE WHEN datepart(hour,getdate()) > =12 THEN 'PM'...

  • RE: SQL Pager alerts

    with att for example, i send a plaintext email my attphone: the address is your 10-digit number@txt.att.net.

    ie email 9545551212@txt.att.net

  • RE: qouestion about Index

    Gail's "it depends" answer is spot on...it depends on how your data gets accessed; indexes help find the data faster.

    ok 10 million records, but which columns are actually used for...

Viewing 15 posts - 10,351 through 10,365 (of 13,469 total)