Forum Replies Created

Viewing 15 posts - 1,051 through 1,065 (of 13,460 total)

  • RE: SQL help required please !

    it depends on whether the data is stored as varchars or proper datetime/time data types.

    the datetime datatype allsowds you to add to it.

    if the columns are datetime, the CTE 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: How to always round UP to next place value??

    ok, so are you rounding up to the nearest power of 10, then?

    like this?

    SELECT Power(CONVERT(BIGINT, 10), N) AS MaxVal

    FROM (SELECT TOP 18 row_number()

    ...

    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: Find Duplicate Records in Table and Update one of them.

    prafuljemail (5/9/2016)


    update t

    set t.id1=999

    from t b join

    (

    select id1,max(id) as id from t

    group by id1 ) a on a.id=b.id

    select * from t

    The group by is fine if you KNOW...

    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 not working since upgrade from 2008 to 2014

    specific error is probably helpful; i suspect it's the column name is misspelled due to copy paste?

    or is it because the table busidentity is not in the join criteria on...

    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: To get of tables used in View

    there's a pair of functions that you can use to get either the things the views reference, or the things that the view consumes.

    --objects that USE the views

    SELECT

    schema_name(vwz.schema_id) As...

    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 Job, .BAT file and progress status

    that's a tough one, since the bat could be doing anything, and it's outside of SQL server.

    you could open up Task Manager on the server, but the real question 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: T-SQL for Sync SQL Agent Jobs between Instances

    i have specific jobs that are identical on all servers, things like backups, statistics, indexing.

    i connect via Central Management servers, and run the create job script on all of 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: Executing SSIS 2012 from stored proc in different server

    PJ_SQL (5/6/2016)


    I have SSIS 2012 (SSDT) residing in one server and I need to run the SSIS package from a different server.

    What is the process for that?

    not quite sure what...

    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: Find Duplicate Records in Table and Update one of them.

    a really nice feature is you an update on a cte affects the base table, so if you generate an identifier for dupes, you update everything that is a dupe.

    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: Create User without ALTER ANY USER

    so your applicaiton has sysadmin rights, and whenever it creates a login, it makes it sysadmin, and then adds a user i guess.

    if you kill it in a trigger, you'll...

    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: any tool that obfuscates an entire database schema?

    SqlBarbarian (5/6/2016)


    thanks! Exactly what I'm wonder. With SQL Sentry Plan explorer they anonymize to "column1", but all the column references in plan are consistent. So I was thinking something would...

    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: Create User without ALTER ANY USER

    remember there is a difference between a LOGIN and a USER.

    nothing gets any rights unless you add them to a group or role that gives them permissions.

    so, never add 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: any tool that obfuscates an entire database schema?

    obfuscate object names? that might make things difficult to get help with, because someone might suggest a change to the schema of a table, you have the mapping issue; 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: Corrupt Record - Non-relational database Structure

    ok, here's how i would tackle it;

    assuming your analysis on the two chars is correct, this produces both "versions"

    of the data;

    now i would simply test for high ascii, and take...

    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: Corrupt Record - Non-relational database Structure

    SQLRO (5/6/2016)


    If I try to remove leading zero from 0x0231 with

    STUFF(column_name,1,1,'') then it removes 02 as that is the first character in binary and makes the binary pattern as 0x31...

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