Forum Replies Created

Viewing 15 posts - 8,566 through 8,580 (of 13,460 total)

  • RE: Script to insert all columns' name into a table

    WayneS (10/14/2010)


    Looks like you're making things more difficult than necessary Lowell! ;-):w00t:

    clearly!

    A lot like you, I'm trying to anticipate the requirement and provide a solid example, but obviously...

    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: Script to insert all columns' name into a table

    using my magic hat and mind reading glasses, i read your request two ways differently than mazzz did:

    1. that you really meant "create an empty table with the same column...

    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: Insert into table using function.

    As Criss Morris suggested, using the OUTPUT clause is the best, especially if you want to capture multiple rows.

    here's a prototype/best guess based on the SQLs you posted; this might...

    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: Reporting the content of a memo field when a GROUPING is involved

    you have to convert the field to a datatype that is allowed to be grouped, like a varchar()

    SELECT ID, COUNT(Txt1) AS Txt1, Txt2, CONVERT(varchar(2000),Memo1)

    FROM myTable

    GROUP BY ID, Txt2, CONVERT(varchar(2000),Memo1)

    HAVING (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: sp_send_dbmail @query parameter

    the mail runs from the msdb database, so you have to fully qualify everything, like

    EXEC msdb..sp_send_dbmail

    @profile_name = 'reports',

    ...

    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: Insert into table using function.

    just change your plan to use a stored procedure.

    a function cannot change data. No DML operations allowed, no dynamic SQL and a lot of other restrictions.

    a stored procedure does not...

    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 it possible to retrieve the count of rows in a SqlDataReader object?

    Larry Kruse (10/13/2010)


    Thanks Lowell...I was kind of afraid that was the case. It seems kind of like it would be something that a lot of folks would want 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: Is it possible to retrieve the count of rows in a SqlDataReader object?

    ok a bit of reearch reveals a few things.the .RecordsAffected will pretty much return -1 every single time.

    There is no count because the reader is streaming the results in from...

    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 it possible to retrieve the count of rows in a SqlDataReader object?

    i think the reader has a reader.RecordsAffected property;

    so you should be able to get the # records from reader.RecordsAffected?, right? or is that for a different purpose than i think?

    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 get old/new guid of a row?

    well everything depends on what you want to do;

    there's usually a reason why you want to audit old and new data; typically you create an audit table with nearly 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: Index sizes . . .

    i have this saved, which uses the old sysindexes view;

    i have not updated it to use sys.indexes and whatever sys view has some index details; this might help:

    SELECT object_name(id) as...

    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: Index sizes . . .

    Paul Farnell (10/13/2010)


    Thanks for your reply however I want to see how much physical space in KB each index takes up.

    Paul one of the output columns is [IndexKB] in...

    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 get old/new guid of a row?

    you might be mixing information from a different database system...as far as i know, I SQL Server there is not a GUID associated with the old/new rows;

    you have the rows...

    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: A little Help

    yeah, i switched away from SQL2000 a while ago, and all my scripts are targeted for the newer platform.

    take a look at this script contribution i made for SQL 2000:

    Get...

    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: HTML format in sp_send_dbmail

    a forwarded email is beyond the control of the SQL server and sp_send_mail;

    the client application which forwards the mail may add lines, headers, footers, indent everything in the email and...

    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 - 8,566 through 8,580 (of 13,460 total)