I have a SQL server / database locally and accessed through ip etc… What I want to know is how to send emails directly from the server (when n happens)? Answer You can use Database Mail. To send e-mails via SQL Server you can use the following stored procedure: sp_send_dbmail Or how to configure a SQL a…
Tag: sql
Parse SQL Server Data
I used SSIS and [SharePointListAdapters][1] [1]: http://sqlsrvintegrationsrv.codeplex.com/releases to import data from my SharePoint 2010 list and put it into SQL Server 2008 table. TThere are roughly 500 rows of data. Now the challenge is to parse data appropriately. I have a couple of columns that have html…
how to use like and between in where clause in same statement?
Im trying to find a set of results in a database based on dates. The dates are stored as varchars in the format dd/mm/yyyy hh:mm:ss. What i would like to do is search for all dates within a range of specified dates. For example i tried: Is something like this possible or is there a better way of doing this
SQL count(*) performance
I have a SQL table BookChapters with over 20 millions rows. It has a clustered primary key (bookChapterID) and doesn’t have any other keys or indexes. It takes miliseconds to run the following query However, it takes over 10 minutes when I change it like so or Why is that? How can I get select count(*) …
SQL set floating point precision
For a SQL int that is being converted to a float, how do I set the precision of the floating point number? This is the selection I would like to truncate to two or 3 decimal places: Thanks! Answer In TSQL, you can specify two different sizes for float, 24 or 53. This will set the precision to 7 or
Unexpected database output when using INNER JOIN
I have the following SQL query SELECT r.BEZEICHNUNG AS BEZEICHNUNG, r.ID AS ID, ra.BEZEICHNUNG AS raumBEZEICHNUNG, ra.ID AS raumID FROM RAUM r INNER JOIN RAZUORDNUNG rz …
PDO Exception Questions – How to Catch Them
I’m using PDO to re-write a website interface for a database. I used to use the mysql extension, but I had never bothered with error handling, and the few error handlers I had were basically copy-paste. Now I’d like to do this right. However, I’m having issues catching the errors how I’…
how can i set the parameters for the sql query optional?
I build a Web Service in ASP.Net which sends me a list of rooms. The parameters are id’s which are separated by a comma. I saved them to a string and build a sql select query. When I send all 4 parameters I everything works fine and I get a result. But when I send less then 4 I get
Data flow task executing successfully but not writing any rows to Excel file
I am working on SSIS package that is fetching data from SQL server and inserting into Excel file… in Data Flow Task i’ve used OLE Db source and Excel destination. After configuring OLE Db source i can preview the resulting row and even data flow task executing successfully without giving any error…
how to cast datetime2 as datetime
I’m trying to convert datetime2 to datetime in order to create a standard between different sources using only SQL or SSIS Take the following SQL query as example: SELECT CAST(offer_start_date AS …