Forum Replies Created

Viewing 15 posts - 1,801 through 1,815 (of 13,460 total)

  • RE: DATABASE level selection settings help

    the order by will not eliminate any rows with the query you gave;

    only the WHERE condition does; if you are using a different query than the one you posted, show...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: DATABASE level selection settings help

    since there's an identity in the table, if you change hte order by to that column, do you get the data you want? it sounds like someone updated your date...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Distinct with a MAX()?

    i think a subquery featuring row_nubmer would work here:

    /*--Results

    RWFolderDocument NbrVersionNbr

    11Doc10

    12Doc21

    13Doc31

    13Doc40

    */

    ;WITH MyCTE([Folder],[Document Nbr],[VersionNbr])

    AS

    (

    SELECT 1,'Doc1',0 UNION ALL

    SELECT 2,'Doc2',0 UNION ALL

    SELECT 2,'Doc2',1 UNION ALL

    SELECT 3,'Doc3',0 UNION ALL

    SELECT 3,'Doc3',1 UNION ALL

    SELECT 3,'Doc4',0

    )

    SELECT *...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Job To Delete All Records Then Copy All From Another Table

    @tables are table variables.

    if you have a production table that starts with @, so that it deviates from standard sql naming conventions,you need to quotename the table:

    USE [Live_build]

    GO

    SET ANSI_NULLS ON

    GO

    SET...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Possible to tell whether function was passed a value or used default value

    Inside the stored procedure or function itself, yes, since you are assigning the value, you can log it, do additional logic because it was null or whatever.

    SELECT @Somedate =...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: mark a table or view in a t-sql script, and open/browse this table/view via hotkey

    yes, via keyboard shortcuts.

    i take advantage of this so much, it's crazy. i have shortcuts to script the definition of the hightlighted object, select top 100 fromt hat object, and...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Possible to tell whether function was passed a value or used default value

    well functions with an optional parameter, still have to have either a value or the KEYWORD specifically DEFAULT passed.

    unlike procedures, you cannot just leave a parameter off of...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SSIS 2008 – Read roughly 50 CSV files from a folder, create SQL table from them dynamically, and dump data.

    ok here's a link to an example package i put together for you:

    GenericCSVDynamicImport.zip

    it's in Visual Studio 2008, since you posted about SSIS 2008 ,but i've got the same thing that...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Backup all SSAS databases using TSQL

    Theo Ekelmans (4/20/2015)


    Hi Lowell,

    I've never renamed a SSAS DB, so... no i have not had the misfortune to run into this error.

    I would like to promise here that i will...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Running Ola script and getting error

    Tac11 (4/20/2015)


    Hi All,

    what would be the Full script if I want to run against 'AdventureWorks' database?

    EXECUTE dbo.IndexOptimize

    @Databases = 'AdventureWorks',

    @FragmentationLow = NULL,

    @FragmentationMedium = 'INDEX_REORGANIZE,INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',

    @FragmentationHigh = 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',

    @FragmentationLevel1 = 5,

    @FragmentationLevel2 = 30,

    @SortinTempdb =...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SSIS 2008 – Read roughly 50 CSV files from a folder, create SQL table from them dynamically, and dump data.

    I have done this with a script task, but it depends on the file structures and naming conventions.

    in my case, i got a zip file with an unknown number of...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: sp_help_revlogin creates logins but not roles for logins, etc

    http://www.tinyint.com/index.php/2009/07/08/sp_help_revlogin-cleaned-up-and-revised-with-roles/

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to create numerous directories on a server using data from sql table

    Jeff Moden (4/16/2015)


    Heh... I use xp_CmdShell to call PowerShell. 😛

    ...to run a TSQL command to start a SQL Agent Job which launches a Windows Scheduled Task?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: PK Non-CLUSTERED to CLUSTERED

    Talib123 (4/16/2015)


    Not me 3rd Party. The table is a Heap it is badly designed with far too many columns and serving many different purposes.

    They believe it will improve performance....

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to create numerous directories on a server using data from sql table

    SQL server does not have easy ways to do anything outside of a database, like files and folders.

    sql does not have any native way to play with files and folders.

    xp_cmdshell,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 1,801 through 1,815 (of 13,460 total)