Forum Replies Created

Viewing 15 posts - 11,506 through 11,520 (of 13,460 total)

  • RE: Execution results of stored procedure

    i missed that multple result part:

    to insert from a EXEC(storedproc), you have to know the columns that will be returned by the stored procedure...there's no wayt around that, so if...

    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: CASE Statement

    it's just a copy/paste error

    change

    Group by Select Case

    to

    Group by Case

    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: Execution results of stored procedure

    two ways, but you HAVE to know which column in my_table determines the order for the ORDER BY:

    I'm just assuming there is a TABLEID

    SELECT * FROM (

    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: Read only?

    maybe the table was imported under a different schema/user, so you only have read rights to that schema?

    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: CASE Statement

    just use the other CASE syntax:

    select case

    when a.staff = 6 then 'EM'

    ...

    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: Create username and password for database dynamically

    sure it's fairly easy; adding a user has three things you need to do:

    1. Add a login.

    2. Add a user to that login

    3.decide what rights they get.

    Here is a script...

    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 Help

    you'll want to use the Row_Number() function featuring the Partition parameters:

    CREATE TABLE Proj

    (ProjId INT

    ,ProjDt...

    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 eliminate the many to many related data

    yep i think you got it;

    do you also need to find users with zero roles, or roles with zero users?

    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 eliminate the many to many related data

    i think it should be fairly simple, right? didn't test it, but this is my first guess:

    SELECT

    UserRole.UserID,

    UserRole.RoleID

    FROM UserRole

    LEFT OUTER JOIN (SELECT UserId, COUNT(RoleID) 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: entities

    clearly you've copied and pasted your homework straight from the book.

    we don't do homework, but if you show us what you've done so far, we can offer suggestions.

    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: Any way to hide column names from result set?

    e wants to hide the column names in his presentation layer; he's going to get column names regardless, right?

    also i think his columns are char and not varchar, so he...

    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: Formatting money for a report...

    ok, you'd have to tweak this to become a function i guess, but this seems to work.

    you'll have to have a Numbers or Tally table to use this, but 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: Converting text to varchar

    glad we could help.

    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 text to varchar

    well, if it's displayed as html, CRLF do not show up!

    html does not respect whitespace... you need {BR} markups to do that!

    (replace curly braces with LT/GT..forum doesn't like real HTML...

    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 text to varchar

    the carriage returns are still there...are you looking at the data in SSMS in grid mode? grid mode hides CrLf.

    in SSMS, hit Control T, then re-run your query.

    your data should...

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