Monday, March 26, 2012
Named Instance naming rules
InstallShield setup. One of the requirements is that the user can choose to
install a named instance and can choose the name of the named instance.
Here's what I found on SQL BOL:
"A new instance name must begin with a letter, an ampersand (&), or an
underscore (_), and can contain numbers, letters, or other characters. SQL
Server sysnames and reserved names should not be used as instance names. For
example, the term "default" should not be used as an instance name because
it is a reserved name used by Setup."
That's a little vague for trying to write an installer. Does anyone know the
specific rules for a naming a named instance? For example - how long can the
name be? can there be spaces in the name? what exactly are "other
characters" - anything?Refer "Instance Name" under "instance names" in BOL
--
Thanks
Ravi
"Andy Gaskell" wrote:
> Hi, I'm trying to wrap the MSDE command line installer with an
> InstallShield setup. One of the requirements is that the user can choose to
> install a named instance and can choose the name of the named instance.
> Here's what I found on SQL BOL:
> "A new instance name must begin with a letter, an ampersand (&), or an
> underscore (_), and can contain numbers, letters, or other characters. SQL
> Server sysnames and reserved names should not be used as instance names. For
> example, the term "default" should not be used as an instance name because
> it is a reserved name used by Setup."
> That's a little vague for trying to write an installer. Does anyone know the
> specific rules for a naming a named instance? For example - how long can the
> name be? can there be spaces in the name? what exactly are "other
> characters" - anything?
>
>|||Thanks Ravi.
"Ravi" <Ravi@.discussions.microsoft.com> wrote in message
news:AAC8D56C-739C-4C63-8EC2-AABF3937382F@.microsoft.com...
> Refer "Instance Name" under "instance names" in BOL
> --
> Thanks
> Ravi
>
> "Andy Gaskell" wrote:
>> Hi, I'm trying to wrap the MSDE command line installer with an
>> InstallShield setup. One of the requirements is that the user can choose
>> to
>> install a named instance and can choose the name of the named instance.
>> Here's what I found on SQL BOL:
>> "A new instance name must begin with a letter, an ampersand (&), or an
>> underscore (_), and can contain numbers, letters, or other characters.
>> SQL
>> Server sysnames and reserved names should not be used as instance names.
>> For
>> example, the term "default" should not be used as an instance name
>> because
>> it is a reserved name used by Setup."
>> That's a little vague for trying to write an installer. Does anyone know
>> the
>> specific rules for a naming a named instance? For example - how long can
>> the
>> name be? can there be spaces in the name? what exactly are "other
>> characters" - anything?
>>
Named Instance naming rules
InstallShield setup. One of the requirements is that the user can choose to
install a named instance and can choose the name of the named instance.
Here's what I found on SQL BOL:
"A new instance name must begin with a letter, an ampersand (&), or an
underscore (_), and can contain numbers, letters, or other characters. SQL
Server sysnames and reserved names should not be used as instance names. For
example, the term "default" should not be used as an instance name because
it is a reserved name used by Setup."
That's a little vague for trying to write an installer. Does anyone know the
specific rules for a naming a named instance? For example - how long can the
name be? can there be spaces in the name? what exactly are "other
characters" - anything?Refer "Instance Name" under "instance names" in BOL
--
Thanks
Ravi
"Andy Gaskell" wrote:
> Hi, I'm trying to wrap the MSDE command line installer with an
> InstallShield setup. One of the requirements is that the user can choose t
o
> install a named instance and can choose the name of the named instance.
> Here's what I found on SQL BOL:
> "A new instance name must begin with a letter, an ampersand (&), or an
> underscore (_), and can contain numbers, letters, or other characters. SQL
> Server sysnames and reserved names should not be used as instance names. F
or
> example, the term "default" should not be used as an instance name because
> it is a reserved name used by Setup."
> That's a little vague for trying to write an installer. Does anyone know t
he
> specific rules for a naming a named instance? For example - how long can t
he
> name be? can there be spaces in the name? what exactly are "other
> characters" - anything?
>
>|||Thanks Ravi.
"Ravi" <Ravi@.discussions.microsoft.com> wrote in message
news:AAC8D56C-739C-4C63-8EC2-AABF3937382F@.microsoft.com...[vbcol=seagreen]
> Refer "Instance Name" under "instance names" in BOL
> --
> Thanks
> Ravi
>
> "Andy Gaskell" wrote:
>sql
Named Instance naming rules
InstallShield setup. One of the requirements is that the user can choose to
install a named instance and can choose the name of the named instance.
Here's what I found on SQL BOL:
"A new instance name must begin with a letter, an ampersand (&), or an
underscore (_), and can contain numbers, letters, or other characters. SQL
Server sysnames and reserved names should not be used as instance names. For
example, the term "default" should not be used as an instance name because
it is a reserved name used by Setup."
That's a little vague for trying to write an installer. Does anyone know the
specific rules for a naming a named instance? For example - how long can the
name be? can there be spaces in the name? what exactly are "other
characters" - anything?
Refer "Instance Name" under "instance names" in BOL
Thanks
Ravi
"Andy Gaskell" wrote:
> Hi, I'm trying to wrap the MSDE command line installer with an
> InstallShield setup. One of the requirements is that the user can choose to
> install a named instance and can choose the name of the named instance.
> Here's what I found on SQL BOL:
> "A new instance name must begin with a letter, an ampersand (&), or an
> underscore (_), and can contain numbers, letters, or other characters. SQL
> Server sysnames and reserved names should not be used as instance names. For
> example, the term "default" should not be used as an instance name because
> it is a reserved name used by Setup."
> That's a little vague for trying to write an installer. Does anyone know the
> specific rules for a naming a named instance? For example - how long can the
> name be? can there be spaces in the name? what exactly are "other
> characters" - anything?
>
>
|||Thanks Ravi.
"Ravi" <Ravi@.discussions.microsoft.com> wrote in message
news:AAC8D56C-739C-4C63-8EC2-AABF3937382F@.microsoft.com...[vbcol=seagreen]
> Refer "Instance Name" under "instance names" in BOL
> --
> Thanks
> Ravi
>
> "Andy Gaskell" wrote:
Friday, March 23, 2012
name of the command to get table structure
2000 (the corresponding command within oracle is describe)sp_help tablename
may help
--
HTH
Ryan Waight, MCDBA, MCSE
"uwe" <uwe.woedl@.linde.de> wrote in message
news:2a70401c39259$8d5ca6f0$a601280a@.phx.gbl...
> how do i get the table structure within the sql server
> 2000 (the corresponding command within oracle is describe)|||Hello Ryan,
sorry but this is not what I want. I do get only the
number of tables within the database. I want the structure
of a table including the attributes, their formats, the
primary key and foreign keys.
>--Original Message--
>sp_help tablename
>may help
>--
>HTH
>Ryan Waight, MCDBA, MCSE
>"uwe" <uwe.woedl@.linde.de> wrote in message
>news:2a70401c39259$8d5ca6f0$a601280a@.phx.gbl...
>> how do i get the table structure within the sql server
>> 2000 (the corresponding command within oracle is
describe)
>
>.
>|||If you specify a table name as the first argument to sp_help, that is
exactly what you get. Have a look at the syntax and comments in BOL.
"uw" <uwe.woedl@.linde.de> wrote in message
news:00aa01c39262$bf1328a0$a101280a@.phx.gbl...
> Hello Ryan,
> sorry but this is not what I want. I do get only the
> number of tables within the database. I want the structure
> of a table including the attributes, their formats, the
> primary key and foreign keys.
>
> >--Original Message--
> >sp_help tablename
> >
> >may help
> >
> >--
> >HTH
> >Ryan Waight, MCDBA, MCSE
> >
> >"uwe" <uwe.woedl@.linde.de> wrote in message
> >news:2a70401c39259$8d5ca6f0$a601280a@.phx.gbl...
> >> how do i get the table structure within the sql server
> >> 2000 (the corresponding command within oracle is
> describe)
> >
> >
> >.
> >
Wednesday, March 21, 2012
Name Count
I have an sql command for when you add a new name to the database it counts to see how many of the name entered to the textbox exist in the database. If the count is 0 then it will add the name to the table. Else it displays an error message.
This works fine for inserting a new name but on my update page where you may update the name I have the same code which on button click counts to see how many exist. But if you leave the textbox the same value and click the button the count obviously results in 1 and brings up an error message.
Is there a way I can do a count but not including the name that is currently the value of the textbox?
protected void UpdateSharedArea(object sender, EventArgs e) { SqlConnection connection =new SqlConnection(docShare_ConString);//Count the amount of area names that are the same as typed by user SqlCommand existCheck =new SqlCommand("SELECT COUNT(doc_area_name) FROM document_area WHERE doc_area_name = @.doc_area_name", connection); SqlParameter areaname =new SqlParameter("@.doc_area_name", SqlDbType.VarChar); areaname.Value = AreaText.Text; existCheck.Parameters.Add(areaname); connection.Open();int count = (int)existCheck.ExecuteScalar(); connection.Close();//If the area name does not exist within the tableif (count == 0) {//Update name Cheers, MarkYou will need to to filter your count by the ID of the record you are updating. So when you load the name to display in your textbox, also load the ID of the record and keep it somewhere (Session state or viewstate for example). Then when you do your count, filter on the ID, e.g.
SELECT COUNT(*) FROM NameList WHERE Name = @.Name AND ID != @.Id
Brilliant, thanks very much for the reply.
Mark
Monday, February 20, 2012
my new function not found
CREATE FUNCTION encrypt_pair (@.data VARCHAR(14) , @.key char(30) )
RETURNS VARCHAR (60) AS
BEGIN
DECLARE @.encryptedvars VARCHAR(60)
EXEC master..xp_aes_encrypt @.data,@.key,@.encryptedvars OUTPUT
RETURN @.encryptedvars
END
If I run it again, I get an error that it already exists (duh).
Next I run:
select student_id, student_ssn,
encrypt_pair(student_ssn,'000000000000000000000000 00000000') from
student_ssn
and I get the error:
Server: Msg 195, Level 15, State 10, Line 1
'encrypt_pair' is not a recognized function name.
I don't get whats wrong!
Thanks
RobObject Owner...Object Owner
CREATE FUNCTION dbo.encrypt_pair (@.data VARCHAR(14) , @.key char(30) )
RETURNS VARCHAR (60) AS
BEGIN
DECLARE @.encryptedvars VARCHAR(60)
EXEC master..xp_aes_encrypt @.data,@.key,@.encryptedvars OUTPUT
RETURN @.encryptedvars
END
select student_id, student_ssn,
dbo.encrypt_pair(student_ssn,'00000000000000000000 000000000000') from
student_ssn
--
----------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"rcamarda" <rcamarda@.cablespeed.com> wrote in message
news:1128344611.711934.195110@.g43g2000cwa.googlegr oups.com...
>I issue this command in QA:
> CREATE FUNCTION encrypt_pair (@.data VARCHAR(14) , @.key char(30) )
> RETURNS VARCHAR (60) AS
> BEGIN
> DECLARE @.encryptedvars VARCHAR(60)
> EXEC master..xp_aes_encrypt @.data,@.key,@.encryptedvars OUTPUT
> RETURN @.encryptedvars
> END
> If I run it again, I get an error that it already exists (duh).
> Next I run:
> select student_id, student_ssn,
> encrypt_pair(student_ssn,'000000000000000000000000 00000000') from
> student_ssn
> and I get the error:
> Server: Msg 195, Level 15, State 10, Line 1
> 'encrypt_pair' is not a recognized function name.
> I don't get whats wrong!
> Thanks
> Rob|||Thanks Mike, that thought never crossed my mind!