Professional Web Applications Themes

parameterized sql scripts - Microsoft SQL / MS SQL Server

During the installation of our project we want that the end-users to be able to rename the database. We generated the sql scripts for the default database schema. But for renaming the database object we want to use parameter values instead of the hardcoded database name in the scripts. Is it somehow possible using isql or bcp? Or is there any other solutions that you might suggest except using sql scripts? Thanks for replies... Can...

  1. #1

    Default parameterized sql scripts

    During the installation of our project we want that the end-users to be able
    to rename the database. We generated the sql scripts for the default
    database schema. But for renaming the database object we want to use
    parameter values instead of the hardcoded database name in the scripts. Is
    it somehow possible using isql or bcp?

    Or is there any other solutions that you might suggest except using sql
    scripts?

    Thanks for replies...

    Can


    Pierre Guest

  2. #2

    Default Re: parameterized sql scripts

    Move your sql scripts to a stored procedure and pass database name as input
    parameter.

    "Pierre" <pp.com> wrote in message
    news:phx.gbl... 
    able 


    Mohanjit Guest

  3. #3

    Default Re: parameterized sql scripts



    Thanks..I tested it..But itsnt save the stored procedure..have an error.
    following

    "incorrect syntax near the keyword 'CREATE' a use database statement is not
    allowed in a procedure or trigger"

    Why?

    Nurten


    "Mohanjit" <uc.edu>, iletide şunu yazdı
    news:ep%phx.gbl... 
    input 
    > able [/ref]
    Is 
    >
    >[/ref]


    Nurten Guest

  4. #4

    Default Re: parameterized sql scripts

    can u post the body of the stored procedure which u are trying to create?
    "Nurten" <com.tr> wrote in message
    news:%phx.gbl... 
    not 
    > input [/ref][/ref]
    be [/ref][/ref]
    scripts. [/ref][/ref]
    sql 
    > >
    > >[/ref]
    >
    >[/ref]


    Mohanjit Guest

  5. #5

    Default Re: parameterized sql scripts

    creating a database from the "generated sql script"..
    Nurten

    "Mohanjit" <com>, iletide şunu yazdı
    news:%phx.gbl... [/ref]
    error. 
    > not 
    > > input [/ref]
    > be [/ref]
    > scripts. [/ref]
    > sql 
    > >
    > >[/ref]
    >
    >[/ref]


    Nurten Guest

Similar Threads

  1. Parameterized URL in a web service problem
    By Luis in forum ASP.NET Web Services
    Replies: 4
    Last Post: December 1st, 02:56 AM
  2. Suggestion for parameterized queries
    By Sebastien in forum PostgreSQL / PGSQL
    Replies: 2
    Last Post: March 1st, 07:41 AM
  3. Adding parameterized values. Which is more secure.
    By Ryan Taylor in forum ASP.NET Security
    Replies: 1
    Last Post: September 10th, 06:17 PM
  4. Parameterized Views
    By Nice Chap in forum Microsoft SQL / MS SQL Server
    Replies: 4
    Last Post: July 4th, 01:12 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139