Showing posts with label dear. Show all posts
Showing posts with label dear. Show all posts

Friday, March 30, 2012

How to control the security in this case?

Dear all,
I have a SQL Server 2000 in my head office, it has several databases.
However, one of the databases is maintained by a colleague of a regional
office. He has the all the authority (read / write) to work on this database
.
But there is a problem, we have developed some DTS packages in head office
and this colleague is going to make his own packages. We would like to have
a
control that this colleague is not able to access our DTS packages (not even
read), he can only opens his own the DTS packages.
Is there any control to achieve this purpose? Please advise. Thanks a lot.
IvanOpen the packages in design mode, use "save as" and set the owner and user
password.
AMB
"Ivan" wrote:

> Dear all,
> I have a SQL Server 2000 in my head office, it has several databases.
> However, one of the databases is maintained by a colleague of a regional
> office. He has the all the authority (read / write) to work on this databa
se.
> But there is a problem, we have developed some DTS packages in head office
> and this colleague is going to make his own packages. We would like to hav
e a
> control that this colleague is not able to access our DTS packages (not ev
en
> read), he can only opens his own the DTS packages.
> Is there any control to achieve this purpose? Please advise. Thanks a lot.
> Ivan
>|||Hi, Alejandro
I'm afrais that does not solve the problem. I still keep seeing the DTS's
created by others.
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:B1A8ECBE-047C-4095-889A-A7DA9C4BFD04@.microsoft.com...[vbcol=seagreen]
> Open the packages in design mode, use "save as" and set the owner and user
> password.
>
> AMB
> "Ivan" wrote:
>
database.[vbcol=seagreen]
office[vbcol=seagreen]
have a[vbcol=seagreen]
even[vbcol=seagreen]
lot.[vbcol=seagreen]|||Hi Uri,
It is allowed that the colleague in the regional office to create his own
DTS. I just don't want to view the DTS created in my head office.
Besides setting password in each DTS package, is there any other way?
Thanks.
Ivan
"Uri Dimant" wrote:

> Hi, Alejandro
> I'm afrais that does not solve the problem. I still keep seeing the DTS's
> created by others.
>
> "Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in messag
e
> news:B1A8ECBE-047C-4095-889A-A7DA9C4BFD04@.microsoft.com...
> database.
> office
> have a
> even
> lot.
>
>

Wednesday, March 28, 2012

how to connect to sql server as other's window login rather than user's window login thorugh A

Dear members,

In MSDN, it says that it is recommended to use windows authentication to connect to SQL Server rather than use mixed authentication.

I create user delta\sqluser on windows OS, and I specify in my webform ASP.NET script below :

