Forum Replies Created

Viewing 15 posts - 9,226 through 9,240 (of 13,460 total)

  • RE: Selecting date before 6 months

    in TSQL, you'll want to use the DATADD function. when you add a negative number, it subtracts it from the date: you can use it to add or subtract 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: Missing Surface Area Configuration in SQL Server 2008

    it's been removed as a separate executable, and is all the pieces are moved around a bit, but are accessible in part of SSMS:

    http://www.mssqltips.com/tip.asp?tip=1673

    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: SysObjects and differing tables not based on name

    ok try this as a proof of concept: in your Sandbox, do a Select * into newtable from sometable, and then run this query:

    i'm using FORXML to concat all 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: Send Email using OPEN QUERY

    well syntactically, i think this is correct, but it's untested:

    SELECT * FROM OPENQUERY( [linked server],'SET FMTONLY OFF; EXEC (''declare @body1 varchar(4000)

    set @body1 = ''New Website Product as of '' +...

    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: Query tunning

    it might also be parameter sniffing; if you have parameters with default values on them, a query plan is probably built assuming the default value (ie myproc(@The date datetime =...

    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: Carriage return in xp_sendmail

    Set @Job = '<HTML>The following opportunity has been changed to ' + @Stage + ': '

    + '<br />'

    +'Subject: '+ @Subject

    + '<br />'

    +'Project Number: '+ @ProjectNumber

    + '<br...

    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: Remove DBCC Permissions

    DBCC SHRINKFILE is granted to the roles sysadmin and db_owner

    to remove permissions from a user, you'd most likely take away the db_owner role from them.

    there is no other way...

    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 a query....

    it might be more clear if it looked like this...the zero is the first date in SQL:

    select DATEADD(wk, DATEDIFF(wk,'19000101 00:00:00.000',getdate()), '19000101 00:00:00.000')

    --is the same as

    select DATEADD(wk, DATEDIFF(wk,0,getdate()), '19000101 00:00:00.000')

    --is 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: Help with a query....

    Dan this is one of the coolest things to use once you get your head wrapped around it.

    if you select DATEDIFF(wk,0,getdate())

    this will return week '5763' , which is 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: Help with a query....

    you can use the DATEADD and DATEDIFF function to determine the monday of the current week.

    --Monday of the Current Week

    select DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)

    so you want to avoid converting a datetime...

    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: isnumeric issue

    Steve i made an ITVF based on your example, but i added a bit more to it;

    i was thinking if i allow periods in the data, i need to check...

    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: DLL OR OCX??

    you probably heard wrong, i think.

    a SSRSreport is saved to a .rdl file(RDL=report definition language?), which is xml for the report's structure,design,location of all it's objects, etc.

    that is what 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: Use Database statement not working in an EXEC statement

    calvo's example is exactly correct, i think; the EXEC() statement is stand alone, and does not affect the session/window it is a part of.

    so to do what you want, 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: Duplicate records in the table

    this will give you the results featuring row_number(); use the inner portion of the query to see the raw results, the outer query returns just the duplicate items:

    productname,colorcode,categoryname,brandname,colorname

    SELECT * FROM...

    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

    will you be providing any details? For any meaningful answer we need the CREATE TABLE definitions of both tables, and which "value" (column) triggers some change to be propigated 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!

Viewing 15 posts - 9,226 through 9,240 (of 13,460 total)