在过去的几个月中,我不得不将'null'字段替换为'0'到查询返回的每一列.
节省了大量的时间(其中一些返回了大量的列)我一直在使用以下内容,然后将相关列的结果粘贴到一个新的查询中:
select ', isnull(' + COLUMN_NAME + ', 0)' + ' as ' + COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME = 'summary_by_scca_sales_category '
and TABLE_SCHEMA = 'property''
Run Code Online (Sandbox Code Playgroud)
基本上我想知道是否有更好的方法可以做到这一点?理想情况下,我可以自动将isnull应用于查询中返回的所有列(不使用两个查询).
例如:
我想采取如下查询:
select *
from tablename
Run Code Online (Sandbox Code Playgroud)
并且对于*返回的每个列,将null结果替换为0,而不必为每列写入isnull()行.
编辑:
将以一种观点来实现这一点(doh,应该想到这一点).对于兴趣/教育,有没有办法用代码做这样的事情呢?
当我尝试通过 PowerShell 部署项目时,PS继续执行“Enable-SPFeature”操作,然后打印以下错误消息:
Enable-SPFeature :该页面的安全验证无效。单击 Web 浏览器中的“返回”,刷新页面,然后重试操作。在 E:\Demo\DemoProject\DemoProject\scripts\utility.ps1:315 char:19 + Enable-SPFeature <<<< -identity $id -url $url -confirm:$false + CategoryInfo : InvalidData: (Microsoft.Share ...etEnableFeature:SPCmdletEnableFeature) [Enable-SPFeature], SPException + ExcellentQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletEnableFeature
谁能提供解决方案吗?
powershell sharepoint sharepoint-2007 sharepoint-2010 sharepoint-2013
在我的下面的代码中,为每个间隔设置滚动DIV的功能,当我尝试向上滚动时由于间隔刷新滚动条再次下降.
我的代码:
var int = self.setInterval("f2()", 1000);
function f2() {
var objDiv = document.getElementById("messages2");
objDiv.scrollTop = objDiv.scrollHeight;
}
Run Code Online (Sandbox Code Playgroud)
现在,通过使用onscrollDIV的属性,当用鼠标按住滚动条时,无论如何都要停止向下滚动?
就像是
var int = self.setInterval("f2()", 1000);
function f2() {
var objDiv = document.getElementById("messages2");
// if(objDiv.onscroll) i.e. when the particular DIV's scroll bar is on hold by cursor.
{
return false;
}
else
{
objDiv.scrollTop = objDiv.scrollHeight;
}
}
Run Code Online (Sandbox Code Playgroud)
如果可以实现上述类型的功能,请更正其语法.我是JavaScript的新手.
提前致谢..!
我有一个列以全名格式存储数据,例如:
汤姆史密斯
安德鲁史密斯
是否有一个函数(或函数的组合),我可以使用它将其转换为以下内容:
T.史密斯
A.史密斯
检查此代码:
<?php
$url = 'http://www.example.com/downloads/count.txt';
$hit_count = @file_get_contents($url);
$hit_count++;
@file_put_contents($url, $hit_count);
header('Location: wmwc.zip');
?>
Run Code Online (Sandbox Code Playgroud)
@file_get_contents工作正常,标题位置更改为下载的文件也可以,但是hit_count增加或@file_put_contents不起作用,因为文件的数量不会增加1.我已将文件权限设置为777,但是当我尝试将目录权限设置为777我也得到500内部服务器错误说"服务器遇到意外情况,导致无法完成请求".
我正在尝试使用今天的日期并找到未来 x 天的日期。例如,我想找到 30 天后的日期 - 我应该考虑使用哪个库来实现此目的?
我有以下内容:
var contents = new[]
{
"Theme Gallery", "Converted Forms", "Page Output Cache", "Master Page",
"(no title)", ".css", ".xml", ".wsp", ".jpg", ".png", ".master"
, ".000" , "Page Output Cache" , "_catalogs", "Style Library", "Cache Profiles"
};
string fileUrl = siteCollectionEntity.Url + '/' + item.Url;
Run Code Online (Sandbox Code Playgroud)
我想编写一个声明,如果URL包含内容中找到的任何单词,将阻止循环继续.请注意以下不良语法,但我认为这将有助于更好地解释我正在尝试做什么...基本上类似于以下内容:
if (fileUrl.Contains(contents)) continue;
Run Code Online (Sandbox Code Playgroud)
这样的事情可能吗?
在tSQL中有一个名为isnull()的小函数,它具有以下功能:
ISNULL ( check_expression , replacement_value )
Run Code Online (Sandbox Code Playgroud)
我知道PHP中的is_null(),但它不一样.我还缺少另一种功能吗?
我可以看到它在像这样的情况下有用(假设这里的isnull()与tSQL一样):
die("Function does not exist" . isnull($_POST['function'], ". No function was specified"));
Run Code Online (Sandbox Code Playgroud) 我正在尝试声明一个具有许多已经定义的元素的数组(这点是为了简化代码维护).我不确定我的问题是什么,但这是我到目前为止所做的:
var coefficients = new array( 'AgeAtDiagnosis' : 0.0068313 ,
'TransformedMelaNomaThickness' : 1.829936 ,
'MelanomaThickness' : 0.0377696 ,
'Ulceration' : 0.3779279 ,
'Metastasis' : 1.063668 ,
'LymphNodes' : 0.7789897);
Run Code Online (Sandbox Code Playgroud)
为了更好地解释,这是我正在尝试实现的PHP版本:
var coefficients = new array( 'AgeAtDiagnosis' => 0.0068313 ,
'TransformedMelaNomaThickness' => 1.829936 ,
'MelanomaThickness' => 0.0377696 ,
'Ulceration' => 0.3779279 ,
'Metastasis' => 1.063668 ,
'LymphNodes' => 0.7789897);
Run Code Online (Sandbox Code Playgroud)
如何在JavaScript中解决此问题?
我正在尝试设计一个jsp页面,我可以在其中发送电子邮件,但是在核心java中正确运行的代码在jsp代码中使用时会给我异常.我相信我已经将我的mail.jar妥善放入了lib.
当前的jsp代码是:
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<%@ page import="java.util.Properties" %>
<%@ page import="javax.mail.Message" %>
<%@ page import="javax.mail.MessagingException" %>
<%@ page import="javax.mail.PasswordAuthentication" %>
<%@ page import="javax.mail.Session" %>
<%@ page import="javax.mail.Transport" %>
<%@ page import="javax.mail.internet.InternetAddress" %>
<%@ page import="javax.mail.internet.MimeMessage" %>
<%
Properties props = new Properties();
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
Session.getDefaultInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("prakash.d2222","**************");
} …Run Code Online (Sandbox Code Playgroud) c# ×2
javascript ×2
php ×2
sql ×2
t-sql ×2
.net ×1
arrays ×1
date ×1
email ×1
java ×1
jsp ×1
powershell ×1
scrollbar ×1
sharepoint ×1
sql-server ×1