Forum Replies Created

Viewing 15 posts - 1,816 through 1,830 (of 13,460 total)

  • RE: Backup all SSAS databases using TSQL

    Theo thanks for the script!

    i got it to work on a regular basis on most of my servers that have SSAS, but I've got an exception on one SSAS database:...

    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 get a list of SubReports

    this worked for me:

    /*--results

    t Name="DistributionCoderPerHour"><ReportName>Code...lots of XML follows

    t Name="DistributionDataEntryPerHour"><ReportName>Da...lots of XML follows

    */

    WITH MyCTE

    AS

    (

    select convert(varchar(max),CONVERT(varbinary(max),Content))As StrContent,*

    from ReportServer$MSSQLSERVER1.dbo.Catalog

    --where name ='CPU - Dynamics UpLoad'

    )

    SELECT SUBSTRING(StrContent,p1.i + 9,p2.i - p1.i),* FROM MyCTE

    CROSS...

    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: // in a SQL query

    // is the default way to add a line of a comment in the C++ / C# /C#.Net language.

    most likely they just copied lots of stuff to give toy you,...

    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 get a list of SubReports

    as a proof of concept, i searched the xml of the RDL for the tab <subreport, and confirmed that this gets me pretty close to findingf the names of 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: DDL Trigger to prevent dropping of a specific table?

    SQL-DBA-01 (4/10/2015)


    HI Lowell,

    Please suggest how to capture DML operation here.

    Thanks

    Sourav

    there is no DML in a DDL trigger...but there is a command text.

    if you mean command from the DDL trigger 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: script, that returns all SPs to a given table, incl. the access type

    I've used the Microsoft.SqlServer.SqlParser.SqlCodeDom.SqlScript object to create a parser that found all the objects in a given query, so that i could format the whitespace to my own rules.

    it's a...

    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: sysadmin database-level permissions

    could it be a legacy of a normal user who got access to multiple databases, and then someone upgraded them to sysadmin, because they needed more and more access to...

    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: Copy Database Wizard fails from 2008 to 2014

    i think it's the secondary file. i've seen this before, and the script it creates names both files the same name, ie you'd expect dbname.mdf and dbname.ndf and dbname.ldf, but...

    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: IsDate() function returns wrong results

    the two values you posted will convert to datetime2, but not date or datetime; maybe that's it?

    --select convert(date,'04/01/200') -- error

    select convert(datetime2,'04/01/0200')

    --select convert(date,'200-04-01') -- error

    select convert(datetime2,'0200-04-01')

    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 authentication account with read-write access to only 1 table

    people only have access what you grant them, but you have to be careful with granting roles like db_datareader or giving people sysadmin rights.

    here's a full example:

    Create LOGIN [ClarkKent] WITH...

    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: Trying to return simple results from a simple TSQL Query.

    convert has an optional third parameter for <style>, so when used on a money or smallmoney data type, you can get four digits to teh right with no commas,...

    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: Creating a delimited string

    great job with the same data!

    here's one way to do it, featuring FOR XML to do the concatenation:

    /*--Results

    Email(No column name)

    Branch101@ACA.comA54, A56, A59

    Branch102@ACA.comB49, B54, B10

    Branch103@ACA.comC80

    */

    SELECT Email

    ,STUFF(

    ...

    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: Trying to return simple results from a simple TSQL Query.

    you have to explicitly convert [AccountBalance] to append it to your string:

    Select Company + ',' + [AccountNumber] + ',' + CONVERT(varchar,[AccountBalance])

    from customer

    where accountbalance = 0

    order by accountbalance

    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: Error handling with in cursor

    Naveen J V (4/7/2015)


    SP is also fine, but again SP needs to be called for each table right?

    and transaction should be handled with in SP or what?

    the stored proc can...

    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: Error handling with in cursor

    that would be the default action for dynamic sql within a cursor, then. just don't wrap the cursor in a transaction.

    i would not use a cursor for this, but pending...

    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,816 through 1,830 (of 13,460 total)