buddylee17 216 Practically a Master Poster

Backup the db before you try this. You'll also need to add a unique ID column if there's not one already.

DELETE
FROM MyTable
WHERE ID NOT IN
(
SELECT MAX(ID)
FROM MyTable
GROUP BY DuplicateColumn1, DuplicateColumn2, DuplicateColumn3)

http://blog.sqlauthority.com/2007/03/01/sql-server-delete-duplicate-records-rows/

buddylee17 216 Practically a Master Poster

The column you are inserting into has an index with a unique constraint. Either rethink your database design or remove the constraint. To remove the constraint, Under indexes, open IX_UserInfoUserID and uncheck the unique checkbox.

buddylee17 216 Practically a Master Poster

There are 2 parts to this. The first part (creating the group and adding users) is done at the server level.

Click Start->Administrative Tools->Computer Management.
Click Local Users and groups. Open groups. Right click and select Add Group.
Name your group and apply server level permissions.
After you create the group, add the users.

Log into Sql Server Management Studio.
Create a login that uses Windows Authentication. Use the new group as the username. Assign server permissions. Assign database permissions.

buddylee17 216 Practically a Master Poster

Select "Copy data from one or more tables or views". On the next screen, click the checkbox for the table that you want to export. Also, verify that the destination table is correct.

buddylee17 216 Practically a Master Poster
INSERT INTO DestinationTable(DestinationColumn)
 SELECT SUBSTRING(master.sys.fn_varbintohexstr(HashBytes('MD5', SourceColumn)),3,19) FROM SourceTable
buddylee17 216 Practically a Master Poster

There are probably around 100 ways to do this.

If you are new to SQL Server, the easiest way will probably be the export data task.

From the Management Studio, right click on the database of the source table. Hover over "Tasks" and then select "Export Data..." Follow the instructions.

Post back if you have any issues.

buddylee17 216 Practically a Master Poster

There are many ways to do this, but here's one way to do it from the Management Studio:
Under the server, expand security and expand Logins.
Create a new login.
Under Server Roles, keep the login as Public.
Under User mapping, check the database that you want the user to have access to.
Under database role membership, give the user the appropriate role (db_datareader, db_datawriter...).
Click Ok.

Under the database, expand users and double click the user.
Under securables, click Search button, and select object types, tables. Check the table and click ok.
At the bottom, explicitly deny permissions to the table.

There are many other ways to accomplish this, but this way will work.

buddylee17 216 Practically a Master Poster

I agree. The data is varbinary and is being implicitly converted. Here's what you need:

SELECT SUBSTRING(master.sys.fn_varbintohexstr(HashBytes('MD5', ColumnName)),3,19) FROM TableName
buddylee17 216 Practically a Master Poster
buddylee17 216 Practically a Master Poster

Replace ColumnName and TableName with your column and table name:

SELECT SUBSTRING(HashBytes('MD5', ColumnName),1,19) [Hashed] FROM TableName
buddylee17 216 Practically a Master Poster

Go into services and verify that SQL Server Browser is running. If it's not, start it.

buddylee17 216 Practically a Master Poster

Sounds like Sql Server is not configured to allow remote connections.

Can you open Sql Server Management Studio and connect to the server? If so, right click the instance in question, go to Properties -> Connections -> Check "Allow remote connections to this server".

May also want to verify TCP/IP is enabled on the server via Sql Server Configuration Manager.

buddylee17 216 Practically a Master Poster

From within the network (and assuming that your app runs under a user with privileges to the database), use windows authentication. Notice there is no username, as the app runs under a user context (maybe NT AUTHORITY\NETWORK SERVICE).

Data Source=YOUR SERVER NAME;Initial Catalog=YOUR DATABASE NAME;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;

Alternatively, use SQL Server Authentication:

Data Source=YOUR SERVER NAME; Initial Catalog=YOUR DATABASE NAME; Provider=SQLNCLI10.1;User ID=YOUR USERNAME;Password=YOUR PASSWORD;Auto Translate=False;

See the connection strings website for all the different connection strings which can be used.

buddylee17 216 Practically a Master Poster

See my post here. The login can either be

  • Windows Authentication (network authenticates user)

