Friday, March 30, 2012
Load file
I want to know does mssql 2k had a command or function like mysql that (
load data infile.........) this synax?
??X wrote:
> I am using MSSQL 2000, I also using mysql.
> I want to know does mssql 2k had a command or function like mysql
> that ( load data infile.........) this synax?
Look at the BCP utility in BOL. You can also script data out using the
Import Export Wizard.
David Gugick
Imceda Software
www.imceda.com
|||Or the BULK INSERT command...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:OyhifiasEHA.2720@.TK2MSFTNGP12.phx.gbl...
> ??X wrote:
> Look at the BCP utility in BOL. You can also script data out using the
> Import Export Wizard.
> --
> David Gugick
> Imceda Software
> www.imceda.com
>
sql
Load file
I want to know does mssql 2k had a command or function like mysql that (
load data infile.........) this synax???_ wrote:
> I am using MSSQL 2000, I also using mysql.
> I want to know does mssql 2k had a command or function like mysql
> that ( load data infile.........) this synax?
Look at the BCP utility in BOL. You can also script data out using the
Import Export Wizard.
David Gugick
Imceda Software
www.imceda.com|||Or the BULK INSERT command...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:OyhifiasEHA.2720@.TK2MSFTNGP12.phx.gbl...
> ??_ wrote:
> Look at the BCP utility in BOL. You can also script data out using the
> Import Export Wizard.
> --
> David Gugick
> Imceda Software
> www.imceda.com
>
Load file
I want to know does mssql 2k had a command or function like mysql that (
load data infile.........) this synax?¬ÓªÌ¤§· wrote:
> I am using MSSQL 2000, I also using mysql.
> I want to know does mssql 2k had a command or function like mysql
> that ( load data infile.........) this synax?
Look at the BCP utility in BOL. You can also script data out using the
Import Export Wizard.
--
David Gugick
Imceda Software
www.imceda.com|||Or the BULK INSERT command...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:OyhifiasEHA.2720@.TK2MSFTNGP12.phx.gbl...
> ¬ÓªÌ¤§· wrote:
>> I am using MSSQL 2000, I also using mysql.
>> I want to know does mssql 2k had a command or function like mysql
>> that ( load data infile.........) this synax?
> Look at the BCP utility in BOL. You can also script data out using the
> Import Export Wizard.
> --
> David Gugick
> Imceda Software
> www.imceda.com
>
Friday, March 23, 2012
Listing Size of all user Databases in SQL2005
Thanks,
Refer to Books Online, Topic: sys.database_files
This will return the size as the number of 8K pages, so do the math in your query.
|||sp_helpdb will generate info about the dbname and size|||select * from sys.master_files
Will also give you useful information.
Listing Size of all user Databases in SQL2005
Thanks,
Refer to Books Online, Topic: sys.database_files
This will return the size as the number of 8K pages, so do the math in your query.
|||sp_helpdb will generate info about the dbname and size|||
select * from sys.master_files
Will also give you useful information.
Wednesday, March 21, 2012
listbox contents to sql stored procedure command parameter?
Stuck in a spot and hoping someone will nudge me in the right direction...
I'm trying to write to a sql db via a storedprocedure using a parameter. i'm pretty certain the below statement is causing the problem. but i'm not sure how to properly refer to it...
Dim connString As String
connString = "integrated security=false;user id=sa;server=HCENT1;database=LicenseRenewal;persist security info=False"
Dim myConnection As New SqlConnection(connString)
Dim myCommand As New SqlCommand("InsertPage1", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
' ......other (working) parameter statements.......
Dim parameterDates As New SqlParameter("@.Dates", SqlDbType.VarChar, 4000)
parameterDates.Value = Session("lstDates")
myCommand.Parameters.Add(parameterDates)myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
the session("lstDates") is the contents of lstDates.Items (listbox) from a previous page.
i'm guessing its not valid to refer to it as a varchar, can someone point me to the proper way to handle this?
tia
andyI would try Session("lstDates").ToString(), though I personally would try and debug it to see what exactly is in that session variable.
Are you getting an error message? If so, please give the EXACT message.|||thank you for the suggestion.
I've tried what you're saying and the table gets populated with the string:
"System.Web.UI.WebControls.ListItemCollection"
i took a stab in the dark and tried varbinary (sans .tostring) as the sqldatatype for the parameter/storedprocedure/columntype and i received:
Server Error in '/NET/LicenseRenewal' Application.
------------------------Object must implement IConvertible.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.InvalidCastException: Object must implement IConvertible.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidCastException: Object must implement IConvertible.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +196
LicenseRenewal.W4.WriteDBPage1() in C:\Documents and Settings\andrzej\VSWebCache\www.aea13.org\NET\LicenseRenewal\W4.aspx.vb:453
LicenseRenewal.W4.btnDONE_Click(Object sender, EventArgs e) in C:\Documents and Settings\andrzej\VSWebCache\www.aea13.org\NET\LicenseRenewal\W4.aspx.vb:158
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
Seems it can't automatically convert a collection of listbox items into a sql column list, a string list (not one long string however) in the column would be sufficient.
i welcome/appreciate any further input.
thank you
andy|||forgot to say, the contents of the session("lstDates") are various quantities (less then 25 typically) of strings following the 'syntax' of "02/02/04 From: 08:00 AM To 09:00 AM". The string gets compiled from a text box and 2 other listboxes and added to the lstDates. I know the session("lstDates") holds valid data because i've used the session info to reload the listbox without problems
http://www.aea13.org/net/licenserenewal/w1p2.aspx is the page that has the listbox, the page following that is supposed to write to the database when someone clicks on the bottom button.
I took copies of these 2 pages out of the full application, spliced them together and have butchered the code to get rid of non (error) relevant functions. only the relevant parts work for this testing purpose, also the button is only writing the single parameter to a lone table with a lone column.
thanks again.|||ok, got tired of fighting with it so went around it...
Dim connString As String
connString = "............."
Dim myConnection As New SqlConnection(connString)
Dim myCommand As New SqlCommand("test1", myConnection)
myCommand.CommandType = CommandType.StoredProcedureDim strTempString As String
Dim lstTempListbox As New ListBox
Dim arrTemparray As New ArrayList
Dim x As IntegerlstTempListbox.DataSource = Session("lstDates")
lstTempListbox.DataBind()For x = 0 To lstTempListbox.Items.Count - 1
If strTempString = "" Then
strTempString = lstTempListbox.Items(x).ToString
Else
strTempString = strTempString + lstTempListbox.Items(x).ToString
End If
NextDim parameterDates As New SqlParameter("@.Dates", SqlDbType.VarChar, 4000)
parameterDates.Value = strTempString
myCommand.Parameters.Add(parameterDates)myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
the table gets the data nicely formatted into a single cell and i can spit it back out in the RTF without formatting issues.
hope it helps someone else :)
andy
Monday, March 19, 2012
List Users in Windows Group
users within a Windows Group?
Thanks!!!
John E.
I don't think there is one.
If you want to know the users in a _SQL group_, you could use
sp_helpgroup
HTH
Rick Sawtell
MCT, MCSD, MCDBA
"John E." <anonymous@.discussions.microsoft.com> wrote in message
news:d39601c48ab6$d747e2b0$a601280a@.phx.gbl...
> What is the SQL Server command that will list out the
> users within a Windows Group?
> Thanks!!!
> John E.
|||Hi,
You have to execute the below command from command prompt:-
master..xp_cmdshell 'NET GROUP groupname /DOMAIN'
if it is a local group use the below command
master..xp_cmdshell 'NET LOCALGROUP administrators'
Thanks
Hari
MCDBA
"John E." <anonymous@.discussions.microsoft.com> wrote in message
news:d39601c48ab6$d747e2b0$a601280a@.phx.gbl...
> What is the SQL Server command that will list out the
> users within a Windows Group?
> Thanks!!!
> John E.
List Users in Windows Group
users within a Windows Group?
Thanks!!!
John E.I don't think there is one.
If you want to know the users in a _SQL group_, you could use
sp_helpgroup
HTH
Rick Sawtell
MCT, MCSD, MCDBA
"John E." <anonymous@.discussions.microsoft.com> wrote in message
news:d39601c48ab6$d747e2b0$a601280a@.phx.gbl...
> What is the SQL Server command that will list out the
> users within a Windows Group?
> Thanks!!!
> John E.|||Hi,
You have to execute the below command from command prompt:-
master..xp_cmdshell 'NET GROUP groupname /DOMAIN'
if it is a local group use the below command
master..xp_cmdshell 'NET LOCALGROUP administrators'
Thanks
Hari
MCDBA
"John E." <anonymous@.discussions.microsoft.com> wrote in message
news:d39601c48ab6$d747e2b0$a601280a@.phx.gbl...
> What is the SQL Server command that will list out the
> users within a Windows Group?
> Thanks!!!
> John E.
List Users in Windows Group
users within a Windows Group?
Thanks!!!
John E.I don't think there is one.
If you want to know the users in a _SQL group_, you could use
sp_helpgroup
HTH
Rick Sawtell
MCT, MCSD, MCDBA
"John E." <anonymous@.discussions.microsoft.com> wrote in message
news:d39601c48ab6$d747e2b0$a601280a@.phx.gbl...
> What is the SQL Server command that will list out the
> users within a Windows Group?
> Thanks!!!
> John E.|||Hi,
You have to execute the below command from command prompt:-
master..xp_cmdshell 'NET GROUP groupname /DOMAIN'
if it is a local group use the below command
master..xp_cmdshell 'NET LOCALGROUP administrators'
Thanks
Hari
MCDBA
"John E." <anonymous@.discussions.microsoft.com> wrote in message
news:d39601c48ab6$d747e2b0$a601280a@.phx.gbl...
> What is the SQL Server command that will list out the
> users within a Windows Group?
> Thanks!!!
> John E.
Monday, March 12, 2012
List of tables
Is there any command to find all the tables(including system tables) in SQLserver(I do not want to use enterprise manager).
Regards,Originally posted by sursujmad
Hi,
Is there any command to find all the tables(including system tables) in SQLserver(I do not want to use enterprise manager).
Regards,
You can use a sql request like this
select * from sysobjects where type = 's' or type = 'u'|||--Try
exec sp_tables
select user_name(uid)+'.'+name from sysobjects where xtype in ('U','S')
select * from information_schema.tables
Friday, February 24, 2012
List Available Sql Servers
I am trying to find the list of all available sqlservers...with something
like this and making it a .vbs and running it from the command promt on my
windows 2000 and write to text file.
can anybody help me with that.
Dim oListSvr
Set oServer = CreateObject("SQLDmo.SqlServer")
oServer.Application.ListAvailableSQLServers
'always clean up when you’re done
'oServer.DisConnect
Set oServer = Nothing
Thanks In Advance..chinn wrote:
> I am trying to find the list of all available sqlservers...with something
> like this and making it a .vbs and running it from the command promt on my
> Windows 2000 and write to text file.
> can anybody help me with that.
> Dim oListSvr
> Set oServer = CreateObject("SQLDmo.SqlServer")
> oServer.Application.ListAvailableSQLServers
> 'always clean up when youre done
> 'oServer.DisConnect
> Set oServer = Nothing
Hi,
Try this and let us know if it works. The output can be redirected to a text
file:
Option Explicit
Dim objSQL, objServers, j
Set objSQL = CreateObject("SQLDMO.Application")
Set objServers = objSQL.ListAvailableSQLServers()
For j = 1 To objServers.Count
Wscript.Echo objServers.Item(j)
Next
Set objServers = Nothing
Set objSQL = Nothing
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site - http://www.rlmueller.net
--|||check the output of the "isql.exe -L" utility.
"chinn" wrote:
> Hello,
> I am trying to find the list of all available sqlservers...with something
> like this and making it a .vbs and running it from the command promt on my
> Windows 2000 and write to text file.
> can anybody help me with that.
> Dim oListSvr
> Set oServer = CreateObject("SQLDmo.SqlServer")
> oServer.Application.ListAvailableSQLServers
> 'always clean up when you’re done
> 'oServer.DisConnect
> Set oServer = Nothing
> Thanks In Advance..