- Strength to Increase Rep
- +11
- Strength to Decrease Rep
- -2
- Upvotes Received
- 44
- Posts with Upvotes
- 42
- Upvoting Members
- 30
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Database Administrator. Web and database development professional. MCP: Microsoft Certified IT Professional: Database Administrator. Microsoft Certified Technology Specialist: SQL Server 2005.
- Interests
- rock music, web development, and databases
516 Posted Topics
Re: Hello, I use [URL="http://www.phpclasses.org/browse/file/919.html"]class.phpmailer.php[/URL]. It works for Yahoo, Hotmail, GMail, and I'm sure many others that I haven't tested. It also includes an example which is easy to follow. | |
Re: Here's a function I use sometimes. It explodes the address to get the domain name. It then checks for a Mail Exchange on the domain. This will work for bogus domain names but won't do anything for email addresses like [icode]bill@hotmail.com[/icode] or [icode]suzie@yahoo.com[/icode]. Try to keep in mind, there is … | |
Re: JavaScript comes pre-installed on the browser. PHP does not. | |
Re: Use Sessions for authentication. They will log the user off when the browser is closed. You shouldn't need to store a value in the db unless you want to show users activity (last login at...) | |
Re: I guess you mean this: [icode] <a href="http://www.google.com"> <img src="<?php echo get_bloginfo('url') ?>/serv67/cmg2/img/blog2.jpg" alt="pic" /> </a>[/icode] | |
Re: In order to submit variables to the second page, you'll have to find a way to get them inside of the form on the first page. On the first page, your form is empty, i.e. no variables actually make it in between the <form> and </form> tags. Use your loop … | |
Re: Not sure about the unique part, as a unique constraint will only support one null value in the column. It sounds like you potentially could have many. Use a check constraint to verify both aren't null: [code] ALTER TABLE TableA ADD CONSTRAINT CK_BothDepartsNotNull CHECK (departA IS NOT NULL OR departB … | |
Re: There are several ways to do this. Fortunately you at least have a primary key. Be smart and backup the database before attempting. Here's an example solution using a CTE: Create the test tables and populate: CREATE TABLE PassportTest( Id int not null ,Name varchar(25) not null ,IdentityNo1 char(5) null … | |
Re: The master database has a scalar function, fn_varbintohexstr, for this. Example: DECLARE @text varchar(256), @varbinary varbinary(256); SET @text = 'A1B2C3'; SET @varbinary = cast(@text as varbinary(256)); SELECT @text OriginalString , sys.fn_varbintohexstr(@varbinary) HexString /* returns nvarchar(max)*/ | |
Re: It's not pretty nor creative but is Valid XHTML 1.0 Strict: [code=html] <ol> <li style="font-size:24px"> <span style="font-size:12px">This text is 12px. The bullet number is 24px.</span> </li> <li> <span style="font-size:12px">This text is 12px. The bullet number is 12px.</span> </li> </ol> [/code] | |
| |
Re: This is pretty common for programmers new to php. We'll need to see more code. Are you using echo or print before the header? [URL="http://www.tech-recipes.com/php_programming_tips1489.html"]Here's[/URL] an article about the error. | |
Re: This article was written in 2007 but still applies: http://www.search-this.com/2007/03/12/no-margin-for-error/ Priceless information for anyone in CSS hell. | |
Re: Yeah, you probably don't want to limit yourself to web development. Either stick with CS or find something that involves security. My school had an Master in Information Systems and E-Commerce degree that was pretty close to what your looking for. | |
Re: JavaScript is executed by the browser on your local machine. JSP is executed by the server which hosts the site. So when you visit a page written in jsp, the server executes the jsp and then delivers the page across the internet connection to your browser. If any JavaScript is … | |
Re: Use the bit datatype for boolean. Valid values are 0 or 1. In the below example, Active is the bit column with a default value of 1 (true). [code=sql] CREATE TABLE ActiveUsers (UserId int NOT NULL, Active bit NOT NULL default 1) /*Register User*/ INSERT ActiveUsers (UserId) VALUES (123) --Whatever … | |
Re: I'm assuming by menu, that you mean a drop-down menu populated from a web application. Being a programmer, you'll have the tendency to perform iterations over result sets. This will perform very poorly when your row count gets higher. Save the iterations for after the db gives you back the … | |
Re: You can output to excel using OPENROWSET or bcp (with xp_cmdshell). | |
Re: Try this. I haven't tested it but it should do the trick. The key is to use the @ sign on line 2 to prevent the error message from showing up on the clients browser. Also, if you add or die(mysql_error()) to the end of line 2, the script will … | |
Re: Photoshop is the industry leader in photo editing. It's the program that almost every professional photographer uses. It's also great for editing images and exporting to the web. However, if you are looking to become a better web designer, you may find that Adobe Fireworks is what you are looking … | |
Re: An easy way to create an xls file from php is to create a tab delimited file with an xls extension. Here's an easy example. Create a folder named files and save the following php file in the same directory as the folder. [code=php]<?php $file="files/test.xls"; $f = fopen($file, "w+"); fwrite($f,"A1\tB1\t\nA2\tB2\tC2\t\n\t\tC3"); … | |
Re: Try modifying the following to pull from the table, rather than comparing the date variables: [code] DECLARE @intime DATETIME DECLARE @outime DATETIME DECLARE @time int--total seconds DECLARE @days int, @hours tinyint, @minutes tinyint, @seconds tinyint SET @intime = GETDATE() SET @outime = DATEADD(S, 3663, @intime) SET @time = DATEDIFF(S,@intime,@outime) SET … | |
Re: urtivedi has given you 2 good examples that will work. In SQL Server 2008, there's a 3rd option which utilizes the new [B]date[/B] datatype: [code] SELECT * from tablename where CAST(starttime AS date) = CAST(endtime AS date) [/code] [url]http://msdn.microsoft.com/en-us/library/ms186724.aspx#DateandTimeDataTypes[/url] | |
Re: What is the point of the routesequence?? You're just storing the same value twice... Also, each row should be unique, whether it be an identity on the id or a composite value. Rows 1 & 2 are duplicates, as are 6 & 7. This design violates first normal form, will … | |
Re: Post your connection string | |
Re: Here's a simple example of how to use output variables in stored procedures: [code] CREATE PROC dbo.ReturnString @string VARCHAR(500) ,@outputString VARCHAR(500) OUTPUT AS SET @outputString = @string GO [/code] Then to call the stored procedure, you'll want to declare a variable and assign the value like so: [code] DECLARE @output … | |
Re: This will work with 2008. With 2005 or earlier, you'll need to use datetime and the convert to varchar to strip the time portion off. [code] DECLARE @yesterday DATE SET @yesterday = DATEADD(D,-1,GETDATE()) [/code] | |
Re: You can't insert into 2 tables with one statement. You can grab the identity of the parent table and insert into the child table with 2 statements: [code] DECLARE @AppValId int INSERT Products (Item) VALUES ('Pepsi') SET @AppValId = @@IDENTITY INSERT ProductAttributes (ApplicationValueID,Attribute,Value) VALUES (@AppValId,'Price','2.99') [/code] | |
Re: Your subquery is returning multiple rows. This could be fixed with a join: [code] update ML set ML.rptprobtype = MD.[Problem Type] FROM tbl_M_MasterLogs ML JOIN tbl_rpt_MasterData MD ON ML.CaseNo = MD.CaseNo [/code] | |
Re: If your SQL Server is 2005 or greater, you can use EXCEPT and INTERSECT to find these. List email addresses that are in both Table1 and Table2: [code] SELECT email FROM Table1 INTERSECT SELECT email FROM Table2 [/code] List email addresses that are in Table1 but not in Table2: [code] … | |
Re: Use BETWEEN and cast the varchar to date: [code] select * from mytable where dtcreated BETWEEN CAST(fromdate AS DATE) and CAST(todate AS DATE) [/code] Edit: This works on SQL Server 2008 and up. Cast to datetime if you are using an earlier version. | |
Re: Assuming SQL Server 2005 +. The maintenance plan is typically an ssis package stored either in the database or on the file system. Yes, you can edit these packages just like any other SSIS package. Expand Management-> Maintenance Plans and double click the plan. The plan should open for editing. … | |
Re: It's not difficult if you are already familiar with SSIS. Having experience in .net development will be a big plus as well, as 2005 supports vb.net and 2008 supports both vb.net and c#. | |
Re: Defining the column as Identity, means that each value is unique and will never repeat. It is an identifier for the row. | |
Re: First, please use code blocks when posting code examples. Example: [noparse][code]--put your code here[/code][/noparse]. Second, you are using a cursor to loop through and populate dynamic sql. Cursors should be a last resort and the same goes for dynamic sql. This code will be a nightmare to maintain and debug. … | |
Re: There are many ways to export data: 1.) Export data wizard 2.) SSIS 3.) bcp utility 4.) clr stored procedure . . . It's all up to what you are comfortable with. | |
Re: See here: [url]http://sqlblog.com/blogs/peter_debetta/archive/2007/03/09/t-sql-urldecode.aspx[/url] You could also create a CLR function utilizing the HttpUtility.UrlDecode Method. | |
Re: The easiest way to bring the db back online would be to drop it then attach the db, specifying the correct data and log files. Dropping the db is key, because it will clear the db's info from the master and insure that your attachment will be clean. [code] ALTER … | |
Re: You have to declare the variable @letter and assign it a value: [code] DECLARE @letter CHAR(1) SET @letter = 'A' SELECT First_Name FROM dbo.Names WHERE First_Name LIKE '%' + @letter + '%' [/code] | |
Re: Use a GROUP BY with the HAVING clause. Haven't tested, but it should work. [code] select PREMISEADDRESS1 from PREMISE PREM inner join STATUS ST on PREM.LOCATIONID = ST.LOCATIONID inner join SUPPLIES SUP on ST.STOPID = SUP.STOPID group by PREMISADDRESS1 HAVING COUNT(SUP.ITEMID) > 10 [/code] [url]http://msdn.microsoft.com/en-us/library/ms180199.aspx[/url] | |
Re: Use [B]osql[/B]: Start->Run->cmd This will connect to the default instance on your local machine and return the instance information: osql -E -q "SELECT @@VERSION" [url]http://msdn.microsoft.com/en-us/library/aa213088%28v=sql.80%29.aspx[/url] | |
Re: Yes, you can install multiple instances of sql server on the same box without any issues. It's fairly common for developers to install Sql Server Express with Visual Studio and then later install a full version of Sql Server. | |
Re: Right click the connection manager and select properties. Scroll through the properties until you see Expressions. Add an expression for the Connection String property. [code="SSIS"]"C:\\filename " + (DT_WSTR,4)YEAR(@[System::StartTime]) + RIGHT("0" + (DT_WSTR,2)MONTH(@[System::StartTime]), 2) + RIGHT("0" + (DT_WSTR,2)DAY(@[System::StartTime]), 2) + ".csv"[/code] will return C:\filename 20110128.csv. The date in the filename will … | |
Re: Sql server is designed to be ran on a server, and that's why it says server name. It's the computer name. If you have multiple instances of sql server installed, then it will be computer name\instance name. Also, since the management studio and the database engine are both on the … | |
Re: The width and height are in the properties panel. Also, make sure you are viewing the reports in IE. I don't know why they can't make the reports cross browser compatible, but they won't render or export correctly in other browsers. | |
Re: If you have a good product and think it will make money, do what every other startup company does. Go to the bank, take out a loan, and buy the encoder on the idea that it will pay for itself. | |
Re: Well, lets see. Many users can be associated with a certificate and Many certificates can be associated with a user This is simply a many to many relationship. Here's a suggestion: [code] CREATE TABLE Users( userid int identity not null primary key, username varchar(25) unique not null ) CREATE TABLE … | |
Re: This logic is better placed in a stored procedure that can be called from the application. There is no reason to loop through a result set and send a sql command across the network for each individual update. [code=sql] UPDATE perclientreport SET Bill = (Extrausage * 1024)/100 WHERE Bill > … | |
Re: The database engine runs under a user context. You can open services (Start->run->services.msc) and scroll down to SQL Server (MSSQL Server). Note the user under 'Log On As'. This user must have permissions to that directory. | |
Re: [code]--This will tell you about error 8114 SELECT description FROM master..sysmessages WHERE error = 8114 AND severity = 16 AND msglangid = 1033 [/code] Try wrapping your code in try catch to get more details. Example: [code] BEGIN TRY --This will cause an error DECLARE @number int SET @number = … |
The End.