Forum Replies Created

Viewing 15 posts - 3,811 through 3,825 (of 13,460 total)

  • RE: SELECT FROM Multiple tables with names in a table

    based on your example code, Lynn's post, barely modified for the column name, works perfectly:

    declare @SQLCmd nvarchar(max);

    select

    @SQLCmd = stuff((select N'union select MFG from ' + TableName...

    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 FROM Multiple tables with names in a table

    my take on it, was to make a view from the data;

    you'd need to update the view whenever new rows get added.

    SELECT 'SELECT MFG FROM ' + ApplianceTypeTableName + '...

    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: Infrastructure change causes some reports to take 10X as long to generate.

    Steven.Howes (3/27/2013)


    Is this for the report server catalogs or the App DB?

    Any and all databases which used to exist in any version of SQL, and was restored/upgraded to a higher...

    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: Infrastructure change causes some reports to take 10X as long to generate.

    after an upgrade from a lower version to a higher version, it's pretty much mandatory to rebuild statistics with fullscan;

    the update engine uses different statistics/uses them differently, and performance 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: Catching culprits of high tempdb growth

    are you sure it's not an index rebuilding session that is making the tempdb grow? the frequency, of noticing once or twice a month sounds about right.

    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: Extract between <div> tags

    everyplace you have the column represented by @c must be replaced with a convert(nvarchar,@c); so if it's occurring 4 times in your expression, change all four...i think i missed 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: Extract between <div> tags

    convert the column to nvarchar(max) instead.

    SELECT SUBSTRING(

    CONVERT(NVARCHAR(max),YourColumn),

    CHARINDEX('>', @c) + 1,

    LEN(@c) - CHARINDEX('>', CONVERT(NVARCHAR(max),YourColumn)) - CHARINDEX('<',...

    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: Arithmetic overflow error converting varchar to data type numeric.

    change this to a larger number:

    SUM(CONVERT(DECIMAL(11, 0), a.value)) AS total

    something liek this:

    SUM(CONVERT(DECIMAL(19, 4), a.value)) AS total

    or

    SUM(CONVERT(float, a.value)) AS total

    does it work then?

    you keep bumping into the limits of 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: Forum Etiquette: How to post data/code on a forum to get the best help

    OK i now see that SQLFiddle is for MySQL, not SQL Server;

    i guess it is some kind of front end tester, where you can build a temporary schema in 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: SA Disabled\Locked

    no username or password.

    here's some detailed instructions:

    http://beyondrelational.com/modules/2/blogs/115/posts/11143/how-to-access-a-newly-installed-sql-server-2008-r2-instance-if-you-do-not-know-the-login-and-passwor.aspx

    from the machine itself,

    sqlservr -m"SQLCMD"

    then when connected, add yourself or a new admin:

    CREATE LOGIN [testAdmin] WITH PASSWORD=N'test@1234', DEFAULT_DATABASE=[master];

    EXEC sys.sp_addsrvrolemember @loginame = N'testAdmin', @rolename =...

    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: SA Disabled\Locked

    I found this recently:

    if powershell is installed on the server, you can use that to add yourself (your domain login) as a sysadmin;

    this example does the same thing by...

    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: Trigger For External Server Insertion

    a trigger featuring a linked server was what i was suggesting to avoid; network problems or permissions issues related to which remote user is used to insert into the remote...

    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: Schema Comparison Across 8000 databases

    i spent a bit of time on this same thing before, and it really depends on the results you are looking for, and how deep you want to make them...

    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: conversion explanation requested

    Tobar (3/26/2013)


    I see that part, but the error I was getting, which I should have mentioned in the beginning, was

    "Error converting data type nvarchar to numeric". And I don't think...

    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: Trigger i Oracle

    take a look at the syntax for an oracle trigger here:

    there's an example there, and you can see how fields are referenced with the :columnname indicator

    see if that helps 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!

Viewing 15 posts - 3,811 through 3,825 (of 13,460 total)