protected System.Web.UI.WebControls.Label Label1;
private string _connString = @."data source=delta\sql2000;initial catalog=northwind;integrated security=false;user id=delta\sqluser";
/*
comment : I login to my windows as delta\koronx, and I want to every user (including me), connected to sql server through IIS, will be identified as delta\sqluser not as user's login (impersonate)
*/
private void Page_Load(object sender, System.EventArgs e)
{
SqlConnection conn = new SqlConnection(_connString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select suser_sname()";

conn.Open();


string userName = cmd.ExecuteScalar() as string;
conn.Close();
conn.Close();
Label1.Text = userName;
}

at web.config, I add :
<identity impersonate="false" userName="delta\sqluser" password="" />

at IIS webApplication1's properties, tab "Directory Security", at "Authentication and access control" section, I checked "enable anonymous access" with user : DELTA\IUSR_DELTA and checked "Integrated Windows Authentication",

at query analyzer, I login as "sa" and execute script below :
exec sp_grantdbaccess 'delta\sqluser','northwind'

when I run the ASP.NET script, error at conn.Open(); with error message :
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

What should I do so that IIS login to SQL Server as user delta\sqluser not as "NT AUTHORITY\NETWORK SERVICE" ?

Regards,

Koronx

Your connection string is incorrect. You specify using SQL Authentication (integrated security = false) but what you want is integrated security. However, the connection string for integrated security does not allow you to impersonate a user. You should look for help on configuring your application to impersonate a specific account on an ASP.NET forum at: http://forums.asp.net/.

Thanks
Laurentiu

how to connect to sql server as other's window login rather than user's window login thoru

Dear members,

In MSDN, it says that it is recommended to use windows authentication to connect to SQL Server rather than use mixed authentication.

I create user delta\sqluser on windows OS, and I specify in my webform ASP.NET script below :

protected System.Web.UI.WebControls.Label Label1;
private string _connString = @."data source=delta\sql2000;initial catalog=northwind;integrated security=false;user id=delta\sqluser";
/*
comment : I login to my windows as delta\koronx, and I want to every user (including me), connected to sql server through IIS, will be identified as delta\sqluser not as user's login (impersonate)
*/
private void Page_Load(object sender, System.EventArgs e)
{
SqlConnection conn = new SqlConnection(_connString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select suser_sname()";

conn.Open();


string userName = cmd.ExecuteScalar() as string;
conn.Close();
conn.Close();
Label1.Text = userName;
}

at web.config, I add :
<identity impersonate="false" userName="delta\sqluser" password="" />

at IIS webApplication1's properties, tab "Directory Security", at "Authentication and access control" section, I checked "enable anonymous access" with user : DELTA\IUSR_DELTA and checked "Integrated Windows Authentication",

at query analyzer, I login as "sa" and execute script below :
exec sp_grantdbaccess 'delta\sqluser','northwind'

when I run the ASP.NET script, error at conn.Open(); with error message :
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

What should I do so that IIS login to SQL Server as user delta\sqluser not as "NT AUTHORITY\NETWORK SERVICE" ?

Regards,

Koronx

Your connection string is incorrect. You specify using SQL Authentication (integrated security = false) but what you want is integrated security. However, the connection string for integrated security does not allow you to impersonate a user. You should look for help on configuring your application to impersonate a specific account on an ASP.NET forum at: http://forums.asp.net/.

Thanks
Laurentiu

Monday, March 26, 2012

How to connect to Sql Server

Dear Sir and Madam:
I am now using Visual Foxpro 8 connect to MS Sql server 2000 (Personal Edition).
Now, I have a serious problem that I can not connect SQL Server from client machine and it raises the following message :
SQL Server does not exist or access denied

But it worked when I connect at Server. I don't know the reason why

Here is My Server Configuation
Computer Firewall is OFF
Authentication : SQL Server and Windows
Connectstring="DRIVER=SQL Server;SERVER=HUNG1975;DATABASE=sales;UID=sa;PWD=sa;Trusted_Connection=False;DispLogin=3;ConnectTimeout=3"

Please help me
Thank you very very much.

Hi,

make sure that you are using the right port and that the user and the password is valid can access the database.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Friday, March 23, 2012

How to Connect SQL server Using ASP.net

Dear ASP.NET user...

I'm a new user in ASP.NET...
i have a problem facing now...
I'm using SQL server as my database...
how do i CONNECT my web application using ASP.NET to SQL server??

What should i do?
any coding do i need to insert to my web HTML?

what i heard from my friend...she said web config can connect the web application to SQL server...?...it that work?

pls help me guys and gals...

From jhwong2610
URGENTVery often the web.config is used to store the connection string - that alone does not connect you to a database - using the connection string you have to open a sqlConnection and then proceed from there.

My best recommendation would be to pick up one of the ASP.NET books and look at one of the examples that uses data binding.|||Hi:
Like This


Dim Conn As New SqlConnection("ConnectionStringHere")
Dim Conn As New SqlCommand("Select * From Table", Conn)
Dim DRs As SqlDataReader
Conn.Open()
DRs = Comm.ExecuteReader()
If DRs.Read() Then
Response.Write(DRs("Column"))
End If
DRs.Close()
Conn.Close()
|||Add this to the web.config file:

<configuration>
<appSettings>
<add key="SQLConnStr" value="<your connection string" />
</appSettings
...

You can use the connectionstring in the code like this:

Dim str as connStr = System.Configuration.ConfigurationSettings.AppSettings("SQLConnStr")

How to connect SQL Server From Pocket PC Device

Dear members

I want to connect SQL Server database from pocket pc device

but it gives an error than "Either the sql database does not exist or access denied

My Code is

SqlConnection conn=new SqlConnection("Data Source=OurServer;initial catalog=Resident;user id = sa;password = sa);

conn.Open();

If anybody knows the problem please send some information

Regards

Bijaya

The error suggests that connectivity doesn't exist between the pocket pc device and SQL or that the server isn't running/listening on the desired protocol.

Does the same code run successfully on a desktop PC? If so try verifing that the pocket pc has network connectivity and access to the SQL machine.

Hope this helps.

|||

Thanks for reply

Now the above code can connect SQL Server 2003 installed in Windows 2000 professional machine.But it can not connect to the SQL Server installed in Windows XP machine.

what is the problem behind it.Please give some information

Regards Bijaya

|||

This blog is a great source for connection troubleshooting tips:
http://blogs.msdn.com/sql_protocols

In this case if SQL Server 2005 is running on Windows XP SP2 then you may need to add an exception to the Windows firewall for the service. The blog goes into detail on exactly how to accomplish this.

Hope this helps.

Monday, March 19, 2012

How to configure MSDTC in a 2003 OS cluster environment running Sql Server 2005?

Dear fellows,

We're installing Sql Server 2005 in Active-Active way.

As far as I know seems that at first MSDTC must be installed before Sql. But how?

Does anyone ever faced this kind of requirement?

Any document related with this issue would be very useful

TIA

Hi Eric,

I don't know if your problem is solved, but here is the info you require:

Http://support.microsoft.com/?id=301600

Hope this helps

How to configure MSDTC in a 2003 OS cluster environment running Sql Server 2005?

Dear fellows,

We're installing Sql Server 2005 in Active-Active way.

As far as I know seems that at first MSDTC must be installed before Sql. But how?

Does anyone ever faced this kind of requirement?

Any document related with this issue would be very useful

TIA

Hi Eric,

I don't know if your problem is solved, but here is the info you require:

Http://support.microsoft.com/?id=301600

Hope this helps

Monday, March 12, 2012

How to configure Email notification?

Dear all,
I am not sure if I am posting my question at the right place. Anyway, I hope
someone can help me out.
I have a scheduled job in SQL server agent and I would like to configure the
email notification if the job fails. When I tried to create a new email
operator name, I clicked on the small button [...] besides the "Email Name"
textbox, an error message "Unable to logon to the mail system. You should
start a mail client (Microsoft Outlook or Microsoft Exchange Client) to use
this feature." appeared. Can any teach me how to do the configuration?
Thanks a lot!
Ivanhttp://support.microsoft.com/default.aspx?scid=kb;en-us;263556&sd=tech
HTH, Jens Suessmeyer.|||I don't like the fact a mapi client has to be loaded on the box for SQL Mail,
doesn't seem best practice... ...I prefer to use a script.
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Test Message"
objMessage.From = "SQLServer"
objMessage.To = "" 'Insert email address here.
objMessage.TextBody = "Notification message (" & FormatDateTime(Date,1) & ",
" & FormatDateTime(Time,4) & ")"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "exchange" 'Insert your exchange server name here
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
objMessage.Send
Set objMessage = Nothing
"Ivan" wrote:
> Dear all,
> I am not sure if I am posting my question at the right place. Anyway, I hope
> someone can help me out.
> I have a scheduled job in SQL server agent and I would like to configure the
> email notification if the job fails. When I tried to create a new email
> operator name, I clicked on the small button [...] besides the "Email Name"
> textbox, an error message "Unable to logon to the mail system. You should
> start a mail client (Microsoft Outlook or Microsoft Exchange Client) to use
> this feature." appeared. Can any teach me how to do the configuration?
> Thanks a lot!
> Ivan
>|||And for me I dont like using the old fashioned Scripting approach, did
you suggest using the xp_smtp_sendmail procedure. It uses a non-mapi
interface (SMTP) to send out mails, it has some restrictions, but and
the other hand some great features, like sending out HTML mails (I know
thats the hell for some of you guys :-) ), giving friendly names, etc.
You can download that on:
http://www.sqldev.net/xp/xpsmtp.htm
HTH, Jens Suessmeyer.|||I'm not sure if you will be upgrading to SQL 2005 anytime soon, but
mail is much improved in 2005. There is no need for email clients to
be installed and you don't have to write your own object and you don't
need any 3rd party xp.
Jens wrote:
> And for me I dont like using the old fashioned Scripting approach, did
> you suggest using the xp_smtp_sendmail procedure. It uses a non-mapi
> interface (SMTP) to send out mails, it has some restrictions, but and
> the other hand some great features, like sending out HTML mails (I know
> thats the hell for some of you guys :-) ), giving friendly names, etc.
> You can download that on:
> http://www.sqldev.net/xp/xpsmtp.htm
> HTH, Jens Suessmeyer.

