Forum Replies Created

Viewing 15 posts - 11,026 through 11,040 (of 13,460 total)

  • RE: What is the column naming convention when creating columns in a table?

    everyone is different, and you should use what is best for you. but here's some of the rules in out shop:

    1. the primary key of each table is TableName+"ID". (one...

    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: Decipher Code

    select convert(varchar(10),(dateadd(day, -1*day(dateadd(month, 0 ,getdate())),dateadd(month, 0 , getdate()))),101)

    --results:

    05/31/2009

    it is finding the last day of the month prior to today. then of course it's find data in your table that is...

    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: converting date time

    here's how i would do it:

    ignore the end date, and calculate it based on the clinicstartdate.

    i assume that if you take the year() of today, plus the month/day, that is...

    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: bcp error through xp_cmdshell

    master..xp_cmdshell 'bcp ..out -U -P '

    i guess you need to read up on the syntax. If that is your real command, you are not specifying any of 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: Same Query Different Servers Different Results

    dumb question first...are you sure Table1 is identical on ServerA and ServerB? different data would of course produce different results.

    second, there is a sub select with this code:

    select b.Code...

    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: Table transformation Problem

    ok i got it, and a solution too!

    what you want to do is use the PIVOT operator;

    with that, you can PIVOT a single column based on the values of 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: sp_ AppendToFile does not create a file

    ALTER PROCEDURE [dbo].[sp_AppendToFile](@FileName varchar(255), @Text1 varchar(255)) AS

    DECLARE @FS int, @OLEResult int, @FileID int

    EXECUTE @OLEResult = sp_OACreate 'Scripting.FileSystemObject', @FS OUT

    IF @OLEResult 0 PRINT 'Scripting.FileSystemObject'

    if that is your whole proc, it's...

    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_ AppendToFile does not create a file

    david.ainsworth (6/3/2009)


    Hi There

    Thanks for any advice in advance.

    I have a SQL server I wish to replace and it has a legacy Stored Procedure that gathers information from the database 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!

  • RE: SQL 2008 backup to SQL 2000

    you are right.

    compatibility mode has nothing to do with how the native mdf or backups are constructed...it only decides what syntax for TSQL will be permitted to hit the database...that...

    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 Create and Start SQL Server Trace Automatically

    ALZDBA (6/3/2009)


    Attached you'll find a version I use for quick and dirty CPR-trace 😉

    ALZDBA the version you posted has all the CrLf stripped out, making it difficult to test, since...

    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: Table transformation Problem

    you didn't explain what the issue is.

    is it you need to populate a table with each hour? you said "update" the table, not populate, so i'm not sure where 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: Invalid column name help

    excellent point Jan,

    it seems to me that if the "global" table is missing a column , it's gotta be because a different process created a table with the same...

    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: Carriage returns not working in the comment section of an E-Mail subscription in report manager

    if you are sending the email as HTML, then that is the expected behavior...HTML does not respect extra whitespace ,tabs, or CrLf; it only recognizes it's markup tags.

    if you do...

    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: Query to get the minimum id

    ahh you are right Greg, i did not notice that. Thanks for the better solution.

    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: Triggers Basic

    the trigger fires one for any statement which affects the table; as a result, any statement you write inside that trigger must plan on updating/inserting multiple rows. it CANNOT assume...

    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 - 11,026 through 11,040 (of 13,460 total)