OR

  • SQL Server Authentication (password in sql server authenticates user)

There is no mixed login. Mixed refers to the fact that SQL Server will authenticate either type of login.

In the management studio, run the following to determine which authentication the user in question is:

SELECT name, type_desc AuthenticationType
  FROM sys.server_principals
  WHERE type in ('U','S')

To further reiterate, use the following query and you can actually see that no password is stored for Windows Authentication users:

SELECT sp.name, sp.type_desc AuthenticationType, sl.password
  FROM sys.server_principals sp
  JOIN syslogins sl ON sp.name = sl.name
  WHERE sp.type in ('U','S')
buddylee17 216 Practically a Master Poster

In SQL Server, you have 2 login options:

1.) Windows Authentication: No password allowed. The credentials used when logging in to the machine are pushed forward and verified by either the local machine or the Active Directory (if on a network) and then compared with credentials in the database to verify the principals permissions.

2.) SQL Server Authentication: Password is required and user has absolutely no relationship to any local or network users. User is authenticated by SQL Server.

You need to understand that mixed mode does not mean mixing users up. It means either use a trusted connection (Windows Authentication) or require that the user logs in with a valid username / password combination (stored in SQL Server).

sa is a good example of a SQL Server Login. It has absolutely no relationship to any user on the network, but has a password stored in SQL Server and has unlimited permissions in the database.

buddylee17 216 Practically a Master Poster

Have you looked into merge replication? This is exactly what merge replication is designed for.

buddylee17 216 Practically a Master Poster

I've created (and automated) many html email based reports using just T-SQL and Database Mail. I like using For XML PATH to turn a result set into an html formatted table. Try the following:

DECLARE @Table TABLE (
Column1 VARCHAR(9) NULL,
Column2 VARCHAR(9) NULL
)
INSERT @Table
SELECT 'Col1Value', 'Col2Value'

DECLARE @HTML VARCHAR(MAX)
DECLARE @CrLf CHAR(2) 
SET @CrLf = CHAR(13) + CHAR(10)

SET @HTML = '
<h1>Here is your report!</h1>
<table>
<tr><th>Column1</th><th>Column2</th></tr>' + @CrLf +
    CAST ( ( SELECT td = Column1, '',td = Column2,''
			   FROM @Table
              FOR XML PATH('tr'), TYPE) AS NVARCHAR(MAX) ) +
+ @CrLf + '</table>'

Print @HTML

This will print an html formatted table.

You can then use database mail to send the report to the recipients:

EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'insert your db mail profile name here', --you have to set this up before you run
    @recipients = 'insert a recipient email address here',
    @body = @HTML,
    @subject = 'Here is your report',
    @body_format ='HTML';
buddylee17 216 Practically a Master Poster

SQLBulkCopy is only handy when the source and destination schemas match up. It sounds like you are trying to pump varchar or char into an int column.

I have no control over the format of the text file, as it is an export of data from a vendor application.

I'd recommend either

a.) write a data preprocessor that will read the file into memory, perform string functions to clean the data and make it compatible with the destination (remove the dashes from the phone number), then pump the new file out to be bulk copied.

OR

b.) learn SSIS. This is the exact reason that SSIS is so popular in the Enterprise. You can design, develop, and implement this process in a matter of minutes.

Post back if you need any help on this.

buddylee17 216 Practically a Master Poster

Each browser applies it's own default stylesheet to every page. The link below should point you in the right direction:
http://www.search-this.com/2007/03/12/no-margin-for-error/

buddylee17 216 Practically a Master Poster

Only center the contents of the body. The center tag should open after the body and close before the body is closed. No clue if this is going to fix your problem but it's invalid as is.
Also note that the center tag has been deprecated.

buddylee17 216 Practically a Master Poster

Oh, SQL Server Management Studio didn't install. Which version did you install? Standard? Express? As long as it wasn't the Express edition, you should be able to install SSMS. If you installed Express, follow JuhaW's instructions above and install the scaled down Express version.
It should have installed on it's own, but there are known issues:
http://aspadvice.com/blogs/name/archive/2007/09/24/Installing-SQL-Server-Management-Studio-with-SQL-Server.aspx