How to configure Email notification?

Dear all,
I am not sure if I am posting my question at the right place. Anyway, I hope
someone can help me out.
I have a scheduled job in SQL server agent and I would like to configure the
email notification if the job fails. When I tried to create a new email
operator name, I clicked on the small button [...] besides the "Email Name"
textbox, an error message "Unable to logon to the mail system. You should
start a mail client (Microsoft Outlook or Microsoft Exchange Client) to use
this feature." appeared. Can any teach me how to do the configuration?
Thanks a lot!
Ivan
http://support.microsoft.com/default...263556&sd=tech
HTH, Jens Suessmeyer.
|||I don't like the fact a mapi client has to be loaded on the box for SQL Mail,
doesn't seem best practice... ...I prefer to use a script.
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Test Message"
objMessage.From = "SQLServer"
objMessage.To = "" 'Insert email address here.
objMessage.TextBody = "Notification message (" & FormatDateTime(Date,1) & ",
" & FormatDateTime(Time,4) & ")"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "exchange" 'Insert your exchange server name here.
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
objMessage.Send
Set objMessage = Nothing
"Ivan" wrote:

> Dear all,
> I am not sure if I am posting my question at the right place. Anyway, I hope
> someone can help me out.
> I have a scheduled job in SQL server agent and I would like to configure the
> email notification if the job fails. When I tried to create a new email
> operator name, I clicked on the small button [...] besides the "Email Name"
> textbox, an error message "Unable to logon to the mail system. You should
> start a mail client (Microsoft Outlook or Microsoft Exchange Client) to use
> this feature." appeared. Can any teach me how to do the configuration?
> Thanks a lot!
> Ivan
>
|||And for me I dont like using the old fashioned Scripting approach, did
you suggest using the xp_smtp_sendmail procedure. It uses a non-mapi
interface (SMTP) to send out mails, it has some restrictions, but and
the other hand some great features, like sending out HTML mails (I know
thats the hell for some of you guys :-) ), giving friendly names, etc.
You can download that on:
http://www.sqldev.net/xp/xpsmtp.htm
HTH, Jens Suessmeyer.
|||I'm not sure if you will be upgrading to SQL 2005 anytime soon, but
mail is much improved in 2005. There is no need for email clients to
be installed and you don't have to write your own object and you don't
need any 3rd party xp.
Jens wrote:
> And for me I dont like using the old fashioned Scripting approach, did
> you suggest using the xp_smtp_sendmail procedure. It uses a non-mapi
> interface (SMTP) to send out mails, it has some restrictions, but and
> the other hand some great features, like sending out HTML mails (I know
> thats the hell for some of you guys :-) ), giving friendly names, etc.
> You can download that on:
> http://www.sqldev.net/xp/xpsmtp.htm
> HTH, Jens Suessmeyer.

