Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

Thursday, March 22, 2012

Unbundling SQLCMD From SQL Server 2005 ?

Hi all,

I was wondering if it would make sense for Microsoft to unbundle SQLCMD from SQL Server 2005. The tool is a basically a command line *client* tool, right?

I have a machine that I would love to put SQLCMD on to do remote admin work but to do so I need to install SQL Server 2005 Express, at a minimum. I would love to be able to just download SQLCMD (and of course the needed DLLs) and install it.

What do you think?

Thanks.

-Alan

This question was answered in a posting to 'microsoft.public.sqlserver.tools' by Jasper Smith:

You can get it from here
http://www.microsoft.com/downloads/details.aspx?familyid=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en#filelist

You will need the SQL Native client and SQLCMD downloads. The filenames are

sqlncli.msi
SQLServer2005_SQLCMD.msi

HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com

Unbundling SQLCMD From SQL Server 2005 ?

Hi all,
I was wondering if it would make sense for Microsoft to unbundle SQLCMD
from SQL Server 2005. The tool is a basically a command line *client*,
right?
I have a machine that I would love to put SQLCMD on to do remote admin
work but to do so I need to install SQL Server 2005 Express, at a
minimum. I would love to be able to just download SQLCMD (and of course
the needed DLLs) and install it.
What do you think?
-Alan
You can get it from here
http://www.microsoft.com/downloads/d...ng=en#filelist
You will need the SQL Native client and SQLCMD downloads. The filenames are
sqlncli.msi
SQLServer2005_SQLCMD.msi
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"Alan Foxmore" <AFoxmore@.yahoo.com> wrote in message
news:OH2T3m%23VGHA.5076@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I was wondering if it would make sense for Microsoft to unbundle SQLCMD
> from SQL Server 2005. The tool is a basically a command line *client*,
> right?
> I have a machine that I would love to put SQLCMD on to do remote admin
> work but to do so I need to install SQL Server 2005 Express, at a minimum.
> I would love to be able to just download SQLCMD (and of course the needed
> DLLs) and install it.
> What do you think?
> -Alan
>
|||"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:usOldSCWGHA.3332@.TK2MSFTNGP02.phx.gbl...
> You can get it from here
> http://www.microsoft.com/downloads/d...ng=en#filelist
> You will need the SQL Native client and SQLCMD downloads. The
> filenames are
> sqlncli.msi
> SQLServer2005_SQLCMD.msi
> --
> HTH,
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
Wonderful! Thanks so much!!!!!

> "Alan Foxmore" <AFoxmore@.yahoo.com> wrote in message
> news:OH2T3m%23VGHA.5076@.TK2MSFTNGP11.phx.gbl...
>

Tuesday, March 20, 2012

/logger option

Hi,

I'm trying to use the below command to execute for generating the log file for SSIS package.

DTExec /FILE "C:\Documents and Settings\CP0808\My Documents\Test.dtsx" /logger "DTS.LogProviderTextFile;c:\log.txt"

But it got the error as below. Please advise.

Started: 10:03:20 AM
Error: 2006-10-06 10:03:21.15
Code: 0xC001000E
Source: Test
Description: The connection "c:\log.txt" is not found. This error is thrown b
y Connections collection when the specific connection element is not found.
End Error
Error: 2006-10-06 10:03:21.18
Code: 0xC001000E
Source: Test
Description: The connection "c:\log.txt" is not found. This error is thrown b
y Connections collection when the specific connection element is not found.
End Error
Error: 2006-10-06 10:03:21.21
Code: 0xC02020EA
Source: Test Log provider "{1AEAB490-1124-4A84-981F-7C1FDD80A721}"
Description: The connection manager "c:\log.txt" is not found. A component fa
iled to find the connection manager in the Connections collection.
End Error

Hi,

the logger option in DTEXEC specifies an already existing connection within the package. YOu will have to create a file location within the package to reference it.

Have a look here: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=72104

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Hi,

I still got the error as below.

DTExec /FILE "C:\Documents and Settings\CP0808\My Documents\Test.dtsx" /CONNECTION DestinationConnectionFlatFile;"c:\test.csv" /CONNECTION SourceConnectionOLEDB;"Data Source=test;User ID=user;Initial Catalog=DATA_CONV;Provider=SQLNCLI;Auto Translate=false;PASSWORD=password" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING EWCDI /l "DTS.LogProviderTextFile;log.txt" /Set "\package.Connections[log.txt].Properties[ConnectionString];c:\log.txt"

Error: 2006-10-10 09:57:21.07
Code: 0xC001000E
Source: Test
Description: The connection "log.txt" is not found. This error is thrown by C
onnections collection when the specific connection element is not found.
End Error
Error: 2006-10-10 09:57:21.10
Code: 0xC001000E
Source: Test
Description: The connection "log.txt" is not found. This error is thrown by Connections collection when the specific connection element is not found.
End Error
Warning: 2006-10-10 09:57:21.14
Code: 0x8001F02F
Source: Test
Description: Cannot resolve a package path to an object in the package ".Connections[log.txt].Properties[ConnectionString]". Verify that the package path is valid.
End Warning
Warning: 2006-10-10 09:57:21.17
Code: 0x80012017
Source: Test
Description: The package path referenced an object that cannot be found: "\package.Connections[log.txt].Properties[ConnectionString]". This occurs when an attempt is made to resolve a package path to an object that cannot be found.
End Warning
DTExec: Could not set \package.Connections[log.txt].Properties[ConnectionString]
value to c:\log.txt.
Started: 9:57:20 AM
Finished: 9:57:21 AM
Elapsed: 0.5 seconds

