At last, i found it.
Click here to view the tutorial.
"Key column information is insufficient or incorrect. Too many rows were
affected by update."
SELECT col1, col2, count(*)
FROM t1
GROUP BY col1, col2
HAVING count(*) > 1
set rowcount 1
delete from t1
where col1=1 and col2=1
DECLARE @idoc int
DECLARE @doc varchar(1000);
Select @doc ='
<ROOT>
<Customer CustomerID="1" ContactName="John 1"/>
<Customer CustomerID="2" ContactName="John 2"/>
<Customer CustomerID="1" ContactName="John 3"/>
<Customer CustomerID="2" ContactName="John 4"/>
</ROOT>'
EXEC sp_xml_preparedocument @idoc OUTPUT, @doc
SELECT *
FROM OPENXML (@idoc, '/ROOT/Customer',1)
WITH (CustomerID varchar(10),
ContactName varchar(20))
EXEC sp_xml_removedocument @idoc
declare @objFSys int
declare @objFile int
declare @blnEndOfFile int
declare @strLine varchar(4000)
exec sp_OACreate 'Scripting.FileSystemObject', @objFSys out
-- Change the file path to the one that is passed to your stored procedure
exec sp_OAMethod @objFSys, 'OpenTextFile', @objFile out, 'C:\test.txt', 1
exec sp_OAMethod @objFile, 'AtEndOfStream', @blnEndOfFile out
while @blnEndOfFile=0 begin
exec sp_OAMethod @objFile, 'ReadLine', @strLine out
-- Here you got one line from the file
select @strLine
exec sp_OAMethod @objFile, 'AtEndOfStream', @blnEndOfFile out
end
exec sp_OADestroy @objFile
exec sp_OADestroy @objFSys
BEGIN
DECLARE @MyID AS BIGINT
DECLARE MyIDCursor CURSOR FOR
SELECT ID FROM MyTable
OPEN MyIDCursor
FETCH NEXT FROM MyIDCursor INTO @MyID
WHILE @@FETCH_STATUS=0 -- this is necessary to loop
BEGIN
-- print it out
print '@MyID'
print @MyID
-- to assign to the next value, without this, it will loops forever!
FETCH NEXT FROM MyIDCursor INTO @MyID
END
CLOSE MyIDCursor
DEALLOCATE MyIDCursor
END
Actually this method is not recommended, look here.
DECLARE @CrossRate as decimal(38,10)
DECLARE @ExchRate1 as decimal(38,10)
DECLARE @ExchRate2 as decimal(38,10)
SET @ExchRate1 = 1.3159643631
SET @ExchRate2 = 1.3663000000
SET @CrossRate = @ExchRate1/@ExchRate2
print '@ExchRate1: '
print @ExchRate1
print '@ExchRate2: '
print @ExchRate2
print '@CrossRate: '
print @CrossRate
And here's the result:@ExchRate1:
1.3159643631
@ExchRate2:
1.3663000000
@CrossRate:
0.9631590000
However for data type decimal (18,10), multiplication result of the two data types will give the same precision - decimal(18,10)."Exception: The request to read the property
HTMLDivElement.nodeType was denied, when calling method:
[nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>"
data: no]"
<param name=WMode value=Opaque>
fo.addParam("wmode", "opaque");
Ext.override(Ext.form.Field, {
hideItem :function(){
this.formItem.addClass('x-hide-' + this.hideMode);
},
showItem: function(){
this.formItem.removeClass('x-hide-' + this.hideMode);
},
setFieldLabel: function(text) {
var ct = this.el.findParent('div.x-form-item', 3, true);
var label = ct.first('label.x-form-item-label');
label.update(text);
}
});
<script type="text/javascript">
function prepopulate(reportType){
document.form1.report_view.options.length = 0;
if (reportType == "Pie_Chart" || reportType == "Bar_Graph"){
document.form1.report_view.options[0] = new Option("Adobe Reader (.pdf)","pdf");
document.form1.report_view.options[1] = new Option("Open Office (.odt)","odt");
}else{
document.form1.report_view.options[0] = new Option("Adobe Reader (.pdf)","pdf");
document.form1.report_view.options[1] = new Option("Microsoft Excel (.xls)","xls");
document.form1.report_view.options[2] = new Option("Open Office (.odt)","odt");
}
}
</script>
<select name="report_type" id = "report_type" onChange="javascript:prepopulate(this.value)">
<option value="Consolidated_Comments">Consolidated Comments</option>
<option value="Pie_Chart">Consolidated Result - Pie Chart</option>
<option value="Bar_Graph">Consolidated Result - Bar Graph</option>
<option value="Individual_Results_Comments">Individual Results (Comments)</option>
<option value="Individual_Results_FreeText">Individual Results (Free Text)</option>
<option value="List_of_Questions">List of Questions</option>
<option value="Individual_Comment">Individual Result</option>
</select>
<select name="report_view">
</select>
This is an example of what your text will look like.
• Tabs are converted to spaces.
• Quotes and other special characters are converted to HTML.
• Everything is enclose in HTML's 'pre' and 'code' tags.
• Style is set:
• Fixed width font.
• Shaded box.
• Dotted line border.