How to configure Email notification?

Dear all,
I am not sure if I am posting my question at the right place. Anyway, I hope
someone can help me out.
I have a scheduled job in SQL server agent and I would like to configure the
email notification if the job fails. When I tried to create a new email
operator name, I clicked on the small button [...] besides the "Email Na
me"
textbox, an error message "Unable to logon to the mail system. You should
start a mail client (Microsoft Outlook or Microsoft Exchange Client) to use
this feature." appeared. Can any teach me how to do the configuration?
Thanks a lot!
Ivanhttp://support.microsoft.com/defaul...;263556&sd=tech
HTH, Jens Suessmeyer.|||I don't like the fact a mapi client has to be loaded on the box for SQL Mail
,
doesn't seem best practice... ...I prefer to use a script.
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Test Message"
objMessage.From = "SQLServer"
objMessage.To = "" 'Insert email address here.
objMessage.TextBody = "Notification message (" & FormatDateTime(Date,1) & ",
" & FormatDateTime(Time,4) & ")"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/confi
guration/sendusing") = 2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/confi
guration/smtpserver") = "exchange" 'Insert your exchange server name here.
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/confi
guration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
objMessage.Send
Set objMessage = Nothing
"Ivan" wrote:

> Dear all,
> I am not sure if I am posting my question at the right place. Anyway, I ho
pe
> someone can help me out.
> I have a scheduled job in SQL server agent and I would like to configure t
he
> email notification if the job fails. When I tried to create a new email
> operator name, I clicked on the small button [...] besides the "Email
Name"
> textbox, an error message "Unable to logon to the mail system. You should
> start a mail client (Microsoft Outlook or Microsoft Exchange Client) to us
e
> this feature." appeared. Can any teach me how to do the configuration?
> Thanks a lot!
> Ivan
>|||And for me I dont like using the old fashioned Scripting approach, did
you suggest using the xp_smtp_sendmail procedure. It uses a non-mapi
interface (SMTP) to send out mails, it has some restrictions, but and
the other hand some great features, like sending out HTML mails (I know
thats the hell for some of you guys :-) ), giving friendly names, etc.
You can download that on:
http://www.sqldev.net/xp/xpsmtp.htm
HTH, Jens Suessmeyer.|||I'm not sure if you will be upgrading to SQL 2005 anytime soon, but
mail is much improved in 2005. There is no need for email clients to
be installed and you don't have to write your own object and you don't
need any 3rd party xp.
Jens wrote:
> And for me I dont like using the old fashioned Scripting approach, did
> you suggest using the xp_smtp_sendmail procedure. It uses a non-mapi
> interface (SMTP) to send out mails, it has some restrictions, but and
> the other hand some great features, like sending out HTML mails (I know
> thats the hell for some of you guys :-) ), giving friendly names, etc.
> You can download that on:
> http://www.sqldev.net/xp/xpsmtp.htm
> HTH, Jens Suessmeyer.

How to configure DataReader Source for DataFlow

Dear Friends,

I have to import dBASE files to SQL Server. For this I have created one ODBC connection manager for those dBASE files. This I have to set for DataReader Source. But I am unable to configure the DataReader Source.

So, Please tell me how to configure DataReader Source for ODBC connection Manager.

Eagerly waiting for your valuable reply............

Santosh

INDIA

Are you getting any error?

Once in the data reader; you should provide the query and the connection manager information.

|||

Hello Santosh

Instead of creating an ODBC Connection Manager, you should create a ADO.NET Connnection Manager that uses the OdbcClient provider, and configure it to use the DSN you've set up for dBASE. I haven't tried dBASE specifically, but as a general statement the DataReader Source works only with ADO.NET connections.

-David

How to configure DataReader Source for DataFlow

Dear Friends,

I have to import dBASE files to SQL Server. For this I have created one ODBC connection manager for those dBASE files. This I have to set for DataReader Source. But I am unable to configure the DataReader Source.

So, Please tell me how to configure DataReader Source for ODBC connection Manager.

Eagerly waiting for your valuable reply............

Santosh

INDIA

Are you getting any error?

Once in the data reader; you should provide the query and the connection manager information.

|||

Hello Santosh

Instead of creating an ODBC Connection Manager, you should create a ADO.NET Connnection Manager that uses the OdbcClient provider, and configure it to use the DSN you've set up for dBASE. I haven't tried dBASE specifically, but as a general statement the DataReader Source works only with ADO.NET connections.

-David

Friday, March 9, 2012

How to compose the connection String of a SSIS package that execute another package?

Dear All,

I now have two SSIS package, "TESTING" and "LOADING". The "TESTING" package have an execute package task that call the "LOADING" package. When I want to execute the TESTING package, how can I setup the connection string so that I can edit the password of the database connected by the "LOADING" package?

Regards,

Strike

You should use configurations to achieve this. There's plenty of material out there about SSIS configurations if you google it.

-Jamie

