我正在简化复杂的select语句,所以我想我会使用常用的表表达式.
声明一个cte工作正常.
WITH cte1 AS (
SELECT * from cdr.Location
)
select * from cte1
Run Code Online (Sandbox Code Playgroud)
是否可以在同一个SELECT中声明和使用多个cte?
即这个sql给出了一个错误
WITH cte1 as (
SELECT * from cdr.Location
)
WITH cte2 as (
SELECT * from cdr.Location
)
select * from cte1
union
select * from cte2
Run Code Online (Sandbox Code Playgroud)
错误是
Msg 156, Level 15, State 1, Line 7
Incorrect syntax near the keyword 'WITH'.
Msg 319, Level 15, State 1, Line 7
Incorrect syntax near the keyword 'with'. If this statement is a common table …
Run Code Online (Sandbox Code Playgroud) sql t-sql sql-server common-table-expression sql-server-2008
当您点击F5时,会弹出浏览器窗口,如何设置调试器在Visual Studio 2008中使用哪个浏览器?
更新1
我找了'浏览'选项但没找到它.
Visual Studio打开默认浏览器而不是Internet Explorer
更新2
如果您已经在调试,则没有"浏览方式"选项.
更新3
下面接受的答案也与在Visual Studio 2010中更改默认浏览器以进行调试有关.
我想打印一个SQL Server数据库图表.我正在使用SQL Server Management Studio,我右键单击图表,然后选择"查看分页符".
我希望有A3格式的图表,但当我尝试打印它有4页.有没有办法在一个页面中打印整个图表?
在SQL Server Management Studio中运行以下查询会给出以下错误.
update table_name set is_active = 0 where id = 3
Run Code Online (Sandbox Code Playgroud)
当前命令发生严重错误.结果(如果有的话)应该被丢弃.
我已经在数据库中的其他几个表上尝试了相同的更新语句,它们工作正常.
DBCC CHECKTABLE('table_name');
Run Code Online (Sandbox Code Playgroud)
给
DBCC results for 'table_name'.
There are 13 rows in 1 pages for object "table_name".
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Run Code Online (Sandbox Code Playgroud) 我正在编写一个PowerShell v2脚本,我想对远程服务器运行.当我运行它时,我收到错误:
连接到远程服务器失败,并显示以下错误消息:WinRM客户端无法处理该请求.当前在客户端配置中禁用了未加密的流量.更改客户端配置并再次尝试请求.有关详细信息,请参阅about_ Remote_Troubleshooting帮助主题.
我查看了有关_ Remote_Troubleshooting的在线帮助,但它没有指出如何启用未加密的流量.下面是我正在使用的脚本导致我出现问题.
注意:我已经在远程计算机上运行Enable-PSRemoting以允许它接受传入的请求.
我试图使用会话选项变量,但它似乎没有任何区别.
$key = "HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds"
Set-ItemProperty $key ConsolePrompting True
$tvar = "password"
$password = ConvertTo-SecureString -string $tvar -asPlainText –force
$username="domain\username"
$mySessionOption = New-PSSessionOption -NoEncryption
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
invoke-command -filepath C:\scripts\RemoteScript.ps1 -sessionoption $mySessionOption -authentication digest -credential $credential -computername RemoteServer
Run Code Online (Sandbox Code Playgroud)
如何启用未加密的流量?
我有一个Web服务,在一个环境中工作正常但在另一个环境中没有.
Web服务从SharePoint获取文档元数据,它在我无法调试的服务器上运行但是通过日志记录我确认该方法成功进入和退出.
可能是错误的原因是什么?
错误消息是,
The formatter threw an exception while trying to deserialize the message:
There was an error while trying to deserialize parameter http://CompanyName.com.au/ProjectName:GetDocumentMetaDataResponse.
The InnerException message was 'Error in line 1 position 388. 'Element' 'CustomFields' from namespace 'http://CompanyName.com.au/ProjectName' is not expected.
Expecting element 'Id'.'. Please see InnerException for more details.
Run Code Online (Sandbox Code Playgroud)
InnerException是
捕获到System.ServiceModel.Dispatcher.NetDispatcherFaultException消息="格式化程序在尝试反序列化消息时引发异常:尝试反序列化参数http://CompanyName.com.au/ProjectName:GetDocumentMetaDataResponse时出错.
InnerException消息是
'Error in line 1 position 388.
'Element' 'CustomFields'
from namespace 'http://CompanyName.com.au/ProjectName' is not expected.
Expecting element 'Id'.'. Please see InnerException for more details." …
Run Code Online (Sandbox Code Playgroud) 我正在尝试获得结果,它只显示在CURRENT月的最后一天之前的OrderDates.我猜它会是这样的......
SELECT OrderDate
FROM Orders
WHERE OrderDate < (code for first day of the next month?)
Run Code Online (Sandbox Code Playgroud) 我有一个成功转换连接字符串的Web.Release.config.
当我添加一个microsoft.identityModel部分时,我得到一个警告说
未声明"http://schemas.microsoft.com/XML-Document-Transform"属性
并且变换在该部分不起作用.
为了让转换工作,我错过了什么?
在这里完成Web.Release.config
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MYNAME"
connectionString="metadata=res://*/Models.MYCOMPANY-Sales-Demo.csdl|res://*/Models.MYCOMPANY-Sales-Demo.ssdl|res://*/Models.MYCOMPANY-Sales-Demo.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=MYCOMPANYDemo;UID=MYCOMPANYDBUser;Password=********;multipleactiveresultsets=True;App=EntityFramework""
xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</connectionStrings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
<microsoft.identityModel>
<service>
<audienceUris>
<add value="http://MYCOMPANY-sales-demo.cloudapp.net/" xdt:Transform="Replace"/>
</audienceUris>
<federatedAuthentication>
<wsFederation realm="http://MYCOMPANY-sales-demo.cloudapp.net/" xdt:Transform="SetAttributes(realm)" />
</federatedAuthentication>
</service>
</microsoft.identityModel>
</configuration>
Run Code Online (Sandbox Code Playgroud) 我正在运行安装了PowerShell 2的Windows 7.
我从这里下载了2.1版 - http://pscx.codeplex.com/releases
发行说明说
我不确定是什么$ env:Home是如此有点搜索确定发行说明期望一个名为Home的环境变量在我的机器上不存在.
更多搜索说使用~
我的机器上定义的内容.所以在PS提示中我跑了cd ~
在我的机器上哪个导致网络驱动器 U:
我创建了以下目录U:\Documents\WindowsPowerShell\Modules
并将提取的Pscx-2.1.0复制到Modules文件夹.打开PowerShell提示符并键入Get-Module -ListAvailable
.这没有给我Pscx的结果.
上面的步骤实际上给了我这个文件夹树 U:\Documents\WindowsPowerShell\Modules\Pscx-2.1.0\Pscx-2.1.0
所以我将文件复制到一个级别并再次尝试,U:\Documents\WindowsPowerShell\Modules\Pscx-2.1.0\
并尝试使用U:\Documents\WindowsPowerShell\Modules\Pscx\
我也用这条路尝试了以上所有方法 U:\WindowsPowerShell\Modules\Pscx-2.1.0\
我猜测模块实际上不应该在这个目录中,因此更多的搜索会导致这个命令. (Get-ChildItem Env:\PSModulePath).Value
这给出了以下结果
C:\Users\my.name\Documents\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
所以我将Pscx-2.1.0文件夹复制到这里 C:\Users\my.name\Documents\WindowsPowerShell\Modules\Pscx-2.1.0
但仍然没有运气.
我错过了什么步骤?
我创建了一个地址为192.168.0.4的Azure DNS服务器
我创建了一个地址空间为192.168的虚拟网络.我将Subnet-1更改为
starting IP 192.168.10.0
Address Count 64
Address Range 192.168.10.0 - 192.168.10.63
Run Code Online (Sandbox Code Playgroud)
我使用PowerShell在单个云服务中创建了3个虚拟机映像.
$ADVM = New-AzureVMConfig -Name $ADVMName -InstanceSize Small -ImageName $ADVMImageName.ImageName |
Add-AzureProvisioningConfig -Windows -Password $AdminPassword |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 10 -DiskLabel 'datadisk2' -LUN 0 |
Add-AzureEndpoint -Protocol tcp -LocalPort 80 -PublicPort 80 -Name 'web' -LBSetName 'lbweb' -ProbePort 80 -ProbeProtocol http -ProbePath '/'
$SQLVM = New-AzureVMConfig -Name $SQLVMName -InstanceSize Medium -ImageName $SQLImageName.ImageName |
Add-AzureProvisioningConfig -Windows -Password $AdminPassword |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel 'datadisk2' -LUN 0 | …
Run Code Online (Sandbox Code Playgroud) sql-server ×3
t-sql ×3
powershell ×2
sql ×2
azure ×1
browser ×1
c# ×1
debugging ×1
printing ×1
sharepoint ×1
ssms ×1
transform ×1
web-config ×1
web-services ×1