Monday, March 19, 2012

.sql scripts NEBIE ALERT

I am new to SQL 2005
I want to know how to run a .sql file someone gave me to create a new
database. Where is the command or gui to do this.
Thanks
NEBIEHi,
From SQL Server 2005 program groups; open SQL Server Management Studio..
Connect to SQL Server..Open a Query window...
Oprn the .SQL file and press execute or press F5 to execute the SQL File.
Otherwise from command prompt using SQLCMD you could use -ic:\file.SQL to
execute the SQL file
Thanks
Hari
"frogman7" <frogman7@.googlemail.com> wrote in message
news:1160363466.452205.98690@.b28g2000cwb.googlegroups.com...
>I am new to SQL 2005
> I want to know how to run a .sql file someone gave me to create a new
> database. Where is the command or gui to do this.
>
> Thanks
> NEBIE
>

.sql scripts NEBIE ALERT

I am new to SQL 2005
I want to know how to run a .sql file someone gave me to create a new
database. Where is the command or gui to do this.
Thanks
NEBIEHi,
From SQL Server 2005 program groups; open SQL Server Management Studio..
Connect to SQL Server..Open a Query window...
Oprn the .SQL file and press execute or press F5 to execute the SQL File.
Otherwise from command prompt using SQLCMD you could use -ic:\file.SQL to
execute the SQL file
Thanks
Hari
"frogman7" <frogman7@.googlemail.com> wrote in message
news:1160363466.452205.98690@.b28g2000cwb.googlegroups.com...
>I am new to SQL 2005
> I want to know how to run a .sql file someone gave me to create a new
> database. Where is the command or gui to do this.
>
> Thanks
> NEBIE
>|||i also found if you double click the file it will request the database
password.

.sql scripts NEBIE ALERT

I am new to SQL 2005
I want to know how to run a .sql file someone gave me to create a new
database. Where is the command or gui to do this.
Thanks
NEBIE
Hi,
From SQL Server 2005 program groups; open SQL Server Management Studio..
Connect to SQL Server..Open a Query window...
Oprn the .SQL file and press execute or press F5 to execute the SQL File.
Otherwise from command prompt using SQLCMD you could use -ic:\file.SQL to
execute the SQL file
Thanks
Hari
"frogman7" <frogman7@.googlemail.com> wrote in message
news:1160363466.452205.98690@.b28g2000cwb.googlegro ups.com...
>I am new to SQL 2005
> I want to know how to run a .sql file someone gave me to create a new
> database. Where is the command or gui to do this.
>
> Thanks
> NEBIE
>

Sunday, March 11, 2012

.NET Provider for SAP and variables

Hi,

I am using .NET Provider for SAP to import data from SAP BW to the SQL-Server 2005.

The OLE-DB source has an sql command like this

"exec Z_SQL_EXPORT @.I_WEEK_FROM='200601', @.I_WEEK_TO='200602'

I want to make this command more flexible by using a variable strWEEK_FROM and strWEEK_TO.

How can I do this?

Thank you for yout help.

Gerd

Two methods, expressions or OLE-DB parameters.

You can use a ? as the placeholder, so like this -

exec Z_SQL_EXPORT @.I_WEEK_FROM=?, @.I_WEEK_TO=?

Then go to the parameters dialog in the source and map the variables to the placholders.

This is a better method, I think, more secure for a start, but does not always work due to what the parameter is or the OLE-DB provider.

or

Create a variable and set EvaluateAsExpression to true.

Set the expression on the variable to build the string you require, perhaps something like this, but do some proper date formatting -

"exec zsqlexport @.week = '" + (DT_WSTR, 10)@.[Varname] + "'"

Change the source query type to be SQL Command from variable.

|||

Thanks DarrenSQLIS for your answer.

I found similar informations on other web-sites.

When I try to use your first possibility and click OK in the dialog box then I receive the response

"Error in data-flow-task: An error occured...".

How can I "map the variables to the placholders"?

Then I treid the second solution, but with the oledb-data-provider for sap I found no possibibilty to change the source type to SQL command from variable.

Can you help me again?

Thanks.

Gerd.

|||

Sorry, my mistake. The SAP provider is a ADO.Net managed provider, so of course you use the DataReader Source which does not have the same options as the OLE-DB Source.

There is no parameter support, but you can use an expression. Rather than using a variable, you can set a property expression actually on the SqlCommand property for the DataReader source.

To set an expression a component property (not all component properties upport though however), you need to be in the context of the data flow. Either select the task in Control View, or just click on a clean area of the Data Flow design surface, and then look at the Properties grid, showing the properties of that task. Now select Expressions from the properties grid. You can then select the SqlCommand property for the instance of the data reader source you wish to work against.

|||

Thanks again,

this works!

For those who have a similar problem, I found an article that give a detailled description on how to work with datareader expressions and sqlcommand:

http://www.vsteamsystemcentral.com/cs/blogs/applied_team_system/archive/2006/5/7.aspx