SQL Server Query - Stored Procedure Maybe?

Results 1 to 2 of 2

Thread: SQL Server Query - Stored Procedure Maybe?

  1. #1
    Join Date
    Dec 1969
    Posts
    109

    Default SQL Server Query - Stored Procedure Maybe?

    Hello,<BR><BR> I have a specification on my desk that requires me to have<BR>1 column that has a constant number in it. I can not modify<BR>the tables in the current database...<BR> What are my options? I have never had to write a stored procedure, but it seems I may need to...<BR><BR>select &#039;123&#039; As MyImaginaryField, realfield, realfield2, etc from<BR> some table<BR>where someid = 99<BR><BR>I think I am allowed to make a temporary table...<BR><BR>something like that would be cool...I haven&#039;t slept much, so<BR>forgive me if I have over looked something simple.<BR><BR>Any ideas?<BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969
    Posts
    96,118

    Default Doesn't even have to be SP

    Nothing wrong with that query, as you gave it.<BR><BR>But maybe a VIEW is what you are looking for???<BR><BR>If you had:<BR><BR>select &#039;123&#039; As MyImaginaryField, sometable.*<BR>from sometable<BR><BR>And made that a VIEW, then you could perform all the same operations on that VIEW that you could on sometable and still get the constant field.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •