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

Friday, March 30, 2012

Marking a subscription for reinitialization

Is there a command I can execute through SQL Query Analyzer that will mark a
subscription for reinitialization?
Thanks
Brad
Never mind...found my answer in BOL.
Brad
"Brad M." <anonymous@.discussions.microsoft.com> wrote in message
news:%23ve4jolJEHA.2576@.TK2MSFTNGP12.phx.gbl...
> Is there a command I can execute through SQL Query Analyzer that will mark
a
> subscription for reinitialization?
> Thanks
> Brad
>

Mapping Package Variables to a SQL Query in an OLEDB Source Component

Learning how to use SSIS...

I have a data flow that uses an OLEDB Source Component to read data from a table. The data access mode is SQL Command. The SQL Command is:

select lpartid, iCallNum, sql_uid_stamp
from call where sql_uid_stamp not in (select sql_uid_stamp from import_callcompare)

I wanted to add additional clauses to the where clause.

The problem is that I want to add to this SQL Command the ability to have it use a package variable that at the time of the package execution uses the variable value.

The package variable is called [User::Date_BeginningYesterday]

select lpartid, iCallNum, sql_uid_stamp
from call where sql_uid_stamp not in (select sql_uid_stamp from import_callcompare) and record_modified < [User::Date_BeginningYesterday]

I have looked at various forum message and been through the BOL but seem to missing something to make this work properly.

http://msdn2.microsoft.com/en-us/library/ms139904.aspx

The article, is the closest I have (what I belive) come to finding a solution. I am sure the solution is so easy that it is staring me in the face and I just don't see it. Thank you for your assistance.

...cordell...

Not sure what your problem is; but the solution is to create a variable to hold your query, let's say [User::SQLStatement] and use as value your query. Then set EvaluateAsExpression property of the variable to true. In the expression property, create an expression that will be evaluate at run time where you concatenate your query with the [User::Date_BeginningYesterday] variable. Back in your OLE DB Component you need to choose 'SQL Statement from variable' and then choose [User::SQLStatement] from the list.

Notice that you need to cast the value of [User::Date_BeginningYesterday] to string in the expression builder before concatenating its value to the sql statement.

Rafael Salas

select lpartid, iCallNum, sql_uid_stamp
from call where sql_uid_stamp not in (select sql_uid_stamp from import_callcompare) and record_modified < [User::Date_BeginningYesterday]

|||

The question that I have is: Can one embed a package variable into a sql statement while selecting "SQL Statement" from the data access mode. If so how would would go about that?

...cordell...

|||

The short answer is no. you cannot reference a SSIS variable directly in your sql statement. You need to use '?' and then use the parameter mapping in your OLE DB source OR, to concatenate it within a second varibale as I described in the previous post.

Rafael Salas

sql

Monday, March 26, 2012

Map One generic Input column to multiple Destination column

I have a stored proc I am updating in an OLEDB Command from the results of a Transform Script Component. The Stored Proc has over 65 input parameters, most of them have a NULL passed in. I dont want to create output columns in the Transform Script Component for all of them to map them from the "Available Input Columns" to "Available Destination Columns".

I want to create 3 or 4 generic Output columns for their data type - say IntegerOutput (datatype Int), DateTimeOut (datatype datetime) and so on. The I want to map these generic columns in the OLEDB Command as Available Input Columns" to multiple "Available Destination Columns" - wherever the datatype matches the input column.

But the OLEDB Command Column Mappings let me map One to One only. This will create a huge and unnecessary workload for me to develop and maintain - when I tell you I have 3 such stored procedures, all of whose interfaces are exactly same and for which I can create similar Output columns in the Transform Script Component.

So how do I go about doing this the smart way?

thanks in advance!

Hi,

You can use "Copy Column" transformation component to copy one input column to multiple output columns. If you have to perform some computing between original and new columns, you can use "Derive Column" transformation.

Jean-Pierre Riehl

http://blog.djeepy1.net

http://www.bewise.fr

|||Sorry not very elegant, this is more work than creating all the output columns one by one. I want to create one DataType_NULL Column which I want to reuse to map to the destination columns.

