Forum Replies Created

Viewing 15 posts - 2,701 through 2,715 (of 13,460 total)

  • RE: Exporting Data directly into Excel from SQL makes it too big to handle

    SSMS has an option to save a query results directly to file, without displaying it(Control + Shift + F, then execute the query);

    that's an option you might want 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: Generate Table Scripts

    there are a lot of options for scripting that can be enabled/disabled;

    take a look in your Tools>>Options (in 2012 SSMS, it's Tools>>Options>>SQL Server Object Explorer>>Scripting

    and check your setting for "Script...

    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: Can't rename a object that belongs to non-dbo schema

    SQL Guy 1 (12/31/2013)


    I need to rename a foreign key. It is on a table which is not dbo.

    Here is what I run:

    exec sp_rename

    @objname ='schema_name.table_name.FK_old_name',

    @newname ='FK_new_name',

    @objtype ='Object'

    I get...

    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: Maintanance

    and with all those headaches for migrating SSIS maintenance plans, is there anything that the maintenance plans do that that the scripts from ola hallengren[/url] doesn't do from a TSQL...

    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: Restore 2008R2Express DB to 2012Express DB

    i think both the 2008R2 and the 2012 are on the same server, right?

    when you try to restore that 2008R2 backup, it's remembering where it's mdf and ldf files were...

    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 i run setup of sql server 2008 R2 on windows 7 it shows error "Windows is unable to start correctly 0Xc0000005"

    not quite enough information; are you saying the installer fails, and never installs SQL server, or are you saying AFTER you installed, the service won't start?

    if the installer successfully installed...

    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 convert character to datetime

    Rando (12/30/2013)


    That's where I run into the syntax error;

    Msg 241, Level 16, State 1, Line 1

    Syntax error converting datetime from character string.

    can you do a select to find non-convertable date...

    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 convert character to datetime

    if you explicitly convert it to datetime, your previous code would work:

    WITH SampleData AS(

    SELECT CAST( '2013-12-30 12:09:00.123' AS CHAR(24)) AS CounterDateTime

    )

    SELECT

    CONVERT(VARCHAR(10),convert(datetime,CounterDateTime),101) as Date,

    CONVERT(VARCHAR(5), convert(datetime,CounterDateTime), 108) + ' ' +...

    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 convert character to datetime

    additionally, your "time column" comes out bad because you are converting a varchar(24) to a varchar(5); effectively the same as a LEFT function.

    you get the '2013-' portion of the string,...

    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 convert character to datetime

    Rando (12/30/2013)


    I'm unable to convert a character field to datetime in TSQL.

    Column:

    CounterDateTime (char24), not null)

    Column Example Value:

    2013-12-30 12:09:00.123

    Code:

    SELECT

    CONVERT(VARCHAR(10),CONVERT(varchar,CounterDateTime),101) as Date,

    CONVERT(VARCHAR(5), CounterDateTime, 108) + ' ' + SUBSTRING(CONVERT(VARCHAR(19), CounterDateTime, 100),18,2)...

    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: Exception in Sending mail with C# task instead of SSIS mail task

    my working code for the same functionality is largely the same;

    i think you'll need to try-catch and get the inner exception and see what the server/connection issue is;

    I just tried...

    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 to extract Database and Object level permissions with Create_Date

    you can get the date an object is created from sys.objects create_date and modify_date.(tables/procs/views etc)

    you cannot get when a permission was granted. that date is not stored anywhere.

    if 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: bulk insert problem

    you should post the entire error, especially the error number.

    i'll bet this is security related...cant find file or some error like that.

    the reason: 'C:\Documents and Settings\ all folders there are...

    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 Express 2008 R2 Error on XP but not on Windows 7

    jdixon-586320 (12/30/2013)


    First off, I have started doing some testing and have found that if I don't use the user "sa" and password in the connection string on XP it allows...

    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: Help with getting a Table Count across multiple DBs

    my version is just an adaptation of Luis's: i'm just selecting the rows form the indexes, as the count is already materialized, and is faster on huge tables.

    Thank you Luis...

    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 - 2,701 through 2,715 (of 13,460 total)