Forum Replies Created

Viewing 15 posts - 571 through 585 (of 13,460 total)

  • RE: Issue with OUT Param

    CREATE PROCEDURE outputParamTest(@Count int OUTPUT)
    AS
    BEGIN
    --do something that affects some number of rows.
    SELECT * INTO #temp FROM sys.tables
    SELECT @Count = @@ROWCOUNT

    END

    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: Filtering data based on sum

    most likely you are looking for the HAVING function.

    so something like this:
    SELECT cust_id,sum(orderAmount) As TheSum
    From SomeTable
    Group by cust_id
    HAVING sum(orderAmount) > 1000

    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: Getting max(date) and relevant unique GUID

    maybe using row_number will get what you are after?
    With LatestGUIDBasedOnCompDate
    AS
    (
    SELECT Row_number() OVER(Partition BY ID ORDER BY ISNULL(CompDate,'1900-01-01') DESC) AS RW,
    ID,
    CUST_ID,
    CompDate
    FROM...

    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: SQL Server DBA Certification

    I went through the effort to get the MCSA for SQL 2012/2014. That let me take a single test to get the MCSA for 2016 So I've got TWO MCSAs....

    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: ssrs configuration manager

    i believe what the error is saying is in the operating system on the machine that hosts SSRS, you have to be a local admin on the box...typically you'd add...

    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: concatenate three fields with one date field

    you have to convert all your fields to the same explicit data type.
    here's a full example, based on your copy/paste:
    note my CTE, which represents your data, has three...

    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: A severe error occurred on the current command. The results, if any, should be discarded

    That Msg 0/State 0/Line 0 is upsetting; i expect better error reporting than that.

    it might be a known issue, that requires updating to the latest patches for 2005;...

    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 add datetime stamp to a file being exported using bcp

    bcp , because it is actually a command line utility,, only takes static strings, and not variables for parameters.
    there's a few ways to do this.
    you could always write...

    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: SSMS - Central Management Server - SQL Auth?

    CMS is always Windows auth only,
    but in the same section of Registered Servers, you can add Local Server Groups, and credentials for SQL logins can be saved there;
    the...

    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: Registering all sql instances in ssms

    I strongly recommend using Registered Servers with both Central Management Servers and Local Server Groups, a little used feature in SSMS that can be a huge boost to your organizing...

    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 raise error forcebily

    i suspect what you really need to do is produce an exception report to find data that was inserted or updated, but that now violates a business rule, which is...

    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: select statement for JSON in SQL Server 2016

    your paste was huge, and it also appears to be a partial paste, as it's not terminated correctly. huge things like that belong in an attachment, really, and not pasted...

    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: row size exceeds the maximum 8060

    I built a simple query to insertmax length varchars for  all the fields.
    I am able to insert and select via TSQL.

    could the issue be coming from your...

    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: performance information for sql server and databases

    i think your performance problem is probably the multiple OR statements; that's likely causing a table scan.
    WHERE ( [PropertyAddress].[LocAddress1] != [PropertyAddress].[bioAddress1]
                       OR [PropertyAddress].[LocAddress2] != [PropertyAddress].[bioAddress2]

    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: ALTERing a Stored Procedure in SSMS 2016

    that's actually a setting in SSMS that you can toggle back and forth.
    Assuming SSMS 2016, If you go to Tools>>Options>>SQL Server ObjectExplorer>>Scripting
    You currently have a checkmark for...

    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 - 571 through 585 (of 13,460 total)