buddylee17 216 Practically a Master Poster

I'm guessing you are coming from a SQL 2000 environment. If you want to write a query, just click the New Query button. You can also analyze the query in the Database Engine Tuning Advisor (Tools->Database Engine Tuning Advisor).

buddylee17 216 Practically a Master Poster

Windows Server 2003 Standard Edition Service Pack 2
SQL Server 2005 Standard
VS 2008

Hi everyone. I'm currently working on the following tutorial: http://www.asp.net/Learn/Security/tutorial-04-cs.aspx, but I get an error adding a SQL Server DB to the App_Data folder.
I right click App_Data, click Add New Item, SQL Server Database I get the following error:
---------------------------
Microsoft Visual Studio
---------------------------
Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verify the installation of the component or download from the URL: http://go.microsoft.com/fwlink/?LinkId=49251
---------------------------
OK Help
---------------------------
I purposely didn't install SQL Server Express because I already had the standard edition installed.
Does anyone know how to configure VS to use SQL Server 2005 instead of SSE?

buddylee17 216 Practically a Master Poster

It's unique to your area. Go to job sites like Monster.com or careerbuilder.com. Search different web development languages. Does coldfusion list 100 jobs? Does php? What about .net? If you are strictly learning a language for financial gain or employment security, this is what you should look into.
Getting paid is not about knowing one thing. It's about combining a potent and popular combination of skill sets and knowing how to do them extraordinarily well. When you see the search results for the jobs listed above, what other required skills are listed? For php, you'll probably see Apache and MySQL. For .net, you might see asp, vb, and/or C# plus the visual studio and sql server. The ultimate "GET PAID" stack is probably Oracle and Java. You know Oracle and Java and you are a made man! Whatever you do, stick with it and become an expert. You will not get rich by knowing how to output "Hello World" in 15 different languages. You will not get paid by knowing how to do a select statement in 18 different databases. You will get a great paying job for knowing the granular details of one specific skill set combination that is currently in demand.

buddylee17 216 Practically a Master Poster

Then you'll need one unique name for each group of radio buttons (each game):

<cfset i = 1>
<cfloop query="Picks">
<cfoutput>
<tr>
	<td><div class="content_black">Game #Game#&nbsp;</td>
	<td><div class="content_black">Week #Week#&nbsp;</td>
	<td><div class="content_black"><cfinput type="radio" name="mainloopGame#i#" value="1" required="yes" message="Please select the right option">#Home_team#&nbsp;</td>
	<td><div class="content_black"><cfinput type="radio" name="mainloopGame#i#" value="0" required="yes" message="Please select the right option">#Away_team#&nbsp;</td> 
</tr>
<cfset i = i + 1> 
</cfoutput>
</cfloop>

You should also consider cleaning up your html. You have several div tags that aren't closed.

buddylee17 216 Practically a Master Poster

Right now you only have 1 radio group with only 1 possible value. Split them up by renaming from mainloop to mainloopH and mainloopA like below:

<td><div class="content_black"><cfinput type="radio" name="mainloopH" value="1" required="yes" message="Please select the right option">#Home_team#&nbsp;</td>

<td><div class="content_black"><cfinput type="radio" name="mainloopA" value="0" required="yes" message="Please select the right option">#Away_team#&nbsp;</td>
buddylee17 216 Practically a Master Poster

So you want to add a static row after the query output? Post some code to give an idea of what you are trying to accomplish.

buddylee17 216 Practically a Master Poster

The lock is written into the query. You'll need to check into the correct syntax for your specific database.

buddylee17 216 Practically a Master Poster

Might as well, after the failure of Vista to win fans over. Maybe this is some surrender tactic with future hopes of a WAMP buyout. Surrender your source code, if you want it to run on Windows. Apache will always dominate the web. We don't need a fancy gui, an overpriced host, or a bunch of .net bs running in the background. No thanks, Micro$oft.

buddylee17 216 Practically a Master Poster
buddylee17 216 Practically a Master Poster

<a href="\inventory.php?id=" . $id . "\"><?php echo $row_rsAllListings['element_1_1']; ?></a> Why do you echo $row_rsAllListings['element_1_1'] but you don't echo $id? Check the link href value after the page is loaded. I'm sure you'll spot the problem.

