Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

syntax of repeated conditionals?

$
0
0

Hi Experts, 

I'm new to powershell and wondering why this throws an error :

$all =[long] [Microsoft.SqlServer.Management.Smo.DatabaseObjectTypes]::Table `
        -bor [Microsoft.SqlServer.Management.Smo.DatabaseObjectTypes]::View
        -bor [Microsoft.SqlServer.Management.Smo.DatabaseObjectTypes]::StoredProcedure
        -bor [Microsoft.SqlServer.Management.Smo.DatabaseObjectTypes]::UserDefinedFunction
        -bor [Microsoft.SqlServer.Management.Smo.DatabaseObjectTypes]::Schema

But this does not:

$all =[long] [Microsoft.SqlServer.Management.Smo.DatabaseObjectTypes]::Table `
        -bor [Microsoft.SqlServer.Management.Smo.DatabaseObjectTypes]::View  -bor [Microsoft.SqlServer.Management.Smo.DatabaseObjectTypes]::StoredProcedure -bor [Microsoft.SqlServer.Management.Smo.DatabaseObjectTypes]::UserDefinedFunction -bor [Microsoft.SqlServer.Management.Smo.DatabaseObjectTypes]::Schema

Also, is there an equivalent to this (SQL)?  

where DatabaseObjectTypes in ('Table','View','Stored Procedure', 'UserDefinedFunction','Synonym')

Thanks in advance!  


Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>