Forum Replies Created

Viewing 15 posts - 946 through 960 (of 1,409 total)

  • RE: xp_cmdshell

    matt6288 (7/11/2013)


    Try putting the path in double quotes:

    del "D:\Program File\backup\FileA.bak"

    As Matt pointed out, double quotes are required when a space is in the path or filename. Allthough it's not required...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: conditional table selection

    Use the same technique as you get from the answers in your previous post http://www.sqlservercentral.com/Forums/Topic1472563-391-1.aspx

    Replace the "SELECT CASE" into an "IF" statement.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Moving data from Server-A/table-x to Server-B/Table-x

    Don't use single line code (like INSERT ... SELECT... FROM) for such large tables. Use an ETL tool instead. You can use SSIS (import/export wizard) or the BCP command line...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: conditional table selection

    That's an easy one: get the rowcount of the table and use this in a IF statement

    -- change the table name (currently: #temp) on two places in the code below

    if...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Require help to get number of hits to sql server 2008 R2 in a day

    What do you define as a "hit"?

    Every executed stored procedure, every executed batch, or every executed statement, or every active connection login, or....?

    The most basic(?) way to look at this...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Update to Base Table from Details Table

    Another solution is to PIVOT the #temp1 table and join this with the table you want to update

    -- Pivot source table and join with table to update

    Update #Customer_Profile_Master1

    set Co_apcode_1_categ =...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Update to Base Table from Details Table

    I don't think this is the fastest solution, but it will work:

    Select * from #Temp1

    Select * from #Customer_Profile_Master1

    Update #Customer_Profile_Master1

    set Co_apcode_1_categ = (select top 1 Category from #temp1 where rownumber =...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Check series is valid or not

    What about a simple CASE statement, will dat do the trick?

    Declare @firstno varchar(10) = 'V001',

    @scndno varchar(10) = 'V005'

    select count(*)...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Invoke Batch file from Remote machine

    There are several options you can use. It's preferred to execute the commands with a commandprompt utility like powershell. Examples can be found on the internet, just google a bit.

    You...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Maintainance Plan for my DB

    Hi,

    Take a look at http://ola.hallengren.com/. He has created a custom maintenance solution. These are highly recommended by many DBA's in the field.

    Edit: corrected the URL

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: MCSA 70-461 --Question 2

    Thanks Gail, I learned something new again.

    I thought that because a clustered index is always ordered, a scan would always be the same. I'm glad I didn't get this question...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Linked Server with restricted access

    You need access on both the source and the target.

    You need access on the source to get to your starting point of the linked server. You need access on the...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Linked Server with restricted access

    Just create the linked server connection and specify the user credentials in the code or in the "Security" page (when using the GUI).

    EXEC master.dbo.sp_addlinkedserver @server = N'{FQDN_instancename}', @srvproduct=N'SQL Server'

    EXEC master.dbo.sp_addlinkedsrvlogin...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: MCSA 70-461 --Question 2

    The answer is B.

    Does the exam kit has an explanation or link to why C should be the correct answer?

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Login failure to SQL instance in 2012

    Mac1986 (7/8/2013)


    when i execute the SQLCMD using my credential, it works fine. but whjen i put the same command in a SQL job and run it, it fails with Access...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **

Viewing 15 posts - 946 through 960 (of 1,409 total)