Showing posts with label case. Show all posts
Showing posts with label case. Show all posts

Tuesday, March 27, 2012

ActiveX VBScript DTS IsDate

Can someone explian why I get a return of not a valid date when using
activeX vbscript for DTS:
Select (Date())
Case (IsDate(Date())
msgbox "OK"
Case Else
msbox "I cant figure this out"
End Select
msbox "I cant figure this out" pops rather than msgbox "OK"Your Select Case statement is malformed. Try:
Select Case IsDate(Date())
Case True
MsgBox "OK"
Case Else
MsgBox "I cant figure this out"
End Select
Hope this helps.
Dan Guzman
SQL Server MVP
<lebeau777@.hotmail.com> wrote in message
news:1143836184.567616.6570@.z34g2000cwc.googlegroups.com...
> Can someone explian why I get a return of not a valid date when using
> activeX vbscript for DTS:
> Select (Date())
> Case (IsDate(Date())
> msgbox "OK"
> Case Else
> msbox "I cant figure this out"
> End Select
> msbox "I cant figure this out" pops rather than msgbox "OK"
>|||Please ignore my previous response (copy/paste error). The script should
be:
Select Case IsDate(Date())
Case True
msgbox "OK"
Case Else
msgbox "I cant figure this out"
End Select
Hope this helps.
Dan Guzman
SQL Server MVP
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:u45IViZVGHA.3716@.TK2MSFTNGP15.phx.gbl...
> Your Select Case statement is malformed. Try:
> Select Case IsDate(Date())
> Case True
> MsgBox "OK"
> Case Else
> MsgBox "I cant figure this out"
> End Select
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> <lebeau777@.hotmail.com> wrote in message
> news:1143836184.567616.6570@.z34g2000cwc.googlegroups.com...
>

Thursday, February 9, 2012

Accessing network drive from SQL Analyzer

Not sure if this posted or not before, so just in case, I'm doing it again.
I have SQL2000 on a Win2000 server. Using windows explorer, I have mapped a
network drive to letter "F"
While in SQL Analyzer, I'm trying to access "F" but I can't. I can access C
and D which are local drives, but not F.
If you are curious, I'm trying to access it by simply doing xp_cmdshell 'dir
f:'
Once this works, I'm planning to use a restore operation which we will read
from that drive.
Does anyone know how to access a mapped network drive from SQL Analyzer? It
will greatly appreciated.
thanks,
PPHi
Did you log onto the SQL Server using the SQL Server service account, map
the drive and then log off again?
If not, that is the way you should do it.
Generally, it is best to use UNC naming (\\machinename\sharename\) when
accessing resources over the network.
Backup and restores have to be done via UNC paths as mapped drives are not
supported for those operations.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"PP" <PP@.discussions.microsoft.com> wrote in message
news:422C6736-9887-450A-B83D-3F7A9B30799B@.microsoft.com...
> Not sure if this posted or not before, so just in case, I'm doing it
> again.
> I have SQL2000 on a Win2000 server. Using windows explorer, I have mapped
> a
> network drive to letter "F"
> While in SQL Analyzer, I'm trying to access "F" but I can't. I can access
> C
> and D which are local drives, but not F.
> If you are curious, I'm trying to access it by simply doing xp_cmdshell
> 'dir
> f:'
> Once this works, I'm planning to use a restore operation which we will
> read
> from that drive.
> Does anyone know how to access a mapped network drive from SQL Analyzer?
> It
> will greatly appreciated.
> thanks,
> PP