Forum Replies Created

Viewing 15 posts - 12,541 through 12,555 (of 13,460 total)

  • RE: converting to State Abbrv

    Note that I'm assuming you have a table named States which has the abbreviation and the long description of the state:

    SELECT FirstName, LastName, City, region, country, ModuleTitle,[FileName]

    FROM 

    (SELECT MAX(CASE WHEN ppd.propertyName = 'FirstName' THEN up.propertyValue END) AS FirstName, 

    MAX(CASE WHEN ppd.propertyName = 'LastName' THEN up.propertyValue END) AS LastName, 

    MAX(CASE WHEN ppd.propertyName = 'City'     THEN up.propertyValue END) AS City, 

    MAX(CASE WHEN ppd.propertyName = 'region'   THEN St.StateAbbrev END) AS region, 

    MAX(CASE WHEN ppd.propertyName = 'Country'  THEN up.propertyValue END) AS country, 

    up.UserID, l.clickdate, t.UrlType,m.ModuleTitle, f.FileName,u.Email

    FROM        ProfilePropertyDefinition AS ppd 

    INNER JOIN       UserProfile AS up ON up.PropertyDefinitionID = ppd.PropertyDefinitionID 

    INNER JOIN       UrlLog l          ON up.UserID = l.UserID 

    INNER JOIN       Users u           ON u.UserID = l.UserID 

    RIGHT OUTER JOIN UrlTracking t     ON l.UrlTrackingID = t .UrlTrackingID 

    LEFT OUTER JOIN  Modules m         ON t .ModuleId = m.ModuleID 

    LEFT OUTER JOIN  Files f           ON REPLACE(t .Url, 'FileID=', '') = f.FileId

    LEFT OUTER JOIN  STATES st         ON up.propertyValue = St.StateDescription

    GROUP BY 

      up.UserID, 

      u.Email, 

      l.clickdate, 

      t.UrlType, 

      m.ModuleTitle, f.FileName) d

    WHERE (FirstName IS NOT NULL)  

    AND   (LastName IS NOT NULL) 

    AND   (clickdate BETWEEN '2007 - 07 - 21' AND '2007 - 07 - 28') 

    AND (UrlType = 'F') 

    and [FileName] like '%.zip%

    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! My disk is terribly scratched.

    about 6 months ago, i was able to download SQL7 english from the MSDN universal subscription.....don't know if that helps, but it's there for testing....

    the actual file was named en_SQL7.exe,...

    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: Dynamic equations in sprocs? Using equations stored in a table.

    even better, why not just add a calculated field to the table to calculate this formula, isntead of trying to dynamically use a formula:

    ALTER TABLE WHATEVER ADD PROJECTEDREVENUE AS 2...

    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: dbase Autogrow of file time out

    i guess I could have been more clear...3 gig of disk space whenever I mentioned memory.

    I admit my servers and development machine are much slower than any SAN, but for...

    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: dbase Autogrow of file time out

    the issue is the size of memory disk space the system is trying to grab 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: Tables updated even though there is an error 80040e14

    are you sure they are all wrapped in a transaction?

    if you are simply running 4 statements, ie 4 updates,a nd the 3rd crashed, the first two might already be committed...

    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: Random "Could not find stored procedure" error

    there's a combination of issues; You'll probably remember that if aany object starts with the letters "sp_", the query engine looks in the master database first....if not found, it looks...

    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 column for serial number

    sounds like even though your database is sql2005, the database compatibility is set to 80 and not 90, so you are still limited to SQL2000 based solutions.

     

     

    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: Get domain

    couldn't find that extended proc on my SQL 2000; i believe it might be removed as part of a service pack, because i did find an article describing vulerabilities inolving...

    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: Impact of SQL Server name change

    the impact is very minimal; only if you replace a server does it require recreating logins/jobs/etc.

    typically, you'd right click on my computer>>Properties>>Network Identification and give the computer a new name....

    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 search the database for a certain datatype?

    UPDATE statment? or do you mean ALTER statement? something like this would give you the statements to generate statments that had columns of type float to money, for example:

    --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: Best Practices - Financial Reporting Database

    not sure if any of this applies to you, but here goes.

    For Reporting, because I don't want some report tying up my production database, I use log shipping to a...

    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: Round to Even (aka Banker''''s Rounding) - The final function

    incredible; 32+pages of Sergiy call everyone wrong-minded for even considering a business concept he doesn't understand/ chooses to ignore...because he wants to argue theory vs reality.

    we all know there are...

    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 Standard on multicore processors

    it will use all virtual cores; the db system is limited to 4 physical cores on SQL standard, with no limit to the number of virtual cores.

    the 4 CPU limit...

    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: DB Name Aliasing

    I might be missing something, but why not do it in a single set based operation?

    INSERT INTO tAppUser(x,y,z)

    SELECT x,y,z

    FROM [Mercury Cvt Temp].dbo.tApplicationUser AS tAppUser

    WHERE ....

     

    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 - 12,541 through 12,555 (of 13,460 total)