Tuesday, March 27, 2012
Change Image
simple sort the data by company name|||I'm using Crystal Report 7 ,use storc prcdure n vb 6. my prblem : let say in my system have company and their staff. how can i display one company and their staffname+ their picture. e.g: company A and their staff photo will appear n for cmpny B their staff photo will appear. means that the staff photo will appear based on their company.tnkiu..
Just sort the data by company name|||what do you mean by sort data by company name?
Sunday, March 25, 2012
Change Edition of existing isntance?
I have a named instance of SQL Server 2005 Developer Edition. I want to install VS Team System Foundation Server on the same box, but this needs a default instance of Standard or Enterprise edition. I installed the Standard version alongside the existing Developer instance but now I can't start SSIS and without it VSTS Foundation Server won't install.
I have tried to uninstall SSIS and reisntall it from both the Standard Edition and Developer edition media, but it makes no difference, the service still won't start.
Could the SSIS failure be due to having different editions on the same box? If so, is it possible to change the edition of the Developer instance to Standard (or to change them both to Enterprise edition) without having to uninstall and start all over again. The developer instance is used by several team members, so I don't want to have to uninstall it if I can help.
Any ideas anyone?
No. I should not be something like that as different SQL Server 2005 SKUs(Editions) can be installed side by side successfully provided that they have unique instance names. What kind of processor architecture of your machine? If you install 32-bit and 64-bit SQL Server 2005 on an x64 machines side by side, which is also supported, then it is possible that only one version of SSIS works at one time.|||Both isntances are 32-bit. Only differnece is that named instance is Developer Edition and default instance is Standard Edition|||
Having two different editions (Developer and Standard) on the same box should not cause SSIS to be unable to start. Do the event logs have any messages? When you installed the second instance, did you change any of the logon service accounts?
Thanks,
Sam Lester (MSFT)
Here is a lengthy thread on SSIS not starting. Can you read through it and see if it applies to your situation?
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=375216&SiteID=1
Thanks,
Sam
Change Edition of existing isntance?
I have a named instance of SQL Server 2005 Developer Edition. I want to install VS Team System Foundation Server on the same box, but this needs a default instance of Standard or Enterprise edition. I installed the Standard version alongside the existing Developer instance but now I can't start SSIS and without it VSTS Foundation Server won't install.
I have tried to uninstall SSIS and reisntall it from both the Standard Edition and Developer edition media, but it makes no difference, the service still won't start.
Could the SSIS failure be due to having different editions on the same box? If so, is it possible to change the edition of the Developer instance to Standard (or to change them both to Enterprise edition) without having to uninstall and start all over again. The developer instance is used by several team members, so I don't want to have to uninstall it if I can help.
Any ideas anyone?
No. I should not be something like that as different SQL Server 2005 SKUs(Editions) can be installed side by side successfully provided that they have unique instance names. What kind of processor architecture of your machine? If you install 32-bit and 64-bit SQL Server 2005 on an x64 machines side by side, which is also supported, then it is possible that only one version of SSIS works at one time.|||Both isntances are 32-bit. Only differnece is that named instance is Developer Edition and default instance is Standard Edition|||Having two different editions (Developer and Standard) on the same box should not cause SSIS to be unable to start. Do the event logs have any messages? When you installed the second instance, did you change any of the logon service accounts?
Thanks,
Sam Lester (MSFT)
Here is a lengthy thread on SSIS not starting. Can you read through it and see if it applies to your situation?
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=375216&SiteID=1
Thanks,
Sam
Thursday, March 22, 2012
Change default value
How can i change default value in sql server through SQL script if i haven't
given default constraint name and using system default generated constraintg
name ?
I have 50 tables to change the default value of a particular field...pls
advice what to do...i don't want to open every table in design mode and
change the default value...pls suggest some script to do it.
With regards,
Gurmeet SinghThis scenario is exactly why you should name your constraint in the first
place...
If you want to automate this, you can use the system tables to get the
constraint name and use that name in your ALTER TABLE ... DROP CONSTRAINT
... statements. Note that SQL Server doesn't accept a variable for table or
constraint name, so you have do use dynamic SQL.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Gurmeet" <gurmeetsm@.hotmail.com> wrote in message
news:uBmwsJ1BEHA.624@.TK2MSFTNGP10.phx.gbl...
> Hi,
> How can i change default value in sql server through SQL script if i
haven't
> given default constraint name and using system default generated
constraintg
> name ?
> I have 50 tables to change the default value of a particular field...pls
> advice what to do...i don't want to open every table in design mode and
> change the default value...pls suggest some script to do it.
> With regards,
> Gurmeet Singh
>|||Hi,
Refer books online for the below commands,
Alter table drop constraint <Const_name>
Alter table add constraint
Thanks
Hari
MCDBA
"Gurmeet" <gurmeetsm@.hotmail.com> wrote in message
news:uBmwsJ1BEHA.624@.TK2MSFTNGP10.phx.gbl...
> Hi,
> How can i change default value in sql server through SQL script if i
haven't
> given default constraint name and using system default generated
constraintg
> name ?
> I have 50 tables to change the default value of a particular field...pls
> advice what to do...i don't want to open every table in design mode and
> change the default value...pls suggest some script to do it.
> With regards,
> Gurmeet Singh
>|||You can remove the default from a column using the following script:
-- remove the default
DECLARE @.constraint_name SYSNAME
WHILE 1=1
BEGIN
SET @.constraint_name = (SELECT TOP 1 c_obj.name
FROM sysobjects t_obj
INNER JOIN sysobjects c_obj
ON t_obj.id = c_obj.parent_obj
INNER JOIN syscolumns cols
ON cols.colid = c_obj.info
AND cols.id = c_obj.parent_obj
WHERE t_obj.name = '<table name>'
AND c_obj.xtype = 'D'
AND cols.[name] = '<column name>')
IF @.constraint_name IS NULL BREAK
EXEC ('ALTER TABLE <table name> DROP CONSTRAINT ' + @.constraint_name)
END
You can adjust this to use multiple tables and to add the new constraint as
well.
Jacco Schalkwijk
SQL Server MVP
"Gurmeet" <gurmeetsm@.hotmail.com> wrote in message
news:uBmwsJ1BEHA.624@.TK2MSFTNGP10.phx.gbl...
> Hi,
> How can i change default value in sql server through SQL script if i
haven't
> given default constraint name and using system default generated
constraintg
> name ?
> I have 50 tables to change the default value of a particular field...pls
> advice what to do...i don't want to open every table in design mode and
> change the default value...pls suggest some script to do it.
> With regards,
> Gurmeet Singh
>
Change Default database Confirm password required
database and then reattach I lose all my default database settings for my SQL
login/users. when I go to change the default database and select OK it
requires me to confirm the password.
How to I get around this so I do not have to always retype the password.
Jacci
Why not to use BACKUP/RESTORE ?
"Jacci" <Jacci@.discussions.microsoft.com> wrote in message
news:84BD75D1-B541-4F33-BA63-FFACE2006D63@.microsoft.com...
> I have recently added SP3a to my SQL 2000 system and every time I detach a
> database and then reattach I lose all my default database settings for my
SQL
> login/users. when I go to change the default database and select OK it
> requires me to confirm the password.
> How to I get around this so I do not have to always retype the password.
|||There are three version of the MS03-031 "Slammer Worm" virus hot fix. The
first messed up the DTSGUI.dll, the second, to fix this, messed up the login
password issue you are discribing. The latest is 8.00.819, you are probably
running build 818. Severice Pack 3a is build 760.
However, as far as the default databases goes, you can not fix this issue
since logins are assigned default databases by DBID. Once that database is
attached, there is no corresponding DBID to default to. Moreover, those ids,
although incremental, are reused. So, if you were to bring another database
online before you reattached the original, the logins may be assigned to the
new database instead.
Here is the KB for the password issue:
http://support.microsoft.com/default...b;en-us;826161
http://support.microsoft.com/default...b;en-us;821277
Sincerely,
Anthony Thomas
"Jacci" wrote:
> I have recently added SP3a to my SQL 2000 system and every time I detach a
> database and then reattach I lose all my default database settings for my SQL
> login/users. when I go to change the default database and select OK it
> requires me to confirm the password.
> How to I get around this so I do not have to always retype the password.
|||Thank You - this worked ;-)
"AnthonyThomas" wrote:
[vbcol=seagreen]
> There are three version of the MS03-031 "Slammer Worm" virus hot fix. The
> first messed up the DTSGUI.dll, the second, to fix this, messed up the login
> password issue you are discribing. The latest is 8.00.819, you are probably
> running build 818. Severice Pack 3a is build 760.
> However, as far as the default databases goes, you can not fix this issue
> since logins are assigned default databases by DBID. Once that database is
> attached, there is no corresponding DBID to default to. Moreover, those ids,
> although incremental, are reused. So, if you were to bring another database
> online before you reattached the original, the logins may be assigned to the
> new database instead.
> Here is the KB for the password issue:
> http://support.microsoft.com/default...b;en-us;826161
> http://support.microsoft.com/default...b;en-us;821277
> Sincerely,
>
> Anthony Thomas
>
> "Jacci" wrote:
sql
Change Default database Confirm password required
database and then reattach I lose all my default database settings for my SQL
login/users. when I go to change the default database and select OK it
requires me to confirm the password.
How to I get around this so I do not have to always retype the password.Jacci
Why not to use BACKUP/RESTORE ?
"Jacci" <Jacci@.discussions.microsoft.com> wrote in message
news:84BD75D1-B541-4F33-BA63-FFACE2006D63@.microsoft.com...
> I have recently added SP3a to my SQL 2000 system and every time I detach a
> database and then reattach I lose all my default database settings for my
SQL
> login/users. when I go to change the default database and select OK it
> requires me to confirm the password.
> How to I get around this so I do not have to always retype the password.|||There are three version of the MS03-031 "Slammer Worm" virus hot fix. The
first messed up the DTSGUI.dll, the second, to fix this, messed up the login
password issue you are discribing. The latest is 8.00.819, you are probably
running build 818. Severice Pack 3a is build 760.
However, as far as the default databases goes, you can not fix this issue
since logins are assigned default databases by DBID. Once that database is
attached, there is no corresponding DBID to default to. Moreover, those ids,
although incremental, are reused. So, if you were to bring another database
online before you reattached the original, the logins may be assigned to the
new database instead.
Here is the KB for the password issue:
http://support.microsoft.com/default.aspx?scid=kb;en-us;826161
http://support.microsoft.com/default.aspx?scid=kb;en-us;821277
Sincerely,
Anthony Thomas
"Jacci" wrote:
> I have recently added SP3a to my SQL 2000 system and every time I detach a
> database and then reattach I lose all my default database settings for my SQL
> login/users. when I go to change the default database and select OK it
> requires me to confirm the password.
> How to I get around this so I do not have to always retype the password.|||Thank You - this worked ;-)
"AnthonyThomas" wrote:
> There are three version of the MS03-031 "Slammer Worm" virus hot fix. The
> first messed up the DTSGUI.dll, the second, to fix this, messed up the login
> password issue you are discribing. The latest is 8.00.819, you are probably
> running build 818. Severice Pack 3a is build 760.
> However, as far as the default databases goes, you can not fix this issue
> since logins are assigned default databases by DBID. Once that database is
> attached, there is no corresponding DBID to default to. Moreover, those ids,
> although incremental, are reused. So, if you were to bring another database
> online before you reattached the original, the logins may be assigned to the
> new database instead.
> Here is the KB for the password issue:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;826161
> http://support.microsoft.com/default.aspx?scid=kb;en-us;821277
> Sincerely,
>
> Anthony Thomas
>
> "Jacci" wrote:
> > I have recently added SP3a to my SQL 2000 system and every time I detach a
> > database and then reattach I lose all my default database settings for my SQL
> > login/users. when I go to change the default database and select OK it
> > requires me to confirm the password.
> > How to I get around this so I do not have to always retype the password.
Change Default database Confirm password required
database and then reattach I lose all my default database settings for my SQ
L
login/users. when I go to change the default database and select OK it
requires me to confirm the password.
How to I get around this so I do not have to always retype the password.Jacci
Why not to use BACKUP/RESTORE ?
"Jacci" <Jacci@.discussions.microsoft.com> wrote in message
news:84BD75D1-B541-4F33-BA63-FFACE2006D63@.microsoft.com...
> I have recently added SP3a to my SQL 2000 system and every time I detach a
> database and then reattach I lose all my default database settings for my
SQL
> login/users. when I go to change the default database and select OK it
> requires me to confirm the password.
> How to I get around this so I do not have to always retype the password.|||There are three version of the MS03-031 "Slammer Worm" virus hot fix. The
first messed up the DTSGUI.dll, the second, to fix this, messed up the login
password issue you are discribing. The latest is 8.00.819, you are probably
running build 818. Severice Pack 3a is build 760.
However, as far as the default databases goes, you can not fix this issue
since logins are assigned default databases by DBID. Once that database is
attached, there is no corresponding DBID to default to. Moreover, those ids
,
although incremental, are reused. So, if you were to bring another database
online before you reattached the original, the logins may be assigned to the
new database instead.
Here is the KB for the password issue:
http://support.microsoft.com/defaul...kb;en-us;826161
http://support.microsoft.com/defaul...kb;en-us;821277
Sincerely,
Anthony Thomas
"Jacci" wrote:
> I have recently added SP3a to my SQL 2000 system and every time I detach a
> database and then reattach I lose all my default database settings for my
SQL
> login/users. when I go to change the default database and select OK it
> requires me to confirm the password.
> How to I get around this so I do not have to always retype the password.|||Thank You - this worked ;-)
"AnthonyThomas" wrote:
[vbcol=seagreen]
> There are three version of the MS03-031 "Slammer Worm" virus hot fix. The
> first messed up the DTSGUI.dll, the second, to fix this, messed up the log
in
> password issue you are discribing. The latest is 8.00.819, you are probab
ly
> running build 818. Severice Pack 3a is build 760.
> However, as far as the default databases goes, you can not fix this issue
> since logins are assigned default databases by DBID. Once that database i
s
> attached, there is no corresponding DBID to default to. Moreover, those i
ds,
> although incremental, are reused. So, if you were to bring another databa
se
> online before you reattached the original, the logins may be assigned to t
he
> new database instead.
> Here is the KB for the password issue:
> http://support.microsoft.com/defaul...kb;en-us;826161
> http://support.microsoft.com/defaul...kb;en-us;821277
> Sincerely,
>
> Anthony Thomas
>
> "Jacci" wrote:
>
Monday, March 19, 2012
Change connection with T-SQL?
Hi,
I know I can right-click in query editor window and choose "Connection->Change Connection", but is there any T-SQL code or system stored proc I can use to dynamically change server connection in the middle of a script?
Thanks,
Dave
The sqlcmd command prompt utility which can also be run in Query Editor in sqlcmd mode.
See SQL Server 2005 Books Online topic for script information
Using the sqlcmd Utility
http://msdn2.microsoft.com/en-us/library/ms180944.aspx
E. Using sqlcmd to execute code on multiple instances
The following code in a file shows a script that connects to two instances. Notice the GO
before the connection to the second instance.
:CONNECT <server>\,<instance1>
EXEC dbo.SomeProcedure
GO
:CONNECT <server>\,<instance2>
EXEC dbo.SomeProcedure
GO
See SQL Server 2005 Books Onlinetopic
Editing SQLCMD Scripts with Query Editor
http://msdn2.microsoft.com/en-gb/library/ms174187.aspx
Friday, February 10, 2012
Case-Sensitive Search
We have two systems, a Financial system and a Professional Service Automated
system. The database currently has a collation of case-insensitive
(MSSQL2K). The Financial system happened to have incorrectly exported a
ProjectCode value that was in all lower case to the other system where in
expects a ProjectCode value to be in UPPERCASE. I would to be able to write
a query that will identify all rows in a table in the financial system where
the ProjectCode is in lowercase in the case-insensitive environment.
TIA,
bpdee
See "collate" clause in BOL.
Example:
select
*
from
(
select 1, cast('microsoft sql server 2000' as varchar(25))
union all
select 2, cast('MICROSOFT SQL SERVER 2000' as varchar(25))
) t1(c1, c2)
where
c2 like 'microsoft sql server 2000' collate SQL_Latin1_General_CP1_CS_AS
AMB
"bpdee" wrote:
> Hi,
> We have two systems, a Financial system and a Professional Service Automated
> system. The database currently has a collation of case-insensitive
> (MSSQL2K). The Financial system happened to have incorrectly exported a
> ProjectCode value that was in all lower case to the other system where in
> expects a ProjectCode value to be in UPPERCASE. I would to be able to write
> a query that will identify all rows in a table in the financial system where
> the ProjectCode is in lowercase in the case-insensitive environment.
> TIA,
> bpdee
Case-Sensitive Search
We have two systems, a Financial system and a Professional Service Automated
system. The database currently has a collation of case-insensitive
(MSSQL2K). The Financial system happened to have incorrectly exported a
ProjectCode value that was in all lower case to the other system where in
expects a ProjectCode value to be in UPPERCASE. I would to be able to write
a query that will identify all rows in a table in the financial system where
the ProjectCode is in lowercase in the case-insensitive environment.
TIA,
bpdeeSee "collate" clause in BOL.
Example:
select
*
from
(
select 1, cast('microsoft sql server 2000' as varchar(25))
union all
select 2, cast('MICROSOFT SQL SERVER 2000' as varchar(25))
) t1(c1, c2)
where
c2 like 'microsoft sql server 2000' collate SQL_Latin1_General_CP1_CS_AS
AMB
"bpdee" wrote:
> Hi,
> We have two systems, a Financial system and a Professional Service Automat
ed
> system. The database currently has a collation of case-insensitive
> (MSSQL2K). The Financial system happened to have incorrectly exported a
> ProjectCode value that was in all lower case to the other system where in
> expects a ProjectCode value to be in UPPERCASE. I would to be able to wri
te
> a query that will identify all rows in a table in the financial system whe
re
> the ProjectCode is in lowercase in the case-insensitive environment.
> TIA,
> bpdee
Case-Sensitive Search
We have two systems, a Financial system and a Professional Service Automated
system. The database currently has a collation of case-insensitive
(MSSQL2K). The Financial system happened to have incorrectly exported a
ProjectCode value that was in all lower case to the other system where in
expects a ProjectCode value to be in UPPERCASE. I would to be able to write
a query that will identify all rows in a table in the financial system where
the ProjectCode is in lowercase in the case-insensitive environment.
TIA,
bpdeeSee "collate" clause in BOL.
Example:
select
*
from
(
select 1, cast('microsoft sql server 2000' as varchar(25))
union all
select 2, cast('MICROSOFT SQL SERVER 2000' as varchar(25))
) t1(c1, c2)
where
c2 like 'microsoft sql server 2000' collate SQL_Latin1_General_CP1_CS_AS
AMB
"bpdee" wrote:
> Hi,
> We have two systems, a Financial system and a Professional Service Automated
> system. The database currently has a collation of case-insensitive
> (MSSQL2K). The Financial system happened to have incorrectly exported a
> ProjectCode value that was in all lower case to the other system where in
> expects a ProjectCode value to be in UPPERCASE. I would to be able to write
> a query that will identify all rows in a table in the financial system where
> the ProjectCode is in lowercase in the case-insensitive environment.
> TIA,
> bpdee