|||How about if I want to create a command file so that I can input the password externally in the command prompt?|||

You can pass values into a package via the command-line using the /SET option of dtexec.

If the package that you call is a parent package then you can pass the value through to the child using a parent package configuration.

-Jamie

|||

Hi Jamie,

I would like to know how can I setup the command line in the SQL Server Job Agent for executing the two packages mentioned above? I have already configured the parent variable for the child package. However, I have encountered some errors when executing the job, and I don't know how to set up the path for the child package in the command line as both of the packages are loaded from the SQL server, not from the file system.

Thank you very much!!

Strike Wong

|||For help building command lines, try DTExecUI.exe. Set the options you want, and then look at the Command Line page. You can copy the command from there. Obviously you can execute the package from there as well to check the validity of the command you have built.|||

Is this included in the MS SQL Server 2005?
I can't found it in the directories

|||

Yes -

How to: Run a Package Using the DTExecUI Utility
(http://msdn2.microsoft.com/en-us/library/d827d7b2-2eb6-4f4a-a775-ab00c444c0dd.aspx)

It should be available from a command prompt or the Run dialog, as the Bin folder were it lives should be on your PATH, set as part of the SQL 2005 install.

Friday, February 24, 2012

How to combine different row into one row

Dear all,
I got a table with different columns of same client id as
follows:
e.g.
ClientID Name Age Country
1 Peter
1 32
1 China
Now I want to combine these three rows into one rows as
follows
ClientID Name Age Country
1 Peter 32 China
How can I do that by SQL statements. Just simple SQL
statements.
Not sotred procedures.
Thankshon123456 wrote:
> Dear all,
> I got a table with different columns of same client id as
> follows:
> e.g.
> ClientID Name Age Country
> 1 Peter
> 1 32
> 1 China
>
> Now I want to combine these three rows into one rows as
> follows
> ClientID Name Age Country
> 1 Peter 32 China
> How can I do that by SQL statements. Just simple SQL
> statements.
> Not sotred procedures.
>
> Thanks
What do the spaces in your example represent? What is the key of this
table? If those missing values are always just empty then do:
SELECT clientid,
MAX(name) AS name,
MAX(age) AS age,
MAX(country) AS country
FROM your_table
GROUP BY clientid ;
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||Hi
CREATE TABLE #test (col1 INT, col2 CHAR(1),col3 INT,col4 CHAR(1))
INSERT INTO #Test VALUES (1,'a',NULL,NULL)
INSERT INTO #Test VALUES (1,NULL,32,NULL)
INSERT INTO #Test VALUES (1,NULL,NULL,'b')
SELECT MAX(col1),MAX(col2),MAX(col3),MAX(col4)
FROM #test
--or
SELECT col1,
MAX(CASE WHEN col2 IS NOT NULL THEN col2 end)as col2,
MAX(CASE WHEN col3 IS NOT NULL THEN col3 end)as col3,
MAX(CASE WHEN col4 IS NOT NULL THEN col4 end)as col4
FROM #test
GROUP BY col1
"hon123456" <peterhon321@.yahoo.com.hk> wrote in message
news:1140524835.788163.177040@.g43g2000cwa.googlegroups.com...
> Dear all,
> I got a table with different columns of same client id as
> follows:
> e.g.
> ClientID Name Age Country
> 1 Peter
> 1 32
> 1 China
>
> Now I want to combine these three rows into one rows as
> follows
> ClientID Name Age Country
> 1 Peter 32 China
> How can I do that by SQL statements. Just simple SQL
> statements.
> Not sotred procedures.
>
> Thanks
>|||SELECT ClientID, MIN(Name) as Name, Min(Age) as Age, Min(Country) as
Country
FROM Table
GROUP BY ClientID
Stu|||Thanks for you all.

Sunday, February 19, 2012

How to clear the Conflict tables from database

Dear Friends
I have created a Mearge Replication with name TEST for database DBTEST I
have deleted the same Replicaiton but now in my Database DBTEST i see the
tables with name Conflict_TEST_TableName
How i can clean the same.
Your guidance will enable me to solve the problem.
Thanks and best regards
Shailesh.
Shailesh,
you can drop these tables using query analyser.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)