Forum Replies Created

Viewing 15 posts - 10,681 through 10,695 (of 13,461 total)

  • RE: Last Modified

    heres a generic example; if you post your actual table definition, we could tailor the example to your actual table:

    Create Trigger TableName_Update On TableName For Update As

    Update Tb

    ...

  • RE: Results to File Problem with NULL values

    i guess it depends on the program you are using; what happens if you find and replace NULL with a space or empty string in your result file prior to...

  • RE: Primary Key- char 12

    i would definitely do this using the SSMS GUI on a test database;

    since it is a PK,the table will probably be dropped and recreated, and any indexes, foreign keys...

  • RE: Help with Case Statement

    you did not paste your entire query, so you have to extrapolate:

    take your entire query from your stored proc, not just the case statement, and wrap it in parenthsis.

    give it...

  • RE: How to know - who deleted the table?

    the default trace would have any objects that were dropped/created/altered.

    try this query:

    select * from sys.trace_events

    declare @tracefile varchar(256)

    SELECT @tracefile=convert(varchar(256),value)

    from(

    SELECT *

    FROM fn_trace_getinfo(default)) X

    where property=2

    print @tracefile

    SELECT * from fn_trace_gettable(@tracefile, default)

    select

    ...

  • RE: Is there a way to programatically alter a function

    the cursor i posted works, did you try that yet? just remove the oldtable/newtable replace function.

  • RE: quering server properties from linked servers

    here's an example that Jack was referencing:

    exec ServerName.master.dbo.sp_executesql N'Select SERVERPROPERTY(''MachineName'')'

    --or if you are calling a function that exists on the server:

    SELECT * FROM OPENQUERY(LINKEDSERVER1,'SELECT dbo.T_DATE(''D'')')

  • RE: Help with Case Statement

    ironically, it's easy...you just wrap the whole thing to be a sub query:

    SELECT ISNULL(CTTitle1,CTTitle) As TheTitle

    From

    (

    SELECT

    [CTTitle] =(SELECT TOP 1 TITLE FROM mms.dbo.vwcommitteetermmembers WHERE ID =

    ...

  • RE: Display address in vertical format

    the REPLACE function is pretty straight forward;

    here's an example:

    with myAddresses As (

    SELECT '164 N. Daves Street,Madisonville,FL 42431' AS ADDR1 UNION ALL

    SELECT '1333 Weller Ave,Miami,FL 40208' AS ADDR1 UNION ALL

    SELECT...

  • RE: How do I call my function from a simple stored procedure

    and here's how you'd use your function in an update statement:

    UPDATE MyTable

    Set MyColumn = dbo.InitCap(MyColumn)

  • RE: writing t-sq scripts

    Chandu's got you going in the right direction; If you downloaded SQL Express and installed it, you might not have SQL Server Management Studio. You'll want to download SQL Server...

  • RE: how can i run exec with multiline

    your sql statement should not have GO statements, that's all.

    this worked fine for me.

    note that since i'm quoting the whole thing as a multiline statement, i didn't need the @newline...

  • RE: Send mail TO sql server and get result back...

    Lynn's point on security is a good one; I would think it might be possible with CLR, but I'm not sure; there are a lot of objects that you cannot...

  • RE: Best method for sharing a DB ??

    shouldn't that be DBCC SHRINKDATABASE(N'YourDataBaseName' ) instead of shrinkfile? I'm thinking that if you deleted a lot of data, the space is reserved in the MDF, and not in the...

  • RE: Null returned in stored procedure look up

    tough call; i'm guessing that you really need to join the the data you are testing to the same two tables Rate_table

    and Rate_price_table;

    with 6 conditions in the WHERE statement, I'd...

Viewing 15 posts - 10,681 through 10,695 (of 13,461 total)