Forum Replies Created

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

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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'')')

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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 =

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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)

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Best method for sharing a DB ??

    deleting records so there are only 50 left does not shrink the size of the database....the database will keep it's original size, so that it is ready to insert more...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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