Forum Replies Created

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

  • RE: Time as a high precision difference of dates

    the datetime2 datatype goes to 7 decimal places;

    can you show what it is you are trying to do?

    With MyCTE (TheTime)

    AS

    (

    SELECT convert(datetime2,'1900-01-01 0:12:14.1241234') UNION ALL

    SELECT '1900-01-01 0:08:16.361' UNION ALL

    ...

    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: Varchar(max) not storing all data

    bindish (9/4/2012)


    Yes data is there but its only 43600 characters. But the total size is 115000 characters.

    how are you checking the data? are you doing select len(YourVarcharColumn) From SomeTable? How...

    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: time to ms

    defintiely the problem.

    do a SELECT * FROM T WHERE isdate(time_column) = 0

    those are the values that cannot be converted, and raise an error.

    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: time to ms

    i think this will do what you wanted:

    With MyCTE (TheTime)

    AS

    (

    SELECT CONVERT(time,'0:12:14:124') UNION ALL

    SELECT '0:08:16:361' UNION ALL

    SELECT '0:08:57:705'

    )

    SELECT *,DATEDIFF(millisecond,cast('00:00:00' as time), TheTime)

    From myCTE

    Edit:

    late to 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: Msg15151, Level 16, State 1,Line 1

    well if you cannot change the code, kick it back to the developer and make them fix it, since it didn't work as expected, i guess.

    My shop is different; no...

    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: Views on Private Messaging

    t.brown 89142 (9/4/2012)


    I've attempted to answer a newbie question recently and because some of their data is private, some of the thread happened in private messages - which may be...

    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: Msg15151, Level 16, State 1,Line 1

    not sure about the error; typically that might be caused my the wrong schema, or an object name not being quoted;

    you seem to be doing both of those things;

    only thing...

    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: x-cmdShell access

    no, if you grant xp_cmdshell permissions, you cannot restrict the commands that they might use when they construct the strings.

    typically what you want to do instead is

    1. Remove access...

    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: Increment in sql server.

    if you can have an identity column in your table, you can create a calculated persisted column that auto generates that texty-like value.

    --#################################################################################################

    --Pattern: AA000 to ZZ999 max value=676000

    --#################################################################################################

    IF OBJECT_ID('X') 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: Unable to zip the backup data

    saidapurs (9/3/2012)


    Hi Lowell,

    Thanks a lot, my issue has been resolve and i have small doubt i am not able to same name on zip file.

    ...

    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 restrict Users from running SQL.

    for #2 & 3, why not create a new/different user, and use that for the off hours processing?

    have you determined what the impact would be if you killed the user...

    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: when Changing DB Default SET options.

    SQL Mad Rafi (8/31/2012)


    Thank you Lowell.

    i knew a bit in how to set the values, but my question was, can i go and change these DEFAULT settings just like 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: Extensible rule-based tool to find problems in stored procedures?

    not sure about extensibility, but i've seen two tools that look for issues, complexity, and rules for coding;

    http://sqlcop.lessthandot.com/

    http://www.sqlcodeguard.com/

    I'm not familiar with either one, but it's a starting point;

    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: when Changing DB Default SET options.

    you can change the default settings for your connections in SQL Server Management Studio in the Tools>>Options menu

    as soon as you change it, that would affect all NEW query windows...

    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: db_creator permission not working on SQL Server 2008 r2

    in that case, everyone who has CREATE DATABASE permissions must also have INSERT permissions on the logging table

    INSERT adminlog.dbo.dba_ddl_events

    no insert permissions (line 13, right, like the error said?) would cause...

    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 - 4,801 through 4,815 (of 13,460 total)