|||For what you are describing I would probably just call the stored procedure from inside the script component. As you have seen, the OLE Command doesn't really support this, so script, Copy Column, or Derived Column are the only way to do this that I am aware of.

Monday, March 19, 2012

Manually delete FullText Catalog

Hi all,
How can I manually delete a fulltext catalog, via query analyzer?
What is the command
I can't delete it via enterprise manager!
thanks in advance,
FabioSee sp_fulltext_catalog.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Fabio" <fabio@.glb.com.br> wrote in message news:eLCvRlTCFHA.3120@.TK2MSFTNGP12.phx.gbl...
> Hi all,
> How can I manually delete a fulltext catalog, via query analyzer?
> What is the command
> I can't delete it via enterprise manager!
> thanks in advance,
> Fabio
>

Manual Starting SQL Server ... delay...

When I start the SQL Server by command prompt for single user mode it is
taking lots of time(15 minutes) to start the SQL Server. My computer is a
slow system but it is not very bad slow computer.
IS it a resonable time or not?
SQL 2K.
Thanks,
Smith
Therefore you should look in the SQLServer logs,how much time the databases
need to come up,on every start the database are checked while opened if any
inconsictencys exsists. If so,the database is "repaired" (open transactions
are rolled back,etc.). The betteryou leave the system duringthe shutdown the
faster it gets up on a restart.
SQL Server logs can be found in the Control node of SQL Server -- Current
Log.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
"Arora Smith" <Arora_Smith@.hotmail.com> schrieb im Newsbeitrag
news:%233MaZErfFHA.460@.TK2MSFTNGP09.phx.gbl...
> When I start the SQL Server by command prompt for single user mode it is
> taking lots of time(15 minutes) to start the SQL Server. My computer is a
> slow system but it is not very bad slow computer.
> IS it a resonable time or not?
> SQL 2K.
> Thanks,
> Smith
>
>

Manual Starting SQL Server ... delay...

When I start the SQL Server by command prompt for single user mode it is
taking lots of time(15 minutes) to start the SQL Server. My computer is a
slow system but it is not very bad slow computer.
IS it a resonable time or not?
SQL 2K.
Thanks,
SmithTherefore you should look in the SQLServer logs,how much time the databases
need to come up,on every start the database are checked while opened if any
inconsictencys exsists. If so,the database is "repaired" (open transactions
are rolled back,etc.). The betteryou leave the system duringthe shutdown the
faster it gets up on a restart.
SQL Server logs can be found in the Control node of SQL Server -- Current
Log.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Arora Smith" <Arora_Smith@.hotmail.com> schrieb im Newsbeitrag
news:%233MaZErfFHA.460@.TK2MSFTNGP09.phx.gbl...
> When I start the SQL Server by command prompt for single user mode it is
> taking lots of time(15 minutes) to start the SQL Server. My computer is a
> slow system but it is not very bad slow computer.
> IS it a resonable time or not?
> SQL 2K.
> Thanks,
> Smith
>
>

Manual Starting SQL Server ... delay...

When I start the SQL Server by command prompt for single user mode it is
taking lots of time(15 minutes) to start the SQL Server. My computer is a
slow system but it is not very bad slow computer.
IS it a resonable time or not?
SQL 2K.
Thanks,
SmithTherefore you should look in the SQLServer logs,how much time the databases
need to come up,on every start the database are checked while opened if any
inconsictencys exsists. If so,the database is "repaired" (open transactions
are rolled back,etc.). The betteryou leave the system duringthe shutdown the
faster it gets up on a restart.
SQL Server logs can be found in the Control node of SQL Server -- Current
Log.
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Arora Smith" <Arora_Smith@.hotmail.com> schrieb im Newsbeitrag
news:%233MaZErfFHA.460@.TK2MSFTNGP09.phx.gbl...
> When I start the SQL Server by command prompt for single user mode it is
> taking lots of time(15 minutes) to start the SQL Server. My computer is a
> slow system but it is not very bad slow computer.
> IS it a resonable time or not?
> SQL 2K.
> Thanks,
> Smith
>
>