buddylee17 216 Practically a Master Poster

Numeric datatypes will never have leading zeros. You could add a dummy number to the front and just remove with substr when outputting it.

$new_id1="12";
   $new_id2="345";
   $zero="0";
   $id="1{$zero}{$zero}{$new_id1}{$new_id2}";   
   settype($id,"float");
   echo $id; // outputs 10012345
   echo"<br>";
   $id = substr($id,1);//remove dummy number
   echo $id; // outputs 0012345
buddylee17 216 Practically a Master Poster

Well, if the page is .htm and the server is not set up to parse php in .htm files, just use a meta refresh:

<html>
<head>
<meta http-equiv="refresh" content="2;url=http://www.yoursite.com/newpage.htm" />
<title>Page has moved</title>
</head>
buddylee17 216 Practically a Master Poster

Why do you need regex for this? Can you not use basic string functions like LEFT, MID, and RIGHT?

buddylee17 216 Practically a Master Poster

Don't store images in a database. Is it a picturebase or a database???
Seriously, store the path to the pic in the db, store the pic on the server. The db is designed to store data. The server is designed to store everything else. Don't use a water jug to store gasoline. Put it in a gas jug.
If your' script is decent, then you can use the path to pull the pic. If not, you should probably go study @ www.php.net.

buddylee17 216 Practically a Master Poster

You haven't specified an image: "<img src=/em/tutor/images/". only specifies the folder that the image should be located.

papermusic commented: 10s +1
buddylee17 216 Practically a Master Poster

http://www.dreamincode.net/forums/showtopic10132.htm
This tutorial is easy to follow and will teach you how to write a tab delimited text file with a xls extension in php. It uses basic php text file functions such as fopen and fwrite.

buddylee17 216 Practically a Master Poster

Wordpress is php dependent, so I'd imagine you'd need to make sure php is installed on the server. The site lists the minimum requirements to run Wordpress on a server. http://wordpress.org/about/requirements/

buddylee17 216 Practically a Master Poster

The php mail function works great for a contact page on your site that will send the email to your sites MX. However, when sending to other mail servers such as yahoo, gmail, hotmail... it's not reliable enough to trust. Why? Because the mail function doesn't have SMTP authentication. Use one of php's prebuilt libraries, such as class.phpmailer.php. I use it for a mailing list and have tested through Yahoo, Gmail, Hotmail, and several others. It also provides a way to send both a plain text and html version of the message.

buddylee17 216 Practically a Master Poster

You could also do this with frames

buddylee17 216 Practically a Master Poster

You need JavaScript (unless you're comfortable with the page reloading on each change).

buddylee17 216 Practically a Master Poster
buddylee17 216 Practically a Master Poster

AJAX (Asynchronous JavaScript And XML)

buddylee17 216 Practically a Master Poster

Jeez how many times can this thing get bumped? It's almost 3 years old!!!

buddylee17 216 Practically a Master Poster
buddylee17 216 Practically a Master Poster

The table height attribute has been deprecated. It still works fine, but it is not valid in XHTML. Use a CSS style to set the table height: <table style="height:100%" The basic idea is for html to contain the content and logical structure and have CSS handle all display styles.

buddylee17 216 Practically a Master Poster

mail2saion, many thanks for bumping this thread to promote your blog.

buddylee17 216 Practically a Master Poster

Here's a tutorial. Make sure you add the COM reference that it talks about in the first paragraph.

This is what it showed for my machine:

C:
  Type:            Fixed
  File System:     NTFS
  Free Space:      189465538560
  Total Size:      249933357056
  Volume Name:     
  Serial Number:   -736547909
--------------------
D:
  Type:            CDRom
  Not ready
--------------------
E:
  Type:            Removable
buddylee17 216 Practically a Master Poster

You mean like:

arr2 = arr1
buddylee17 216 Practically a Master Poster

Well, if the uid is a numeric datatype, you could use:

SELECT COUNT(uid) FROM tracking WHERE uid = $trackuid

If not numeric, you'll have to surround with quotes:

SELECT COUNT(uid) FROM tracking WHERE uid = "$trackuid"