Forum Replies Created

Viewing 15 posts - 1,216 through 1,230 (of 13,460 total)

  • RE: how to create a stored procedure that checks the version of the server before execution?

    i like to convert the first two octets to a decimal for comparison, ie 9.0/10.0/10.5/11.0/12.0/13.0 etc

    SELECT SERVERPROPERTY('ProductVersion'),

    CONVERT(decimal(5,2), Parsename(CONVERT(VARCHAR(30), Serverproperty('productversion')), 4)

    ...

    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: Access Granted for : CREATE USER [Domain1\UserName] FOR LOGIN [Domain1\UserName]

    if you are restoring from another server, any changes you made will be lost, so you would need to either:

    1. grant that read access in the original server/database before backup...

    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: subtracting a case statement result from a Convert(char(8) result

    don't change data types.

    if you are using dates, use DATEADD and DATEDIFF functions. don't convert them to strings, or any other data type.

    something like this returns the minutes in difference(if...

    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: Update Trigger - Keep Old value unchanged for a column

    what is someone is updating the value from blank/null to a desired value, instead of just changing it? is it ok to update from blank to good value? or prevent...

    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: Access Granted for : CREATE USER [Domain1\UserName] FOR LOGIN [Domain1\UserName]

    creating a user does not give then any access to the objects within the database; they are added to thePUBLIC role in the database, which typically doesn't give them anything.

    if...

    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 can I get the Graphical plan from XML

    if you save the xml to a file, with no other changes, save it to the extension *.xdl, ie Deadlocks.xdl.

    when you double click that, that extension will open up 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: BCP text file is adding an extra line at the end of the file

    I'm going to agree with Orlando's lat post that this is the expected behavior.

    {somedata} + {row delimiter}, which in this case is CrLf, puts the cursor on 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: Bit of a "Newbie" question. Compare and join databases.

    Jeff Moden (3/13/2016)


    davros30 (3/13/2016)


    SQLC is another good tool that will meet your needs. RedGate is also a very good tool but it is expensive.

    SQLC is very affordable. 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 can I find which database owns this table ?

    mw112009 (3/11/2016)


    Nice syntax...

    I was just playing with the SQl and ran the following

    exec sp_MSforeachdb 'SELECT top 1 ''?'' As DatabaseName FROM [?].sys.tables '

    However it only listed about...

    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 can I find which database owns this table ?

    this will work:

    if the database name shows up, it has a table with that name:

    exec sp_MSforeachdb 'SELECT ''?'' As DatabaseName FROM [?].sys.tables WHERE name = ''ClmRejRept'' '

    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: Auto generated SQL code

    Previous place i worked at had a code base like that, created by an offshore team.

    There was only a project manager, and no onsite developer reviewing the code produced, so...

    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: Exporting Data in .SAS format

    I never had to do this, but i found this interesting!

    i found a good article on SQLTips called "Transferring data from SAS to SQL Server and back":

    https://www.mssqltips.com/sqlservertip/2659/transferring-data-from-sas-to-sql-server-and-back/

    so if you don't...

    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 Computed Column on Alter statement

    a calculated column cannot have an if statement; you canuse a CASE though

    something like this is what i think you wnat:

    SET QUOTED_IDENTIFIER ON

    ALTER TABLE Schedule ADD

    [SubmitDate] AS

    CASE

    WHEN REVIEWDueStatus=10 AND...

    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: Getting the error "Maximum stored procedure, function, trigger, or view nesting level exceeded"

    I think it's a going to take a good rewrite and step back from trying to modify the existing, and just join these three tables together, and trim off any...

    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 when using third party dll files in a script task

    i'm pretty sure that all third party dlls have to be registered in the Global Assembly Cache(GAC) as it's not enough to just have the dll's in the folder, when...

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