Answer Questions
pu132 Is it possible to send email within an sp or sql statement?
Hi guys Is there anyway to fire an email from within sp - of course base on conditon. say I write: declare @emailaddr varchar ( 4000 ) set @emailaddr = 'whatever@me.com' if not exists( select a, b from C group by a, b having count (*)> 1 ) begin ********** -- fire the email to @emailaddress Is there an sp or a way to send email Thanks yes, you can use xp_sendmail or in 2005 you can use sp_send_dbmail Look up the usage and how to set it up in BOL Denis the SQL Menace http://sqlservercode.blogspot.com/ Thanks Denise, will try that:) ...Show All
GPK2005 To get accuracy in DATEDIFF
Hi, My problem is the following query returns just -1 SELECT DATEDIFF(YEAR,N'03/31/07',N'01/30/06') I need it to say -1.02 or whatever the correct result is I tried CAST and CONVERT but no use. Any clue Thanks, Fahad Get the difference in months or days and try. SELECT DATEDIFF ( M , N '03/31/07' , N '01/30/06' ) / 12.0 ...Show All
chanmy8 Help with complicated splitting and inserting
Ok, I don't come here unless for desperation since my head is splitting thinking about this and not knowing SQL enough to so something this hidious, I need some help! Being a C# developer and NOT a DBA, I'm about to blow my head off. Excuse my french but it's a bad day when I have to do crap like this that should have been designed right the first time :). Ok, bear with me. Story : We have a Product table. Stupidly, before I was here at this company, in the product table we have a ProductDescription. In the product Description, there is HTML and text. the HTML contains the actual child ProductIDs that are related to the product record. Yea, and so here it goes. Goal : Split out the pr ...Show All
Bill Reiss Database question
Hello I am using visual Basic 2005 express. The program I am working on uses a database called DMGCollectionDatabase.mdf which will be held locally on the computer the program is installed on When I publish my program as a cddvd install I get a setup file some other files and in the datasets folder I get a DMGCollectionDatabase.mdf.deploy file if i install this program on a different computer than the one I used to build it it saves all the database information somewhere no clue where. what I need to be able to do is get the program to write to the DMGCollectionDatabase.mdf database so users can save this file with there information the dmg database will become portable my whole issue is how do I make this happen (I read one po ...Show All
MylesRip Drives in a cluster environment
Hi, I have a SAN and configuring a cluster on SQL 2005. I initially created a Quorum drive when setting up the cluster and now added 4 more drives to the physical node but when I try to install SQL that drive cannot be located. Do we need to create all the drives when installing the cluster or what is the way to add the drives later on. Thanks Anup Thanks All. With some troubleshooting and tips from this forums the cluster is up and running with SQL 2005. However I do not understand whi we need a seperate drive for MSDTC cant we share the quorum drive to do this. Can you explain how to size this like perf issues, disks needed etc. Thanks No, one DTC per cluster. It is shared with everyth ...Show All
KC416 Understanding 'Nested join' syntax
I just came across of a query that has a syntax that is new for me: SELECT BridgeOrganizationStructure . ParentOrganizationCode , DimEmployeeOrganization . Emp_FName , DimEmployeeOrganization . Emp_LName , BridgeOrganizationStructure . SubsidiaryOrganizationCode , BridgeOrganizationStructure . LevelFromParent , FactAttempt . ActivityFK , FactAttempt . CurrentAttemptInd , FactAttempt . AttemptStartDt , DimActivity . Activity_PK FROM DimActivity INNER JOIN FactAttempt ON DimActivity . Activity_PK = FactAttempt . ActivityFK AND ( DimActivity . Activity_PK = 55 ) AND ( FactAttempt . CurrentAttemptInd = 1 ) RIGHT OUTER JOIN BridgeOrganizationStructure ...Show All
Littletommy Have Stored Procedure with input parameters and want to Use Spreadsheet
I have a stored procedure that is able to ultimately do an create a temp table and insert into another table. I'm trying to figure out how I could execute the stored procedure that would get it's input parameters from a spreadsheet rather than execute it line by line. Can anyone suggest anything CREATE PROCEDURE osp_xmlSvc_UpdateItemAttribute @PartNumber varchar ( 50 ) = '' , @Rev varchar ( 50 ) = '' , @AttributeName varchar ( 256 ) = '' , @AttributeValue varchar ( 1024 ) = '' , @EditSource varchar ( 255 ) = '' , @UserName varchar ( 50 ) = 'admin' , @ReturnState int = 0 Output WITH ENCRYPTION AS DECLARE @ItemID int DECLARE @RevID int DECLARE @As ...Show All
vladb Strange package startup/execution slowdown
We seem to be having a rather strange issue. We just finished migrating from 2000 to 2005. I've been working on converting packages from DTS to SSIS. Everything has been going well in testing, but a problem has shown up going into production. The first package I deployed ran significantly slower on the production server, going from about 7 seconds to 90 seconds. The production server is much more powerful, so this was rather confusing. The major difference is that the server is running 64 bit. After searching around, I haven't found much that is helpful. To test things out, I created a blank package that does absolutely nothing. All it contains is a single connection manager (OLE DB). Executing this package takes 45 seconds. ...Show All
buster2001 Pattern matching with multiple values
I want to check for multiple patterns in a particular column. For one pattern I can write e.g. SELECT * FROM <TablName> WHERE ColumnName LIKE '%abcd%'. My requirment is to select all rows for which column value matches with many patterns.I will fetch the patterns in a subquery e.g. (SELECT '%'+name+'%' FROM <TableName>) Any thoughts Thanks for your solution ! Thnx. Shallu.....That is correct syntax, but you need to see that the number of values is not static and all of them are stored as one parameter by ssrs. To simplify it for you, say SSRS is providing me with a string series like " '%val2%', '%val2%' ,'%val2%' ...". Now I need to use ...Show All
CodemasterMM SSIS Higher Level Edition error when run in a Sql Job
Hi, I am receiving the following error in Sql Job agent when I try to run an SSIS package : The task "Create Excel File" cannot run on this edition of Integration Services. It requires a higher level edition. It then goes on to tell me : The Execution method succeeded, but the number of errors raised (2) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. I have tried reseting the error count to allow for the "errors" , but it stills fails. The job suceeds in Visual Studio, but not when scheduled in Sql Management Studio. Any suggestions Thanks, J. Please review this document as well: http:// ...Show All
Chris Aus Need help in copying a temp tables contents to a existing table
I have a real table with an identity column and a trigger to populate this column. I need to import / massage data for data loads from a different format, so I have a temp table defined that contains only the columns that are represented in the data file so I can bulk insert. I then alter this table to add all the other columns so that it reflects all the columns in the real table. I then populate all the values so that this contains the data I need. I then want to insert into the real table pushing the data from the temp table, however this gives me errors stating that the query returned multiple rows. I specified all the columns in the insert grouping as well as on the select from the temp table. ANY thoughts / comments ar ...Show All
CalinMac Performance issues after migrations
We have migrated several systems from SQL 2000 to 2005. In some cases we have gone from 32 to 64 bit. In all cases we have improved chip speed and memory. In all cases the db compatibility mode has been set to 90. What I have noticed in all cases is an increase in CPU utilization under SQL 2005. One system went from a 4 way 32-bit system averaging around 40% under load to a 4-way x64 system running at 100% under load. On this system we had to set the parallelism to 2 on the server to get the CPU % under control. Granted we have a lot of code revision to do, but I don't understand why the same code would perform so much worse on superior hardware and a new version of SQL. This is hindering my consolidation plans and not making me loo ...Show All
Yuki Chen Can't install Report Builder from a ClickOnce application from Intranet
Can't install Report Builder from a ClickOnce application from Intranet. Error message received is "Cannot Start Application. Application download did not succeed. Check your network connection, or contact your System Administrator or network service provider". When I click on the link it looks as if it is downloading the application and then I get the error message. I have removed my personal firewall, verified my IE settings with another who can access and download the application. I even had that person log on to my machine and try to download it (thinking it may have been an ID thing but they got the same error message I did). The error message in the log file is: - The remote server returned an error: (400) Bad Request. ...Show All
Xelestial Release of 1.0 product
I can't find any timeframe for the 1.0 release of SQL Server Everywhere. Is this information available Hi Matt, The SQL Server Everywhere will be released in mid of Dec this year. Thanks We will maintain the compatibility between CTP version and the RTW (released) version. There will some bug fixes in the RTW version compared to CTP. You can always upgrade from CTP to RTW. Only thing would be to uninstall the CTP version and install the RTW, all things will work fine. Thanks Sachin That's very helpful! I wonder if I could ask one other question... If we were to utilize the current CTM version in shrink-wrapped software and later upgrade the Dlls (we have online updates in our ...Show All
Leon94 Configuration Order
I am trying to use the SQL Agent to specify the connection properties of the connection manager that supports all of the other SQL Configurations in my packages. It would appear that configuration files specified in the SQL agent job are applied after the other configurations. I have the same package I want to use under different configurations on the same machine. This package is also portable across to other machines. so cannot have any location information embedded in the package. Does anyone have a solution for this I had started out using Parent Package configuration until I discovered that small issue. I now have an XML configuration file, which is working fine. However I would like to hav ...Show All
