I have a job that we wrote in SQL 2000 that loops through and finds all the orders pending verification and distributes them via emal to 100+ sales people every night. Each email is sent to the individual sales rep. I did this using sp_makewebtask and attaching the html file to an email and using a WHILE statement to loop thorugh all pending entries in sql.
I recently learned that sp_makewebtask is not going to be around for the next release and that I should use RSS for all future development.
Question: How can I achieve the same result outlined above using RS? How can I dynamically create and distribute HTML files?
I know that RS is xml based, but some pointer on how/where to start would be much appreciated.
In my application (developed in asp.net 1.1), I am going to implement the Cache dependency mechanism. I want to automatically invalidate the Cache object, once any manipulations done on a particular table in SQL Server.
My application and DB is running in different system. I found in one of the site, to create a trigger on the table which in tern calls the sp_makewebtask System stored procedure and write output of the query into a file.
EXEC sp_makewebtask @outputfile = 'c: estcache.txt'@query = 'select top 1 Problem_Category_Code from SMD_Problem_Category'
But the 'C: estcache.txt' is pointing the local system in which SQL is running. I want to write a file which is available in remote system. I shared a folder from the system and made a mapped drive in the SQL system. (as z: drive)
I used the statements as : @outputfile = 'Z: estcache.txt' also as @outputfile = '\10.160.1.4wc estcache.txt'
But in both the cases I got the error as: Msg 16821, Level 11, State 1, Procedure sp_makewebtask, Line 131SQL Web Assistant: Could not open the output file.
But in one site it is mentioned that, we can use the UNC name if we want to write file in remote system. How can I run the SP?
Can anyone please help me to solve this problem?
I need some swift reply on this issue, as it is very urgent for me.
using SQL 6.5 sp_makewebtask in a stored procedure I want to create a press-info file. My query calls four fields, a datum field, two varchar fields and a text field, it's the field "PrText" in my example:
EXEC sp_makewebtask @outputfile='F:EntwicklungRedaktionZeitwenden27.ht m', @query='SELECT Datum, Ort, Headline, PrText FROM news WHERE ID = 27', @templatefile='F:EntwicklungRedaktionZeitwendenTem plates.htm'
My question: Am I limited to 255 characters in this case? After 255 characters the text is cut off and I have only a truncated text fragment.
Is there a possibility to get the whole text without using @blobfmt (I don't want to use this parameter because I want to have the datum data, the varchar headline AND the text in ONE HTML-file.)
I have tried the same as dynamic query in ASP where I have no problem to get the whole content of the text field, but I want to create a static file because this information will be read often, but won't be updated frequently and I don't want to charge the server resources to much.
Has anybody an idea? Any help would be appreciated.
I have a question about using FOR XML and sp_makewebtask. This (see below) is a simplified example where I have a table with 3 columns, the two first columns hold varius data and the third column (Subdata3) holds duplicated data.
My question is: Is it possible to transform the hierachy of data (see "Prefered XML output" for details) when transforming from SQL to XML using either FOR XML EXPLICIT or by using some sort of more advanced sp_makewebtask template (or some other technique perhaps)? And if, how? Any help welcome!
Cheers, Christian
----------------------
--- sp_makewebtask --- EXEC sp_makewebtask @outputfile = c: empoutput.xml, @query = 'SELECT Subdata1, Subdata2, Subdata3 FROM Data WHERE Subdata3 = X FOR XML AUTO, ELEMENTS', @templatefile ='c: emp emplate.tpl'
I've got a SQL Server hardware Replacement to do. This server has a merge replication setup on it which was setup by a contractor.
Do i have to do the configurations manually when moving the replication bits across two servers or is there a different process involved ? I am just not sure how to approach this.
Hello all, I get some dates entered manually in french format in a varchar(255) field and want to convert that field in datetime. Since, Enterprise manager is warning me about a risk to loose information, I'm thinking about a way to update the french text in the corresponding english text before doing the conversion. Example: 25-fév-08 (varchar(255)) has to become 25-feb-08 (datetime)
Dear all,I need some help from all my Transact SQL Guru friends out there..Here is the scenario in its most simplified form.. ..I have two tables.. A(Lookup table) and B(Transaction Table)TableA FieldsEmployeeLocationIDEmployeeLocation (This could have values say"B","BO","BOM","C","CA","CALC") etc...TableB FieldsEmployeeIDEmployeeName.......EmployeeLocationID (will have null initially when rows are populatedfirst time)EmployeeLocation (This could have values"BA123","BOMBAY","BOTS123","BRACK".... etc)I hope you get where I am leading this to, from my examples..Requirement is to populate the EmployeeLocationID in Table B withEmployeeLocationID from TableA by matching the field EmployeeLocationin both tables.Please note that table B's EmployeeLocation could be A'sEmployeeLocation + some additionalcodes like "123","RACK" etc in theabove example...Therefore, this is what I had wrote initially..update Bset B.EmployeeLocationID =A.EmployeeLocationID
Help, I have a vendor file with the vendors name. I need to add afield that has alternate captionseg. :In my vendor file I have records for AT&T with three differentnames/spellings for AT&T.AT&TLucent TechnologiesA T & TI want to add a new field that would have AT&T for the above records.I know I could hardcode a queryUpdate F_VENDORSet VENDOR_CAPTION_ALT = 'AT&T'where VENDOR_CAPTION like '%Lucent%' orVENDOR_CAPTION like '%A T & T%'however, how can I use another table that has the my search keywordsfor the "like" and the replacement captions so I dont need literalqueries to update all the diffent vendors?I have identified 96 instances of where I want to have an alternativename that I can use for a type of grouping. This gets really wildwith the military such as Army and Navy.TIARob
In the BOL, it states to replace DB_ID() with a valid database name when the compatibility level is 80 or below.
The original statement is:
SELECT object_id AS objectid, index_id AS indexid, partition_number AS partitionnum, avg_fragmentation_in_percent AS frag INTO #work_to_do FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL , NULL, 'LIMITED') WHERE avg_fragmentation_in_percent > 10.0 AND index_id > 0;
In VS 2003 I used SQLDMO (Com Object) to list all available SQL Servers. Is in SQL Server 2005 a managed .net Component that can do that task?Thanks,Rainer.
Been meaning to post this for a while. It does a very limited job of only allowing [0-9], but could be extended to allow negative numbers, or numeric values that are suitable for numeric types other than INT, but avoiding the pitfalls of IsNumeric() which might allow through data not suitable for some of the numeric datatypes
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[kk_fn_UTIL_IsINT]') AND xtype IN (N'FN', N'IF', N'TF')) DROP FUNCTION dbo.kk_fn_UTIL_IsINT GO CREATE FUNCTION dbo.kk_fn_UTIL_IsINT ( -- String to be tested - Must only contain [0-9], any spaces are trimmed @strINTvarchar(8000) ) RETURNS int-- NULL = Bad INT encountered, else cleanedup INT returned /* WITH ENCRYPTION */ AS /* * kk_fn_UTIL_IsINTCheck that a String is a valid INT *SELECT dbo.kk_fn_UTIL_IsINT(MyINTColumn) *IF dbo.kk_fn_UTIL_IsINT(MyINTColumn) IS NULL ... Bad INT * * Returns: * *int valueValid integer *NULLBad parameter passed * * HISTORY: * * 30-Sep-2005 Started */ BEGIN
DECLARE@intValueint
SELECT@strINT = LTRIM(RTRIM(@strINT)), @intValue = CASE WHEN @strINT NOT LIKE '%[^0-9]%' THEN CONVERT(int, @strINT) ELSE NULL END RETURN @intValue
shailendra writes "Hi,everbody lets come to my problem.I have one variable of type "ntext" which contain character "". i want to remove it or replace it with a blank character.
Hi,It seems to be simple, however, it stumbles me.how to replace all the double quotes (") within the followingsentence (or a column) with single quotes ('),colA = this is a freaking "silly" thing to dointocolA this is a freaking 'silly' thing to doSelect Replace(colA,'"',''')[color=blue]>From tblXYZ[/color]won't work,Select Replace(colA,'"',"'")[color=blue]>From tblXYZ[/color]won't work neither.How come? Thanks.
Just wondering if anyone has any suggestions for a replacement for Access Forms once I move the tables etc to SQL 2005? Does SQL 2005 have any form building functionality like Access?
I'd like to change in order to improve the maintenance of our packages. I've got lots of packages running with values such as "path" and "filename" inside variables.
With this discussion here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=70328 I started to thinkn about Microsoft really calculated checksum value.
This code is 100% compatible with MS original. That is, the result is identical. You can use it "as is", or you can use it to see that MS function does not produce that unique values one could expect.
With text/varchar/image data, call with SELECT BINARY_CHECKSUM('abcdefghijklmnop'), dbo.fnPesoBinaryChecksum('abcdefghijklmnop') With integer data, call with SELECT BINARY_CHECKSUM(123), dbo.fnPesoBinaryChecksum(CAST(123 AS VARBINARY)) I haven't figured out how to calculate checksum for integers greater than 255 yet.CREATE FUNCTION dbo.fnPesoBinaryChecksum ( @Data IMAGE ) RETURNS INT AS
BEGIN DECLARE@Index INT, @MaxIndex INT, @SUM BIGINT, @Overflow TINYINT
IF @SUM > 2147483647 SELECT @SUM = @SUM - 4294967296
RETURN @SUM ENDActually this is an improvement of MS function, since it accepts TEXT and IMAGE data.CREATE FUNCTION dbo.fnPesoTextChecksum ( @Data TEXT ) RETURNS INT AS
BEGIN DECLARE@Index INT, @MaxIndex INT, @SUM BIGINT, @Overflow TINYINT
Hi everyone, I have some code that we need to migrate to SQL Server2005 from 2000, and I have a webpage that upon viewing, fires a queryto the SQL server using ISS and ISAPI. The result set is formatted fordisplay using XSLT. But since ISAPI is deprecated in SQL 2005, I waswondering how to migrate this.Thanks,
i'm using an excel source where i get my excel rows using a query, I'd like to replace possible null values with some other data(a zero value or a empty string for example), that's because i'm performing a transformation into a sql server table wich doesn't accept null values for some columns.
Is there any function to convert a null value to another one? I used the sql server's CASE function, but it didn't work. Any suggestions?
INSERT INTO #Tab (Data) Select 'Apple=5,Orange=10,Banana=11' UNION ALL Select 'Apple=10,Orange=1033,Banana=0' UNION ALL Select 'Apple = 120,Orange = 1,Banana = 112' Select * from #Tab
How do I replace every value before the '=' but leave the comma.
Here is what the final output should look like
CREATE TABLE #TabFinal (Data Varchar(100))
INSERT INTO #TabFinal (Data) Select 'Apple,Orange,Banana' UNION ALL Select 'Apple,Orange,Banana' UNION ALL Select 'Apple,Orange,Banana'
Subject says it all, really. I want to start using Token Replacement,but do I break anything by enabling it? Do jobs that don't use tokensrequire any changes? I saw somewhere that it can't be turned off, soI'm paranoid about enabling it. Anything that I should be aware of?Many thanks.
Any advice that can be offered on this subject would be much appreciated.
We are debating whether to backup/restore the replicated databases or simply copy the mdf and ldf files accross and Attach them. The question is whether the replication information is retained for the publshed objects when the files are copied across? Alernatively, must we use backup/restore with KEEP_REPLICATION set for the restore?
We also plan to back up and restore the distribution, publication, master, msdb etc databases as well as rename the SQL Server to have the same name as the original.
Do these things need to happen in any particular order?
Does the timing of the renaming of the SQL Server matter?
At least some of the these operations (restoring the master database and renaming the SQL Server) need to be done in single user mode. Is is best to restore all the system databases in single user mode?
Lastly, is it necsssary (from a SQL Server point of viewpoint) to rename the computer to have the same name as the SQL Server?
I have a small client installable web application which used to work great on 32 bit machines. Well now clients are starting to use x64 Windows 2003 servers and things have begun to unravel. W2K3 x64 does not have any of the JET database drivers needed to communicate to the Access databases and it doesn't look like they're coming anytime soon.
Is SQL Server Express the new replacement for Access databases on x64 machines. Does Microsoft intend on moving some of the JET drivers over from 32 bit servers. I know that you can run IIS in 32 bit mode and everything is fine, but I can't ask everyone to do that.
Is SQL Server Express something that I can expect people to have installed, it sure doesn't sounds like it. After reading some posts, it sounds like it's a bit of a hastle to install.
I am trying to get details out of targetinstance from a WMI alert, using Token Replacement in the job step.
The alert fires properly.
The WQL query for the alert is:
select * from __InstanceModificationEvent within 300 where targetinstance ISA 'Win32_LogicalDisk' and TargetInstance.DriveType = 3 and TargetInstance.Freespace < 44832876928
However, I can't get the WMI info out from the alert - everything I've read says it's within TargetInstance, but I don't see how to use the WMI call for it. I'm specifically looking for DeviceID In the job step, I've tried multiple variations. Only the __CLASS has worked, and that's because it's not within TargetInstance.Â
set @mybody = '$(ESCAPE_SQUOTE(WMI(DeviceID)))' set @mybody = '$(ESCAPE_SQUOTE(WMI(TargetInstanceDeviceID)))' set @mybody = '$(ESCAPE_SQUOTE(WMI(__CLASS)))' set @mybody = '$(ESCAPE_SQUOTE(WMI(TargetInstance.DeviceID)))'
I'm looking to replace text in a given column given a set of conditions in the other columns. Please see below the M query in the advance editor and in particular the bold text. Here I've created a new entry that would appear in the query applied steps window in the power query editor that I have called "Replace Values". The logic is if Data.Column4 column equals "London" then replace null values in Data.Column5 with London. However when I save the query below I get the errorÂ
Expression.Error: There is an unknown identifier. Did you use the [field] shorthand for a _[field] outside of an 'each' expression?
I plan to change the expression to test for multiple conditions however I need to get the basic expression working first. The other frustration i had with the "if" statement is it had to have an else even though I didn't require it, am i doing something wrong here?
let FullFilePath = "C:PermanentDwellings.xlsx", Source = Excel.Workbook(File.Contents(FullFilePath)), Â Â #"Expanded Data" = Table.ExpandTableColumn(Source, "Data", {"Column1", "Column10", "Column11", "Column12", "Column13", "Column14", "Column15", "Column16",